SQL Writer Semantics for Any-Column Partitioning

Example queries valid for any-column partitioning.

Example 1

SELECT * FROM my_tpf( 
  TABLE( SELECT T.x, T.y FROM T )
  OVER( PARTITION BY T.x ) )

In this example, the UDF describes to the server that the data is partitioned by the first column (T.x) and the SQL writer also explicitly requests partitioning on the same column. When the two columns match, the above query proceeds without any errors using this negotiated query:

my_tpf( TABLE( SELECT T.x, T.y FROM T ) 
     OVER ( PARTITION BY T.y, T.x ) )
V4 describe_parameter_get API returns: { 2, 2, 1 }

Example 2

SELECT * FROM my_tpf( 
  TABLE( SELECT T.x, T.y FROM T )
  OVER( PARTITION BY ANY ) )

In this example, nether the SQL writer nor the UDF specify a specific column for partitioning. Iinstead the SQL writer partitions the input table and, as a result, the server arranges partitioning in a nonvalue-based scheme and the data is partitioned over ranges of rows.