[jira] [Commented] (SPARK-17296) Spark SQL: cross join + two joins = BUG

2016-09-06 Thread Apache Spark (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-17296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15468928#comment-15468928
 ] 

Apache Spark commented on SPARK-17296:
--

User 'hvanhovell' has created a pull request for this issue:
https://github.com/apache/spark/pull/14984

> Spark SQL: cross join + two joins = BUG
> ---
>
> Key: SPARK-17296
> URL: https://issues.apache.org/jira/browse/SPARK-17296
> Project: Spark
>  Issue Type: Bug
>Affects Versions: 2.0.0
>Reporter: Furcy Pin
>Assignee: Herman van Hovell
> Fix For: 2.1.0
>
>
> In spark shell :
> {code}
> CREATE TABLE test (col INT) ;
> INSERT OVERWRITE TABLE test VALUES (1), (2) ;
> SELECT 
> COUNT(1)
> FROM test T1 
> CROSS JOIN test T2
> JOIN test T3
> ON T3.col = T1.col
> JOIN test T4
> ON T4.col = T1.col
> ;
> {code}
> returns :
> {code}
> Error in query: cannot resolve '`T1.col`' given input columns: [col, col]; 
> line 6 pos 12
> {code}
> Apparently, this example is minimal (removing the CROSS or one of the JOIN 
> causes no issue).



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

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-17296) Spark SQL: cross join + two joins = BUG

2016-08-29 Thread Apache Spark (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-17296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15446979#comment-15446979
 ] 

Apache Spark commented on SPARK-17296:
--

User 'hvanhovell' has created a pull request for this issue:
https://github.com/apache/spark/pull/14867

> Spark SQL: cross join + two joins = BUG
> ---
>
> Key: SPARK-17296
> URL: https://issues.apache.org/jira/browse/SPARK-17296
> Project: Spark
>  Issue Type: Bug
>Affects Versions: 2.0.0
>Reporter: Furcy Pin
>
> In spark shell :
> {code}
> CREATE TABLE test (col INT) ;
> INSERT OVERWRITE TABLE test VALUES (1), (2) ;
> SELECT 
> COUNT(1)
> FROM test T1 
> CROSS JOIN test T2
> JOIN test T3
> ON T3.col = T1.col
> JOIN test T4
> ON T4.col = T1.col
> ;
> {code}
> returns :
> {code}
> Error in query: cannot resolve '`T1.col`' given input columns: [col, col]; 
> line 6 pos 12
> {code}
> Apparently, this example is minimal (removing the CROSS or one of the JOIN 
> causes no issue).



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

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-17296) Spark SQL: cross join + two joins = BUG

2016-08-29 Thread Herman van Hovell (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-17296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15446371#comment-15446371
 ] 

Herman van Hovell commented on SPARK-17296:
---

I think you have found a bug in the parser. Your query produces the following 
(unresolved) LogicalPlan:
{noformat}
'Project [unresolvedalias('COUNT(1), None)]
+- 'Join Inner, ('T4.col = 'T1.col)
   :- 'Join Inner
   :  :- 'UnresolvedRelation `test`, T1
   :  +- 'Join Inner, ('T3.col = 'T1.col)
   : :- 'UnresolvedRelation `test`, T2
   : +- 'UnresolvedRelation `test`, T3
   +- 'UnresolvedRelation `test`, T4
{noformat}

Notice how the the most nested Inner Join references T2 and T3 using a join 
condition on T1 (which is an unknown relation for that join).

> Spark SQL: cross join + two joins = BUG
> ---
>
> Key: SPARK-17296
> URL: https://issues.apache.org/jira/browse/SPARK-17296
> Project: Spark
>  Issue Type: Bug
>Affects Versions: 2.0.0
>Reporter: Furcy Pin
>
> In spark shell :
> {code}
> CREATE TABLE test (col INT) ;
> INSERT OVERWRITE TABLE test VALUES (1), (2) ;
> SELECT 
> COUNT(1)
> FROM test T1 
> CROSS JOIN test T2
> JOIN test T3
> ON T3.col = T1.col
> JOIN test T4
> ON T4.col = T1.col
> ;
> {code}
> returns :
> {code}
> Error in query: cannot resolve '`T1.col`' given input columns: [col, col]; 
> line 6 pos 12
> {code}
> Apparently, this example is minimal (removing the CROSS or one of the JOIN 
> causes no issue).



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

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-17296) Spark SQL: cross join + two joins = BUG

2016-08-29 Thread Furcy Pin (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-17296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15446382#comment-15446382
 ] 

Furcy Pin commented on SPARK-17296:
---

Yes, this is not critical though, a workaround is to invert the order between 
T1 and T2.

> Spark SQL: cross join + two joins = BUG
> ---
>
> Key: SPARK-17296
> URL: https://issues.apache.org/jira/browse/SPARK-17296
> Project: Spark
>  Issue Type: Bug
>Affects Versions: 2.0.0
>Reporter: Furcy Pin
>
> In spark shell :
> {code}
> CREATE TABLE test (col INT) ;
> INSERT OVERWRITE TABLE test VALUES (1), (2) ;
> SELECT 
> COUNT(1)
> FROM test T1 
> CROSS JOIN test T2
> JOIN test T3
> ON T3.col = T1.col
> JOIN test T4
> ON T4.col = T1.col
> ;
> {code}
> returns :
> {code}
> Error in query: cannot resolve '`T1.col`' given input columns: [col, col]; 
> line 6 pos 12
> {code}
> Apparently, this example is minimal (removing the CROSS or one of the JOIN 
> causes no issue).



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

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-17296) Spark SQL: cross join + two joins = BUG

2016-08-29 Thread Sean Owen (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-17296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15446367#comment-15446367
 ] 

Sean Owen commented on SPARK-17296:
---

Pardon if I'm missing something, but you are not joining T3 with T1, so I don't 
think you can use T1.col in the join condition right?

> Spark SQL: cross join + two joins = BUG
> ---
>
> Key: SPARK-17296
> URL: https://issues.apache.org/jira/browse/SPARK-17296
> Project: Spark
>  Issue Type: Bug
>Affects Versions: 2.0.0
>Reporter: Furcy Pin
>
> In spark shell :
> {code}
> CREATE TABLE test (col INT) ;
> INSERT OVERWRITE TABLE test VALUES (1), (2) ;
> SELECT 
> COUNT(1)
> FROM test T1 
> CROSS JOIN test T2
> JOIN test T3
> ON T3.col = T1.col
> JOIN test T4
> ON T4.col = T1.col
> ;
> {code}
> returns :
> {code}
> Error in query: cannot resolve '`T1.col`' given input columns: [col, col]; 
> line 6 pos 12
> {code}
> Apparently, this example is minimal (removing the CROSS or one of the JOIN 
> causes no issue).



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

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org