-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-6628][SQL][Branch-2.1] Fix ClassCastException when executing sql statement 'insert into' on hbase table #18127
Conversation
…ql statement 'insert into' on hbase table
Test build #77449 has finished for PR 18127 at commit
|
Jenkins, test this please. |
Test build #77451 has finished for PR 18127 at commit
|
Hi @weiqingy, I just wonder if it is in progress in any way. |
Thanks, @HyukjinKwon . Yes, but will come back here after I finish other work. Do I need to close this for now and reopen it at that time? |
Thanks for your input @weiqingy. I was just trying to suggest to close PRs inactive for a month to review comments and/or non-successful Jenkins test result (for a good reason, of course). Would that take longer than a month? |
Hi @weiqingy Just wanted to confirm, if this was fixed in Spark 2.4 or not. Since, I am facing same issue when inserting records in a Hive-Hbase Table. Also, kindly specify the reason behind not including this change in further versions, if there is any. Kindly also let me know if this issue will be fixed in any upcoming release |
I'm also getting the I was checking the code in this pull request, and I couldn't find it merged in any branch/tag. I notice that starting from version Is this pull request necessary to fix the issue? If so, is there any temporary workaround? |
@lhsvobodaj @weiqingy @HyukjinKwon I think there has been a regression in the current codebase, here: spark/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveFileFormat.scala Line 94 in 3e30a98
|
I'm not sure if it was a regression as I couldn't find the fix merged in any branch. One of the possible reasons to not merge this code is this Hive issue HIVE-20678. |
@lhsvobodaj ok so that issue is fixed in Hive 4.0.0, but the problem is that we run on Cloudera's Distribution of Hadoop which uses an older version of Hive and there's no way around it then :( |
@racc We are also using CDH (5.11.2 and 6.1.0). The Hive fix for this issue is available on CDH 5.15.2 as per its release notes. |
Please check if this still exists in the master and open a PR with a test. |
Hi Team, With this configufration (Spark 2.4 / Hive 2.3.7 / Hadoop 2.7 / Hbase 1.4.9), without CDH. |
Hi, Team, |
+1 |
What changes were proposed in this pull request?
The issue of SPARK-6628 is:
cannot be cast to
The reason is:
From the two snippets above, we can see both
HiveHBaseTableOutputFormat
andHiveOutputFormat
extends
/implements
OutputFormat
, and can not cast to each other.For Spark 1.6, 2.0, 2.1, Spark initials the
outputFormat
inSparkHiveWriterContainer
. For Spark 2.2+, Spark initials theoutputFormat
inHiveFileFormat
.outputFormat
above has to beHiveOutputFormat
. However, when users insert data into hbase, the outputFormat isHiveHBaseTableOutputFormat
, it isn't instance ofHiveOutputFormat
.This PR is to make
outputFormat
to be "null" when theOutputFormat
is not an instance ofHiveOutputFormat
. This change should be safe sinceoutputFormat
is only used to get the file extension in functiongetFileExtension()
.We can also submit this PR to Master branch.
How was this patch tested?
Manually test.
(1) create a HBase table with Hive:
(2) verify:
Before:
Insert data into the Hbase table
testwq100
from Spark SQL:After:
The ClassCastException gone. "Insert" succeed.