Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ public void open(FileInputSplit fileSplit) throws IOException {
fileSplit.getPath());
LinkedHashMap<String, Object> partObjects = new LinkedHashMap<>();
partSpec.forEach((k, v) -> {
DataType fieldType = fullFieldTypes[fieldNameList.indexOf(k)];
final int idx = fieldNameList.indexOf(k);
if (idx == -1) {
// for any rare cases that the partition field does not exist in schema,
// fallback to file read
return;
}
DataType fieldType = fullFieldTypes[idx];
if (!DataTypeUtils.isDatetimeType(fieldType)) {
// date time type partition field is formatted specifically,
// read directly from the data file to avoid format mismatch or precision loss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,13 @@ private ParquetColumnarRowSplitReader getReader(String path, int[] requiredPos)
FilePathUtils.extractPartitionKeys(this.conf));
LinkedHashMap<String, Object> partObjects = new LinkedHashMap<>();
partSpec.forEach((k, v) -> {
DataType fieldType = fieldTypes.get(fieldNames.indexOf(k));
final int idx = fieldNames.indexOf(k);
if (idx == -1) {
// for any rare cases that the partition field does not exist in schema,
// fallback to file read
return;
}
DataType fieldType = fieldTypes.get(idx);
if (!DataTypeUtils.isDatetimeType(fieldType)) {
// date time type partition field is formatted specifically,
// read directly from the data file to avoid format mismatch or precision loss
Expand Down