deepthi912 opened a new pull request, #17047:
URL: https://github.com/apache/pinot/pull/17047

   Reference issue: https://github.com/apache/pinot/issues/15522
   
   Issue with NATURAL JOIN is we don't specify on which column the join is 
applied on, hence the virtual columns get included into the common columns. 
   In Calcite, the logic for deriving common columns is different for NATURAL 
JOIN: 
https://github.com/apache/calcite/blob/7a0564a7d0b2629d4537fcfd6879528bde378d9f/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L603
   
   Even if we try to extend the existing public methods that can be modified to 
take in common columns excluding virtual, the sources are created from Schema 
in the `SqlValidatorImpl` and it will still have virtual columns which will 
throw `QueryValidationError: Index 66 out of bounds for length 54 `at 
[exception](https://github.com/apache/calcite/blob/7a0564a7d0b2629d4537fcfd6879528bde378d9f/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L8009)
   
   **Solution:** The better solution I am proposing here for this is to detect 
the `NATURAL JOIN` from the query and update the catalog and PinotTable to 
exclude virtual columns when building schema.
   
   
   


-- 
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]

Reply via email to