-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-32380][SQL] fixed spark3.0 access hive table while data in hbase problem #29178
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -299,7 +299,9 @@ class HadoopTableReader( | |
| */ | ||
| private def createHadoopRDD(localTableDesc: TableDesc, inputPathStr: String): RDD[Writable] = { | ||
| val inputFormatClazz = localTableDesc.getInputFileFormatClass | ||
| if (classOf[newInputClass[_, _]].isAssignableFrom(inputFormatClazz)) { | ||
| if (!inputFormatClazz.getName. | ||
| equalsIgnoreCase("org.apache.hadoop.hive.hbase.HiveHBaseTableInputFormat") | ||
| && classOf[newInputClass[_, _]].isAssignableFrom(inputFormatClazz)) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think we can have a test case for this?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I try Spark2.4.3 can work well. |
||
| createNewHadoopRDD(localTableDesc, inputPathStr) | ||
| } else { | ||
| createOldHadoopRDD(localTableDesc, inputPathStr) | ||
|
|
||
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.
Do you know why
org.apache.hadoop.hive.hbase.HiveHBaseTableInputFormatimplements new Hadoop inputformat interface but doesn't work?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.
It looks like the new MapReduce API (
org.apache.hadoop.mapreduce) used when creating NewHadoopRDD , but The getsplits method of HiveHBaseTableInputFormat is implemented by org.apache.hadoop.mapred API,so some initialization operations (Table、connection) are not done,so the obtained variable table is null.And when using methord createOldHadoopRDD will use the org.apache.hadoop.mapred API,and some initialization operations (Table、connection) are doing,so it can work well.