vlsi 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-576206023
 
 
   Ok, so your main question is "what should Calcite do when a table function 
returns NPE"?
   
   Oracle makes it indistinguishable from an empty collection.
   
   For instance:
   
   ```sql
   select * from dual, table(cast(null as sys.odcinumberlist)) t;
   
   DUMMY | COLUMN_VALUE
   0 rows
   
   select * from dual, table(sys.odcinumberlist()) t;
   
   DUMMY | COLUMN_VALUE
   0 rows
   
   select * from dual, table(cast(null as sys.odcinumberlist))(+) t;
   DUMMY | COLUMN_VALUE
       Y | [NULL]
   1 row
   
   select * from dual, table(sys.odcinumberlist())(+) t;
   DUMMY | COLUMN_VALUE
       Y | [NULL]
   1 row
   ```
   
   > Therefore, NullPolicy.ANY/STRICT/ARG0 seems to be meaningless
   
   It is probably more to optimization and/or prevent invocation of the 
function on invalid inputs.
   For instance, if NullPolicy is set to `ANY`, then enumerable executor won't 
invoke the function in case there are null arguments.
   
   On the other hand, treating `null` table function result as an empty table 
is a different issue.

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