roger-mike commented on pull request #16911: URL: https://github.com/apache/beam/pull/16911#issuecomment-1085188425
> It looks like you are failing in this line of code: > > https://github.com/apache/beam/blob/77e924fd5a025326b50352c29598ea1eb48d385a/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/ExpressionConverter.java#L213 > > What this means is something in a previous step was converted from ZetaSQL to Calcite wrong. There is a ZetaSQL ResolvedProjectScan that references the forth column (index 3) but the calcite List only has three columns. > > You might be able to add some asserts earlier in the conversion to help you find the issue. I'm currently working on the [function](https://github.com/apache/beam/pull/16911/files#diff-b497391b74a7130be5217a2d4ede920fe66059444bc248a6710ad9b6361ac2b3R81) that converts the input, I noticed the error might be occurring because [this](https://github.com/apache/beam/pull/16911/files#diff-b497391b74a7130be5217a2d4ede920fe66059444bc248a6710ad9b6361ac2b3R104) ```projects``` parameter doesn't have all the ```RexNode``` objects that it needs. I took a look at the ```AggregateScanConverter``` implementation of this [input conversion](https://github.com/apache/beam/blob/4dddaf9c3d70b5b858c16265abee4cdbf0c72631/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/AggregateScanConverter.java#L121) and it seems that it adds ```groupByList``` and ```aggregateList``` from the zetaNode as ```RexNodes``` to the ```LogicalProject``` as ```projects``` and ```fieldNames```. I'm not sure how to make a similiar procedure for the ```AnalyticScan```, given that it doesn't have either a ```groupByList``` or an ```aggregateList```. My question here is, what is the logic or purpose of converting and adding these lists (```projects``` and ```fieldNames```) to a ```LogicalProject```? @apilloud @ibzib -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
