gustavodemorais commented on PR #27886:
URL: https://github.com/apache/flink/pull/27886#issuecomment-4298050594

   I've tried to simplify the code as much as possible, @twalthr. It's not 
trivial to implement this feature: having only one place where we resolve the 
traits is unfortunately conceptually not possible. I've adjusted the code so 
that all downstream code can simply read the traits and assume they're 
resolved. For that, I had to resolve it in three places
   
     1. SystemTypeInference.resolveStaticArgs — validation, called once each 
from inferInputTypes and inferType. Twice per validation pass.                  
                                                                                
          
     2. BridgingSqlFunction.resolveCallTraits — planning, called from 
FlinkLogicalTableFunctionScan converter.
     3. BridgingSqlFunction.resolveCallTraits — restore, called from 
StreamExecProcessTableFunction.@JsonCreator. 
   
   We have to resolve it inside SystemTypeInference's inferType and 
inferInputType because we only there have the actual Call passed as a param. We 
have to resolve it in FlinkLogicalTableFunctionScan because it's the first 
place we actually create the RexCall. And we also have to resolve it 
StreamExecProcessTableFunction which is where we restore our unresolved RexCall 
from the compiled plan.
   
   Now, all relevant places where we read traits should receive the resolved 
traits


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

Reply via email to