julianhyde/optiq — pull request #246 by vkorukanti (2014-04-11 01:47:05+00:00)
Title: Fetch and Limit RexNodes are ignored when creating a new SqlRel object f...

...rom existing SqlRel.

With recent optiq 0.6-SNAPSHOT there were few test cases related to LIMIT are failing in Drill. @jinfengni and I debugged the issue. It turns out the when creating a new SqlRel object from an existing SqlRel object, we ignore passing fetch and offset RexNodes from source to new SqlRel object. We were hitting this issue in ```RelStructuredTypeFlattener. rewriteRel```. This code path of flattening is newly added in change https://github.com/julianhyde/optiq/commit/3f127ce51ff424409e0e54afa62ac34d49734ebb.

We also noticed there is one another place ```RelDecorrelator``` where we ignore the offset and fetch. Not sure which query hits this code path, so didn't add any test cases to test this code path.