Hi, Cao, thanks for your feedback.



—— "Firstly, table alias could be supported in the hint?"

I think table alias couldn't be supported in the hint just like what you say 
and only table name and view name are supported in the hint temporarily. 
Currently, the alias will be ignored when the SqlNode is converted to RelNode 
in calcite SqlToRelConverter. User can use view instead of using alias as an 
alternative now. I'll add this to Flip.




—— "Secondly, could you demonstrate more about '*Join Hint semantic check', 
*how could we check the table name or view name?"



Join Hint semantic check happens before optimizing the plan. For view name, we 
can append an internal view tag hint named "HINT_VIEW" to the RelNode which is 
the root RelNode expanded by a view in ExpandingPreparingTable#expand, and 
directly get the view name in "HINT_VIEW" hint. For table name, we can 
recursive find the table name by TableScan. The only trouble is to isolate 
subquery and view from top-level query because the join hints only take effect 
in the top-level scope. But this is a specific implementation detail, and will 
not be recorded in this Flip because I think Flip is mainly used to describe 
the changes about api. You can focus on the specific PRs below this Flip later.


—— "I think the inherit info should also be used to check, not only using the 
table name."
I don't understand this and could you add an example to explain this question?



--

    Best!
    Xuyang

Reply via email to