I'm trying to run a query with runSuiteQLPaged but...
# suiteql
c
I'm trying to run a query with runSuiteQLPaged but it results in a error:
Search error occurred: Invariant check for stage 'INPUT' check failed for 'SELECT [5x] FROM [1x] GROUP BY [1x]'
Running the same query within the tool from Tim Dietrich runs fine, it's using the runSuiteQL funtion though. Anyone noticed this error before? I'm not having a group clause in my SuiteQL btw so NetSuite probably wraps the query
r
I am not sure if something is wrong in your query or not. But In tim's suitelet you will find that instead of using runpaged for his query. He has created his custom while loop and the query is such that results have their own row number based on which he runs the query until all the results are found. He had mentioned somewhere why he did that I have forgotten. I personally started using his approach in my queries as well and never had an issue. Otherwise grouping. Unions, etc were giving different results if results were not ordered properly
c
yeh I noticed the difference but using that function is actually giving me an issue with a map/reduce on the other hand. Running a specific query runs fine within seconds in a suiteql tool but with that function, my map/reduce results in a execution limit error
r
I don't think it should. I have used the same logic for querying on multiple instance without any issue with result set going as large as 50-80k. For 50k result. The query ran 10-16 times as in each while loop iteration I was doing 1 query to fetch 5000 results. Can you share your code?