Skip to content

Conversation

@davies
Copy link
Contributor

@davies davies commented Jan 6, 2016

Parse the SQL query with except/intersect in FROM clause for HivQL.

@davies
Copy link
Contributor Author

davies commented Jan 6, 2016

@hvanhovell This patch can't be compiled, failed with:

[error] ~spark/sql/hive/target/scala-2.10/src_managed/main/org/apache/spark/sql/parser/SparkSqlParser_IdentifiersParser.java:11056:  ERROR: too long
[error]     static final String[] DFA5_transitionS = {
[error]                           ^

Have you hit this before?

@hvanhovell
Copy link
Contributor

@davies I haven't seen this one before. We can take a look at the generated source...

@hvanhovell
Copy link
Contributor

@davies I just tried this. If you add this rule the identifier parser grows beyond 64K rows which the JVM can't handle. The short term solution is to split the identifier parser (see @viirya's PR).

In the long term we might need to check if some rules aren't blowing things out of proportion.

@davies
Copy link
Contributor Author

davies commented Jan 6, 2016

@hvanhovell Thanks, I will wait for @viirya's PR go first.

Conflicts:
	sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we support just union, i.e. alias for union distinct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hive 1.2's parser should support union.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this test case shouldn't be here? It should just go into the normal sql test case now, and make sure we also test union.

@SparkQA
Copy link

SparkQA commented Jan 7, 2016

Test build #48882 has finished for PR 10622 at commit 4ae0ccf.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jan 7, 2016

Test build #48891 has finished for PR 10622 at commit a83d4a2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class CatalystQlSuite extends PlanTest

@davies davies changed the title [SPARK-12542] [SQL] [WIP] support except/intersect in HiveQl [SPARK-12542] [SQL] support except/intersect in HiveQl Jan 7, 2016
@rxin
Copy link
Contributor

rxin commented Jan 7, 2016

LGTM. Would be great for @hvanhovell to take a quick look too.

@davies
Copy link
Contributor Author

davies commented Jan 7, 2016

The following query does not work:

(select 1 as a) union (select 2 as a)

I had not figure out a way to fix this.

PS: It seems that HiveParse is not a good stand point. lots of corner cases do not work.

@rxin
Copy link
Contributor

rxin commented Jan 7, 2016

Let's open a jira ticket to track that and see if some open source contributors can pick it up.

@davies
Copy link
Contributor Author

davies commented Jan 7, 2016

@hvanhovell
Copy link
Contributor

LGTM

@rxin
Copy link
Contributor

rxin commented Jan 7, 2016

Merging this in. Thanks!

@asfgit asfgit closed this in fd1dcfa Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants