[jira] [Commented] (FLINK-7865) Remove predicate restrictions on TableFunction left outer join

2019-04-08 Thread Haisheng Yuan (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-7865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16812593#comment-16812593
 ] 

Haisheng Yuan commented on FLINK-7865:
--

[~till.rohrmann] [~fhueske] FYI

> Remove predicate restrictions on TableFunction left outer join
> --
>
> Key: FLINK-7865
> URL: https://issues.apache.org/jira/browse/FLINK-7865
> Project: Flink
>  Issue Type: New Feature
>  Components: Table SQL / API
>Reporter: Xingcan Cui
>Assignee: Xingcan Cui
>Priority: Major
>
> To cover up the improper translation of lateral table left outer join 
> (CALCITE-2004), we have temporarily forbidden the predicates (except {{true}} 
> literal) in Table API (FLINK-7853) and SQL (FLINK-7854). Once the issue has 
> been fixed in Calcite, we should remove the restrictions. The tasks may 
> include removing Table API/SQL condition check, removing validation tests, 
> enabling integration tests, updating the documents, etc.
> See [this thread on Calcite dev 
> list|https://lists.apache.org/thread.html/16caeb8b1649c4da85f9915ea723c6c5b3ced0b96914cadc24ee4e15@%3Cdev.calcite.apache.org%3E]
>  for more information.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-7730) TableFunction LEFT OUTER joins with ON predicates are broken

2019-04-02 Thread Haisheng Yuan (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-7730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16807900#comment-16807900
 ] 

Haisheng Yuan commented on FLINK-7730:
--

The Calcite issue 
[CALCITE-2004|https://issues.apache.org/jira/browse/CALCITE-2004] has been 
fixed. The restrictions shall be removed when we upgrade Calcite to v1.20.0, 
which will be released in next 2 or 3 months.

> TableFunction LEFT OUTER joins with ON predicates are broken
> 
>
> Key: FLINK-7730
> URL: https://issues.apache.org/jira/browse/FLINK-7730
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / API
>Affects Versions: 1.3.2, 1.4.0
>Reporter: Fabian Hueske
>Assignee: Xingcan Cui
>Priority: Critical
> Fix For: 1.3.0, 1.4.0
>
>
> TableFunction left outer joins with predicates in the ON clause are broken. 
> Apparently, the are no tests for this and it has never worked. I observed 
> issues on several layers:
> - Table Function does not correctly validate equality predicate: 
> {{leftOuterJoin(func1('c) as 'd,  'a.cast(Types.STRING) === 'd)}} is rejected 
> because the predicate is not considered as an equality predicate (the cast 
> needs to be pushed down).
> - Plans cannot be correctly translated: {{leftOuterJoin(func1('c) as 'd,  'c 
> === 'd)}} gives an optimizer exception.
> - SQL queries get translated but produce incorrect results. For example 
> {{SELECT a, b, c, d FROM MyTable LEFT OUTER JOIN LATERAL TABLE(tfunc(c)) AS 
> T(d) ON d = c}} returns an empty result if the condition {{d = c}} never 
> returns true. However, the outer side should be preserved and padded with 
> nulls.
> So there seem to be many issues with table function outer joins. Especially, 
> the wrong result produced by SQL queries need to be quickly fixed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-7865) Remove predicate restrictions on TableFunction left outer join

2019-04-02 Thread Haisheng Yuan (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-7865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16807877#comment-16807877
 ] 

Haisheng Yuan commented on FLINK-7865:
--

The blocker is resolved in Calcite 1.20.

> Remove predicate restrictions on TableFunction left outer join
> --
>
> Key: FLINK-7865
> URL: https://issues.apache.org/jira/browse/FLINK-7865
> Project: Flink
>  Issue Type: New Feature
>  Components: Table SQL / API
>Reporter: Xingcan Cui
>Assignee: Xingcan Cui
>Priority: Major
>
> To cover up the improper translation of lateral table left outer join 
> (CALCITE-2004), we have temporarily forbidden the predicates (except {{true}} 
> literal) in Table API (FLINK-7853) and SQL (FLINK-7854). Once the issue has 
> been fixed in Calcite, we should remove the restrictions. The tasks may 
> include removing Table API/SQL condition check, removing validation tests, 
> enabling integration tests, updating the documents, etc.
> See [this thread on Calcite dev 
> list|https://lists.apache.org/thread.html/16caeb8b1649c4da85f9915ea723c6c5b3ced0b96914cadc24ee4e15@%3Cdev.calcite.apache.org%3E]
>  for more information.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-11680) Make query plan easier to read

2019-03-11 Thread Haisheng Yuan (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-11680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789911#comment-16789911
 ] 

Haisheng Yuan commented on FLINK-11680:
---

Thanks, this is a good one. We can move this issue to Calcite, so that all 
Calcite based system can benefit from this feature.

> Make query plan easier to read
> --
>
> Key: FLINK-11680
> URL: https://issues.apache.org/jira/browse/FLINK-11680
> Project: Flink
>  Issue Type: New Feature
>  Components: SQL / Planner
>Reporter: godfrey he
>Assignee: godfrey he
>Priority: Major
> Attachments: image-2019-02-20-20-05-06-506.png, screenshot-1.png
>
>
>  The query plan generated by RelOptUtil#toString is hard to read, especially 
> the query is very complex(multiple joins or unions). 
> There is a query plan of tpcds q25.sql generated by RelOptUtil#toString:
>  !image-2019-02-20-20-05-06-506.png! 
> We can improve the utility method to make the query plan more readable, like:
>  !screenshot-1.png! 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)