Skip to content
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

SPARK-26999: Fix SparkSQL CLIDriver process line incorrectly #23902

Closed
wants to merge 1 commit into from

Conversation

turboFei
Copy link
Member

@turboFei turboFei commented Feb 27, 2019

What changes were proposed in this pull request?

SparkSQLCLIDriver parse sql statement incorrectly, because its processLine method is not correct.
The processLine method is one method of CLIDriver, which is a class of hive-cli.
SparkSQLCLIDriver extends CLIDriver, but it does't override processLine method.
The spark-hive-cliet version of master branch is hive-1.2.1.spark2.
In hive-1.2.1, the processLine method splits statement directly by ";", however, there may be a quote.
For example:
The statement:

 select * from table_a where column_a not like '%;';

Will be parsed to:

select * from table_a where column_a not like '%

In this PR, I override the processLine of CLIDriver in SPARKSQLCLIDriver based on the implement of apache/hive master branch.
And it process the input sql statement correctly.

How was this patch tested?

manual test with $SPARK_HOME/bin/spark-sql

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@turboFei turboFei changed the title SPARK-26999: fix SparkSQL CLIDriver process line incorrectly SPARK-26999: Fix SparkSQL CLIDriver process line incorrectly Feb 27, 2019
@turboFei
Copy link
Member Author

@cloud-fan @mgaido91

@wangyum
Copy link
Member

wangyum commented Feb 27, 2019

It works after upgrade built-in Hive to 2.3.4:
image

@gatorsmile
Copy link
Member

@hustfeiwang @wangyum Could you help review this PR https://github.com/apache/spark/pull/23276/files?

@turboFei
Copy link
Member Author

It works after upgrade built-in Hive to 2.3.4:
image

Yes, it is a bug of hive-1.2.1.

@turboFei
Copy link
Member Author

@hustfeiwang @wangyum Could you help review this PR https://github.com/apache/spark/pull/23276/files?

With pleasure if I have time.

@mgaido91
Copy link
Contributor

yes I think this one can be closed. Probably the cleanest approach would be upgrading Hive dep, but this is a big pain as we. SO if we want to fix this without doing the upgrade we can have this in the PR Xiao mentioned.

@turboFei
Copy link
Member Author

yes I think this one can be closed. Probably the cleanest approach would be upgrading Hive dep, but this is a big pain as we. SO if we want to fix this without doing the upgrade we can have this in the PR Xiao mentioned.

ok, thanks

@turboFei turboFei closed this Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants