[jira] [Commented] (CALCITE-3916) Support cascades style top-down driven rule apply

2020-08-10 Thread Haisheng Yuan (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-3916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17175077#comment-17175077
 ] 

Haisheng Yuan commented on CALCITE-3916:


thanks for reporting, [~rubenql]. how is the scan operator with the specific 
rel id generated?

> Support cascades style top-down driven rule apply
> -
>
> Key: CALCITE-3916
> URL: https://issues.apache.org/jira/browse/CALCITE-3916
> Project: Calcite
>  Issue Type: Improvement
>  Components: core
>Reporter: Haisheng Yuan
>Assignee: Jinpeng Wu
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.24.0
>
>  Time Spent: 15.5h
>  Remaining Estimate: 0h
>
> Apply rules by leaf RelSet -> root RelSet order. For every RelNode in a 
> RelSet, rule is matched and applied sequentially. No RuleQueue and 
> DeferringRuleCall is needed anymore. This will make space pruning and rule 
> mutual exclusivity check possible.
> Rule that use AbstractConverter as operand is an exception, to keep backward 
> compatibility, this kind of rule still needs top-down apply.
> This should be done after CALCITE-3896.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4171) Support named parameters for table window functions

2020-08-10 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17174963#comment-17174963
 ] 

Julian Hyde commented on CALCITE-4171:
--

I removed 'fixVersion = 1.25'. 1.25 has shipped.

Did you test parameters in different orders, and with values missing for 
earlier parameters? 
Permuting parameters is tricky.

What was your rationale for making the parameter names for HOP etc. lower-case? 
Most built-in SQL objects are upper-case so that people can use them without 
double-quoting. (I couldn't find examples of parameter names in the SQL 
standard, but in any case, we should do as the standard does.)

Did named parameters work for table functions before this? In other words, did 
you just get it to work for the 3 table functions HOP, TUMBLE, SESSION? If so, 
you should change the subject to clarify.

> Support named parameters for table window functions
> ---
>
> Key: CALCITE-4171
> URL: https://issues.apache.org/jira/browse/CALCITE-4171
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.23.0, 1.24.0
>Reporter: Danny Chen
>Assignee: Danny Chen
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Supports window functions like named params style:
> {code:sql}
> select *
> from table(
> session(
>   data => table Shipments,
>   timecol => descriptor(rowtime),
>   key => descriptor(orderId),
>   size => INTERVAL '10' MINUTE))
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CALCITE-4171) Support named parameters for table window functions

2020-08-10 Thread Julian Hyde (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-4171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Hyde updated CALCITE-4171:
-
Fix Version/s: (was: 1.25.0)

> Support named parameters for table window functions
> ---
>
> Key: CALCITE-4171
> URL: https://issues.apache.org/jira/browse/CALCITE-4171
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.23.0, 1.24.0
>Reporter: Danny Chen
>Assignee: Danny Chen
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Supports window functions like named params style:
> {code:sql}
> select *
> from table(
> session(
>   data => table Shipments,
>   timecol => descriptor(rowtime),
>   key => descriptor(orderId),
>   size => INTERVAL '10' MINUTE))
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3916) Support cascades style top-down driven rule apply

2020-08-10 Thread Ruben Q L (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-3916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17174374#comment-17174374
 ] 

Ruben Q L commented on CALCITE-3916:


[~FatLittle], [~hyuan], FYI, I have a prototype with TopDown activated, and 
recently I updated it and this change causes a {{ClassCastException}} here:
https://github.com/apache/calcite/blob/aadb605decd6bb6a853e23fac4b0f479b2397e06/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleDriver.java#L548
with message:
{code}
...
Caused by: java.lang.ClassCastException: MyTableScanOperator cannot be cast to 
com.onwbp.org.apache.calcite.plan.volcano.RelSubset
at 
com.onwbp.org.apache.calcite.plan.volcano.TopDownRuleDriver.getOptimizeInputTask(TopDownRuleDriver.java:548)
...
{code}

Does it make sense, or maybe I am doing something wrong in my prototype? (I do 
not know if I can reproduce the situation with a unit test in Calcite)

> Support cascades style top-down driven rule apply
> -
>
> Key: CALCITE-3916
> URL: https://issues.apache.org/jira/browse/CALCITE-3916
> Project: Calcite
>  Issue Type: Improvement
>  Components: core
>Reporter: Haisheng Yuan
>Assignee: Jinpeng Wu
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.24.0
>
>  Time Spent: 15.5h
>  Remaining Estimate: 0h
>
> Apply rules by leaf RelSet -> root RelSet order. For every RelNode in a 
> RelSet, rule is matched and applied sequentially. No RuleQueue and 
> DeferringRuleCall is needed anymore. This will make space pruning and rule 
> mutual exclusivity check possible.
> Rule that use AbstractConverter as operand is an exception, to keep backward 
> compatibility, this kind of rule still needs top-down apply.
> This should be done after CALCITE-3896.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CALCITE-4171) Support named parameters for table window functions

