amrishlal commented on a change in pull request #8029:
URL: https://github.com/apache/pinot/pull/8029#discussion_r819826831
##########
File path:
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
##########
@@ -369,6 +369,9 @@ private static PinotQuery
compileCalciteSqlToPinotQuery(String sql) {
DataSource dataSource = new DataSource();
dataSource.setTableName(fromNode.toString());
pinotQuery.setDataSource(dataSource);
+ if (fromNode instanceof SqlSelect || fromNode instanceof SqlOrderBy) {
Review comment:
OK, thanks for the reference. I would suggest changing this logic to:
```
if (fromNode != null) {
DataSource dataSource = new DataSource();
if (fromNode instanceof SqlSelect || fromNode instanceof SqlOrderBy) {
dataSource.setSubquery(compileSqlNodeToPinotQuery(fromNode));
} else {
dataSource.setTableName(fromNode.toString());
}
pinotQuery.setDataSource(dataSource);
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]