Jackie-Jiang commented on code in PR #18325:
URL: https://github.com/apache/pinot/pull/18325#discussion_r3141103368
##########
pinot-plugins/pinot-input-format/pinot-parquet/src/main/java/org/apache/pinot/plugin/inputformat/parquet/ParquetNativeRecordExtractor.java:
##########
@@ -195,4 +195,38 @@ public Map<String, Object> extractMap(Group group) {
}
return map;
}
+
+ private Map<String, Object> extractKeyValueMap(Group group) {
+ int numValues = group.getFieldRepetitionCount(0);
+ if (numValues == 0) {
+ return Map.of();
+ }
+
+ // MAP has a single repeated key/value child, so extract entries from that
schema instead of probing user data.
+ Map<String, Object> map = Maps.newHashMapWithExpectedSize(numValues);
+ for (int i = 0; i < numValues; i++) {
+ Group keyValueGroup = group.getGroup(0, i);
+ GroupType keyValueType = keyValueGroup.getType();
+ Object key = extractValue(keyValueGroup,
keyValueType.getFieldIndex("key"));
+ Object value = extractValue(keyValueGroup,
keyValueType.getFieldIndex("value"));
+ map.put(key.toString(), value);
+ }
+ return map;
+ }
+
+ @Nullable
+ private Object extractListElement(Group group, Type repeatedField, int
index) {
Review Comment:
Given map is always stored under `"key"` and `"value"`, is that the same for
list? Do we need this check for list?
##########
pinot-plugins/pinot-input-format/pinot-parquet/src/main/java/org/apache/pinot/plugin/inputformat/parquet/ParquetAvroRecordExtractor.java:
##########
@@ -63,4 +77,22 @@ Object handleDeprecatedTypes(Object value, Schema.Field
field) {
}
return value;
}
+
+ private boolean isListElementWrapper(Schema.Field field) {
Review Comment:
We should check this first, then convert value accordingly.
Do we need to handle map in this reader?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]