Join hints across dialects #3892
-
I have a project where the base dialect is The challenge is that if we insert join hints in the base I'm trying to figure out a good strategy for something like
but I'm struggling to find the syntax to insert the hints at step 2 using Thanks! p.s. A HUGE win would also being able to swap out |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Regarding the hints, what about patching or subclassing the Presto dialect to bring the hint support back in? E.g. you would allow them to be parsed but the generator would still omit them so you don't get invalid Presto SQL if you wanted to target that instead of Spark. The semi-join one would need to be implemented as a pre-generation transformation, i.e. something similar to what we have in EDIT: with "to bring the hint support back in" I meant reverting this change, i.e. adding |
Beta Was this translation helpful? Give feedback.
Regarding the hints, what about patching or subclassing the Presto dialect to bring the hint support back in? E.g. you would allow them to be parsed but the generator would still omit them so you don't get invalid Presto SQL if you wanted to target that instead of Spark.
The semi-join one would need to be implemented as a pre-generation transformation, i.e. something similar to what we have in
transforms.py
. I'd probably look into preprocessingexp.Select
and looking forexp.In
expressions, so you then check if those can be transformed into semi-joins and transform theSelect
accordingly.EDIT: with "to bring the hint support back in" I meant reverting this change, i.e. adding
"/*+"
back to