-
1. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
shawkins May 10, 2016 8:16 AM (in response to menvi.usa)Are you working with a prepared or a regular statement? For a prepared statement the limit is currently not considered part of the plan, so it is applied after initial processing.
-
2. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
menvi.usa May 10, 2016 8:33 AM (in response to shawkins)Steven, Thank you for the quick response.
I am using the regular statement. The requestMsg.statementType=STATEMENT
-
3. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
shawkins May 10, 2016 8:36 AM (in response to menvi.usa)Can you supply the query plan? SimpleDB is marked as supporting row limit, so it should be pushed if possible.
-
4. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
menvi.usa May 10, 2016 9:42 AM (in response to shawkins)In the generatePlan() method of Request class:
command (Query) = SELECT BV_AmazonSimpleDB.TICKER.ItemName, BV_AmazonSimpleDB.TICKER.PRICE, BV_AmazonSimpleDB.TICKER.SYMBOL FROM BV_AmazonSimpleDB.TICKER LIMIT 50
processPlan= AccessNode(0) output=[BV_AmazonSimpleDB.TICKER.ItemName, BV_AmazonSimpleDB.TICKER.PRICE, BV_AmazonSimpleDB.TICKER.SYMBOL] SELECT BV_AmazonSimpleDB.TICKER.ItemName, BV_AmazonSimpleDB.TICKER.PRICE, BV_AmazonSimpleDB.TICKER.SYMBOL FROM BV_AmazonSimpleDB.TICKER LIMIT 50
In DQPCore class after the workItem.run() is completed, resultsFuture has result= ResultsMessage rowCount=1024 finalRow=-1
-
5. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
rareddy May 10, 2016 1:02 PM (in response to menvi.usa)Megha,
The way Teiid works is, if you provided a LIMIT clause on your SQL statement, then based on the translator's capability it will either push that LIMIT clause to source or not. If not pushed it will apply that condition in the Teiid engine. In this case it looks like it is pushing down, but not being honored by SimpleDB. You can probably issue the above command directly to SimpleDB and see of that is the case. Otherwise it will take code change to either to make this capability turned off or managed through a translator override property.
Ramesh..
-
6. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
menvi.usa May 11, 2016 2:48 AM (in response to rareddy)Ramesh,
I did query the AmazonSimpleDB (using RazorSQL tool) with the above SELECT statement having LIMIT clause and could see that the LIMIT clause is supported by SimpleDB.
It is working fine and I got exact number of rows as defined in the LIMIT.
-
7. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
shawkins May 11, 2016 9:35 AM (in response to menvi.usa)From Using Select to Create Amazon SimpleDB Queries - Amazon SimpleDB it looks like the meaning of the limit clause is different than normal sql. It is the max page size, not the overall result limit - so it looks like we need to turn off explicit support for limit and instead use the batch size as a hint to set the page size limit. Megha, can you log an issue for this?
-
8. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
shawkins May 17, 2016 9:50 AM (in response to shawkins)[TEIID-4207] Limit pushdown is incorrect for simpldb - JBoss Issue Tracker was logged to capture this issue.
-
9. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
menvi.usa May 24, 2016 2:48 AM (in response to shawkins)Hey Steve, sorry did not get a chance to look into this in past few days. Thanks for logging the issue.
So, after this change in the Teiid layer, how will it look from my end when a limited number of records are to be retrieved. Will I still be sending the required number in the rowLimit field and Teiid will take care of it or there needs to be a change on my end.
-
10. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
shawkins May 24, 2016 7:56 AM (in response to menvi.usa)With the fix you'll see just the expected number of rows returned to the client - we'll also try to ensure that only that number is pulled from Cassandra as well.
-
11. Re: Teiid returning back all the Rows from Amazon Simple DB even when RowLimit is set
menvi.usa May 24, 2016 8:41 AM (in response to shawkins)great. Thanks Steve.