-
Notifications
You must be signed in to change notification settings - Fork 94
Add table lookup entry point to SqlToSubstrait #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hey @rymurr, I don't think this is the right pattern. As part of validation, the validator needs to figure out resolution based on current schema versus root schema. I also think it may be the case that some of the identifiers you'd find in nested queries wouldn't be tables (not sure on that). I think you need to plugin closer to the schema apis. That being said, I'm not sure the best pattern to do so. I remember at Dremio we actually had a fork of Calcite for exactly this purpose. Maybe @laurentgo would have some advice on whether those changes have been pushed back into Calcite using some kind of pattern. |
|
Seems to me we need This pr first finds all the sql identifier in the parse tree, and then try to match/find the identifier in |
|
Thanks a lot for the feedback @jinfengni and @jacques-n I have updated to use a catalog. Do you think this is a better approach? |
|
Thanks for the review @jacques-n caught a few bugs and fixed them in the most recent iteration. |
|
This looks reasonable to me. Merging. |
* Add table lookup entry point to SqlToSubstrait Co-authored-by: Jacques Nadeau <jacquesnadeau@gmail.com>
This uses a function to look up a table schema without a create table statement. I've intentionally kept the interface free from calcite objects so as to not export them as part of the isthmus public API.
I am not an expert at calcite so I am not sure if this is the best way to do it. Also, note, my fix adds state to the converter. Happy to adjust based on input.