You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2019/10/30 17:17:28 UTC
[GitHub] [incubator-hudi] bvaradar commented on a change in pull request
#972: [HUDI-313] Fix select count star error when querying a realtime table
bvaradar commented on a change in pull request #972: [HUDI-313] Fix select count star error when querying a realtime table
URL: https://github.com/apache/incubator-hudi/pull/972#discussion_r340751698
##########
File path: hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/realtime/HoodieParquetRealtimeInputFormat.java
##########
@@ -197,10 +197,27 @@ private static synchronized Configuration addRequiredProjectionFields(Configurat
return configuration;
}
+ /**
+ * Hive will append read columns' ids to old columns' ids during getRecordReader. In some cases, e.g. SELECT COUNT(*),
+ * the read columns' id is an empty string and Hive will combine it with Hoodie required projection ids and becomes
+ * e.g. ",2,0,3" and will cause an error. This method is used to avoid this situation.
+ */
+ private static synchronized Configuration cleanProjectionColumnIds(Configuration conf) {
Review comment:
@zhedoubushishi : You can synchronize on the passed conf object instead of static synchronization which becomes a global lock at the JVM level.
You can do something like
synchronized(conf) {
....
}
inside your cleanProjectionColumnIds.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services