Re: Appropriate query syntax for table-value function windowing (e.g. CALCITE-3272)

2019-09-10 Thread Rui Wang
I should have given more context but I think Julian's response is similar and close to (if not just the same as) what I faced. I tried "select * FROM TABLE(TUMBLE_TVF(ORDERS, ROWTIME, INTERVAL '10' MINUTE))" named parameters, TABLE ORDERS, TABLE(ORDERS), DESCRIPTOR(ROWTIME), etc. were not

Re: Appropriate query syntax for table-value function windowing (e.g. CALCITE-3272)

2019-09-10 Thread Julian Hyde
Are you referring to problems parsing this: SELECT * FROM Tumble ( data => TABLE Bid , timecol => DESCRIPTOR ( bidtime ) , dur => INTERVAL '10' MINUTES , offset => INTERVAL '0' MINUTES ); If so I can see how "TABLE Bid” and "DESCRIPTOR ( bidtime ) “ might cause the validator

Re: Appropriate query syntax for table-value function windowing (e.g. CALCITE-3272)

2019-09-10 Thread Rui Wang
I might have identified the first blocker: I am using sql identifier as parameters for table name and column name (not character literals), which is already how current TUMBLE works as current TUMBLE accepts an identifier as the first parameter to specify the TIMESTAMP column. During planner

Re: Appropriate query syntax for table-value function windowing (e.g. CALCITE-3272)

2019-09-06 Thread Julian Hyde
To be pedantic. Note that “strings” in SQL are called character literals and are enclosed in single-quotes. My example also used named parameters. These used quoted identifiers. SQL identifiers are enclosed in double-quotes. Julian > On Sep 5, 2019, at 22:25, Rui Wang wrote: > > I see. I

Re: Appropriate query syntax for table-value function windowing (e.g. CALCITE-3272)

2019-09-05 Thread Rui Wang
I see. I think you are directing to using STRING for the table and descriptor parameters. If so I think it's a good idea to do prototyping. I am digging into implementation to prototype a version of "TABLE(TUMBLE("table_name", "column_name", INTERVAL))" now. -Rui On Wed, Sep 4, 2019 at 8:03 PM

Re: Appropriate query syntax for table-value function windowing (e.g. CALCITE-3272)

2019-09-04 Thread Julian Hyde
Maybe they’re keywords? If so does it help to include them in double-quotes? e.g. myFun(“TABLE” => ’myTable’, “DESCRIPTOR” => ‘myDescriptor’) Julian > On Aug 29, 2019, at 7:46 PM, Rui Wang wrote: > > And I think both TABLE and DESCRIPTOR are not supported as (table)function >

Re: Appropriate query syntax for table-value function windowing (e.g. CALCITE-3272)

2019-08-29 Thread Rui Wang
And I think both TABLE and DESCRIPTOR are not supported as (table)function parameters? TABLE parameter: TABLE(table_name) or TABLE table_name to specify an input table. DESCRIPTOR parameter: DESCRIPTOR(column_name, ...) to specify columns from the input table. -Rui On Thu, Aug 29, 2019 at

Re: Appropriate query syntax for table-value function windowing (e.g. CALCITE-3272)

2019-08-29 Thread Rui Wang
Thanks Julian for your explanation and the pointer. I will go to the direction of TABLE(Function) syntax then. -Rui On Thu, Aug 29, 2019 at 3:03 PM Julian Hyde wrote: > Standard SQL doesn’t allow functions in the FROM clause. I think it’s > because tables and functions are in different

Re: Appropriate query syntax for table-value function windowing (e.g. CALCITE-3272)

2019-08-29 Thread Julian Hyde
Standard SQL doesn’t allow functions in the FROM clause. I think it’s because tables and functions are in different namespaces (and therefore there could be a table and a function with the same name). So you need to use the TABLE keyword to indicate that you are using a function as a table.

Appropriate query syntax for table-value function windowing (e.g. CALCITE-3272)

2019-08-29 Thread Rui Wang
Hi Community, I have been searching and trying Calcite's query syntax to match CALCITE-3272 (TUBME as a table function call). Currently, the closest syntax in Calcite I found is: FROM TABLE(TUMBLE(params...)) The better syntax should be: FROM