You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2023/05/03 09:22:37 UTC
[GitHub] [hudi] danny0405 commented on a diff in pull request #7355: [HUDI-5308] Hive3 query returns null when the where clause has a partition field
danny0405 commented on code in PR #7355:
URL: https://github.com/apache/hudi/pull/7355#discussion_r1183441571
##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieRealtimeInputFormatUtils.java:
##########
@@ -84,6 +84,18 @@ private static Configuration addProjectionField(Configuration conf, String field
return conf;
}
+ public static void addProjectionField(Configuration conf, Option<String[]> fieldName) {
+ if (fieldName.isPresent()) {
+ List<String> columnNameList = Arrays.stream(conf.get(serdeConstants.LIST_COLUMNS).split(",")).collect(Collectors.toList());
+ Arrays.stream(fieldName.get()).forEach(field -> {
Review Comment:
Can you explain what this value represents
```java
conf.get(serdeConstants.LIST_COLUMNS
```
##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieParquetInputFormat.java:
##########
@@ -84,6 +90,13 @@ public RecordReader<NullWritable, ArrayWritable> getRecordReader(final InputSpli
LOG.debug("EMPLOYING DEFAULT RECORD READER - " + split);
}
+ Path inputPath = ((FileSplit)split).getPath();
+ FileSystem fs = inputPath.getFileSystem(job);
+ Option<Path> tablePath = TablePathUtils.getTablePath(fs, inputPath);
+ HoodieTableMetaClient metaClient = HoodieTableMetaClient.builder().setConf(job).setBasePath(tablePath.get().toString()).build();
Review Comment:
Does this code work here:
```java
HoodieTableMetaClient metaClient = HoodieTableMetaClient.builder().setConf(jobConf).setBasePath(realtimeSplit.getBasePath()).build();
```
##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieRealtimeRecordReaderUtils.java:
##########
@@ -257,10 +257,8 @@ public static List<String> orderFields(String fieldNameCsv, String fieldOrderCsv
String[] fieldOrdersWithDups = fieldOrderCsv.isEmpty() ? new String[0] : fieldOrderCsv.split(",");
Set<String> fieldOrdersSet = new LinkedHashSet<>(Arrays.asList(fieldOrdersWithDups));
String[] fieldOrders = fieldOrdersSet.toArray(new String[0]);
- List<String> fieldNames = fieldNameCsv.isEmpty() ? new ArrayList<>() : Arrays.stream(fieldNameCsv.split(","))
- .filter(fn -> !partitioningFields.contains(fn)).collect(Collectors.toList());
+ List<String> fieldNames = fieldNameCsv.isEmpty() ? new ArrayList<>() : Arrays.stream(fieldNameCsv.split(",")).collect(Collectors.toList());
Review Comment:
Does the removal of partition fiels affect the behavior of Hive 2.x?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org