[ 
https://issues.apache.org/jira/browse/KYLIN-611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14560714#comment-14560714
 ] 

Sébastien Jelsch commented on KYLIN-611:
----------------------------------------

Hi Julian,

yes, by "implicit joins" I mean commas in the FROM clause.
I had a look at Mondrian's ImpalaDialect. However, no ANSI join is generated 
because the allowsJoinOn method returns false. If you change this return value 
to true, the generated SQL statement does not change. I came across with the 
following ticket: http://jira.pentaho.com/browse/MONDRIAN-955 .
This patch creates ANSI joins, but as described in the ticket, sometimes it 
generates a crossjoin where a simple join is necessary. After my changes in 
SqlQuery.java I could fix this situation ( 
https://github.com/mustangore/thesis/blob/master/Mondrian/add_kylin_dialect.patch#L173-L239
 ).

Currently I don't know why CrossJoins are generated and what purpose such 
queries. Maybe you can give me a hint.

> Allow Implicit Joins
> --------------------
>
>                 Key: KYLIN-611
>                 URL: https://issues.apache.org/jira/browse/KYLIN-611
>             Project: Kylin
>          Issue Type: Improvement
>          Components: Query Engine
>    Affects Versions: v0.7.1
>            Reporter: Sébastien Jelsch
>            Assignee: liyang
>             Fix For: v0.7.2
>
>         Attachments: implicit-join-exception.txt
>
>
> Allowing Implicit Joins would be a great improvement since tools like 
> Mondrian use this exclusively.
> Trying to execute this SQL Statement
> {code:sql}
> SELECT *
> FROM sales, products
> WHERE sales.product_id = products.id
> {code}
> results in the following error:
> {noformat}
> [ERROR][com.kylinolap.rest.controller.QueryController.doQuery(QueryController.java:227)]
>  - Exception when execute sql
> java.sql.SQLException: error while executing SQL "SELECT * FROM sales, 
> products WHERE sales.product_id = products.id LIMIT 50000": 
> org.eigenbase.rex.RexLiteral cannot be cast to org.eigenbase.rex.RexCall
> {noformat}
> See attachment for full exception details.
> The error is caused by OLAPJoinRel.implementOLAP(OLAPImplementor implementor):
> {code:java}
> RexCall condition = (RexCall) this.getCondition();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to