-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-3688][SQL]LogicalPlan can't resolve column correctlly #2542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this test...
|
Nice catch! I think the problem is: for a table(a string, b string), when we run "select a.b from test a join test b", we have 2 options to resolve |
|
@cloud-fan |
|
@tianyi Let me raise an example. For |
|
@cloud-fan Tried the following snippet with ambiguous references in Hive: CREATE TABLE t1(a STRUCT<x: INT>, k INT);
CREATE TABLE t2(x INT);
SELECT a.x FROM t1 a JOIN t2 b ON a.k = b.x;and Hive reports "Invalid column reference 'x'", which I think is reasonable. So it seems that Hive treats struct fields and table columns equally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need the withName call anymore, since now we preserve case of attribute names by leveraging resolver to compare names.
|
@cloud-fan Sorry, made a mistake in the snippet I used, it should be: CREATE TABLE t1(x INT);
CREATE TABLE t2(a STRUCT<x: INT>, k INT);
SELECT a.x FROM t1 a JOIN t2 b ON a.x = b.k;And Hive can resolve |
|
ok to test |
|
QA tests have started for PR 2542 at commit
|
|
Tests timed out after a configured wait of |
|
Test FAILed. |
|
Hi, @marmbrus . The current codes still have some bugs to fix, I talked @liancheng yesterday, I will push a update later. |
|
QA tests have started for PR 2542 at commit
|
|
Test FAILed. |
|
@liancheng Hmm..I don't have a hive environment for test... Without this PR, spark sql will report ambiguousReferences, but how hive resolve |
|
QA tests have started for PR 2542 at commit
|
|
@cloud-fan, I think it is reasonable for return "ambiguous references" in the case you mentioned, because we can't make sure whether 'a' is a table alias or column name. In my last commits, spark will return "ambiguous references" for your case. |
But hive can resolve this as @liancheng said. What's the magic here for the |
|
Tests timed out after a configured wait of |
|
Test FAILed. |
|
Tests timed out after a configured wait of |
|
QA tests have started for PR 2542 at commit
|
|
Tests timed out after a configured wait of |
|
Test FAILed. |
|
QA tests have started for PR 2542 at commit
|
|
Tests timed out after a configured wait of |
|
Test build #22417 has finished for PR 2542 at commit
|
|
Test FAILed. |
|
retest this please |
|
Test build #22517 has started for PR 2542 at commit
|
|
Test build #22519 has started for PR 2542 at commit
|
|
Test build #22517 has finished for PR 2542 at commit
|
|
Test PASSed. |
|
Test build #22519 has finished for PR 2542 at commit
|
|
Test PASSed. |
|
Hi, @marmbrus @liancheng |
|
Can one of the admins verify this patch? |
|
ok to test |
|
Test build #23398 has started for PR 2542 at commit
|
|
Test build #23398 has finished for PR 2542 at commit
|
|
Test PASSed. |
|
Test build #548 has started for PR 2542 at commit
|
|
Test build #548 has finished for PR 2542 at commit
|
|
Test build #549 has started for PR 2542 at commit
|
|
Test build #549 has finished for PR 2542 at commit
|
|
retest this please |
|
Test build #24696 has started for PR 2542 at commit
|
|
Test build #24696 has finished for PR 2542 at commit
|
|
Test PASSed. |
|
It's hard to rebase this branch due to so much changes in the latest master branch. |
we should add some judgements base on the datatype to handle some particular sql described in https://issues.apache.org/jira/browse/SPARK-3688