2020-08-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-4171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated CALCITE-4171:

Labels: pull-request-available  (was: )

> Support named parameters for table window functions
> ---
>
> Key: CALCITE-4171
> URL: https://issues.apache.org/jira/browse/CALCITE-4171
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.23.0, 1.24.0
>Reporter: Danny Chen
>Assignee: Danny Chen
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.25.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Supports window functions like named params style:
> {code:sql}
> select *
> from table(
> session(
>   data => table Shipments,
>   timecol => descriptor(rowtime),
>   key => descriptor(orderId),
>   size => INTERVAL '10' MINUTE))
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CALCITE-4171) Support named parameters for table window functions

2020-08-10 Thread Danny Chen (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-4171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Danny Chen updated CALCITE-4171:

Description: 
Supports window functions like named params style:

{code:sql}
select *
from table(
session(
  data => table Shipments,
  timecol => descriptor(rowtime),
  key => descriptor(orderId),
  size => INTERVAL '10' MINUTE))
{code}


  was:
Supports window functions like named params style:
```sql
select *
from table(
session(
  data => table Shipments,
  timecol => descriptor(rowtime),
  key => descriptor(orderId),
  size => INTERVAL '10' MINUTE))
```


> Support named parameters for table window functions
> ---
>
> Key: CALCITE-4171
> URL: https://issues.apache.org/jira/browse/CALCITE-4171
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.23.0, 1.24.0
>Reporter: Danny Chen
>Assignee: Danny Chen
>Priority: Major
> Fix For: 1.25.0
>
>
> Supports window functions like named params style:
> {code:sql}
> select *
> from table(
> session(
>   data => table Shipments,
>   timecol => descriptor(rowtime),
>   key => descriptor(orderId),
>   size => INTERVAL '10' MINUTE))
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (CALCITE-4171) Support named parameters for table window functions

2020-08-10 Thread Danny Chen (Jira)
Danny Chen created CALCITE-4171:
---

 Summary: Support named parameters for table window functions
 Key: CALCITE-4171
 URL: https://issues.apache.org/jira/browse/CALCITE-4171
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.24.0, 1.23.0
Reporter: Danny Chen
Assignee: Danny Chen
 Fix For: 1.25.0


Supports window functions like named params style:
```sql
select *
from table(
session(
  data => table Shipments,
  timecol => descriptor(rowtime),
  key => descriptor(orderId),
  size => INTERVAL '10' MINUTE))
```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4155) Simplify IN expression of discrete values

2020-08-10 Thread Liya Fan (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17174163#comment-17174163
 ] 

Liya Fan commented on CALCITE-4155:
---

[~julianhyde] Thanks a lot for sharing the information. 

It is good to know that we have a plan to support the simplifications, in a 
more fundamental way. 

I think the work of this issue can be stopped (at least for now). 

If there is anything I could do, I am willing to help :)

> Simplify IN expression of discrete values
> -
>
> Key: CALCITE-4155
> URL: https://issues.apache.org/jira/browse/CALCITE-4155
> Project: Calcite
>  Issue Type: New Feature
>  Components: core
>Reporter: Liya Fan
>Assignee: Liya Fan
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> For example, given expressions like
> {{a in (1, 2, 3, 4, 5)}}
> or
> {{a = 1 or a = 2 or a = 3 or a = 4 or a = 5}},
> we can simplify it to
> {{a >= 1 and a <= 5}}
> Such simplification reduces the number of value comparisons from 5 to 2. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4160) Add configuration to retain ORDER BY in sub-query

2020-08-10 Thread Danny Chen (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17174094#comment-17174094
 ] 

Danny Chen commented on CALCITE-4160:
-

Yes, there is global config, see {{CalciteSystemProperty}} (used for 
configuration from the code or properties file) and {{CalciteConnectionConfig}} 
(used for JDBC connection string).

> Add configuration to retain ORDER BY in sub-query
> -
>
> Key: CALCITE-4160
> URL: https://issues.apache.org/jira/browse/CALCITE-4160
> Project: Calcite
>  Issue Type: Improvement
>  Components: core
>Reporter: Jiatao Tao
>Assignee: Jiatao Tao
>Priority: Minor
> Attachments: image-2020-08-07-10-48-59-599.png, 
> image-2020-08-07-10-50-22-351.png
>
>
> Pre discussion see in 
> https://issues.apache.org/jira/browse/CALCITE-2798
> https://issues.apache.org/jira/browse/CALCITE-3664
> IMO, we should at least provide a configuration about this. People use 
> Calcite most for its optimizer, and this info users may care, How it executed 
> is by the engine, but users should know this in the plan.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)