DonnyZone edited a comment on issue #1593: [CALCITE-3513] Unify TableFunction 
implementor's NullPolicy and its behavior
URL: https://github.com/apache/calcite/pull/1593#issuecomment-576201786
 
 
   @vlsi Thanks for review. Actually, I do not have a clear direction for this 
work now. Let me clarify it and look forward to hearing your advice.
   At the beginning, I found that `NullPolicy.ANY` is not appropriate for all 
TableFunctions. 
   For example, the query in 
TableFunctionTest#testMultipleScannableTableFunctionWithNamedParameters`.
   ```
   select * from table("s"."Maze"(HEIGHT => 3, WIDTH => 5)`
   ```
   It passes `null` argument (i.e., 
`org.apache.calcite.util.Smalls.MazeTable.generate2(5, 3, null)`), but the 
result is not `null`.
   
   Then, I think `NullPolicy.NONE` may be more suitable. But it prevents users 
to define their own NullPolicy in their implementations.
   
   In the end, I inclined to adopt the approach (`getNullPolicy(Method m)`) as 
that in `ScalarFunctionImp`.
   But I found that we do not have any standards to handle the case when a 
table function returns `null`, as the NPE in tests. Therefore, 
`NullPolicy.ANY/STRICT/ARG0` seems to be meaningless.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to