ychernysh commented on code in PR #2937:
URL: https://github.com/apache/drill/pull/2937#discussion_r1738562829
##########
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetSchema.java:
##########
@@ -227,12 +251,14 @@ public void createNonExistentColumns(OutputMutator
output, List<NullableIntVecto
* @throws SchemaChangeException should not occur
*/
- private NullableIntVector createMissingColumn(SchemaPath col, OutputMutator
output) throws SchemaChangeException {
- // col.toExpr() is used here as field name since we don't want to see
these fields in the existing maps
- MaterializedField field = MaterializedField.create(col.toExpr(),
-
Types.optional(TypeProtos.MinorType.INT));
- return (NullableIntVector) output.addField(field,
- TypeHelper.getValueVectorClass(TypeProtos.MinorType.INT,
DataMode.OPTIONAL));
+ private ValueVector createMissingColumn(SchemaPath col, OutputMutator
output) throws SchemaChangeException {
+ String colName = col.getAsUnescapedPath();
+ MaterializedField tableField = tableSchema.column(colName);
+ TypeProtos.MinorType type = tableField == null ? TypeProtos.MinorType.INT
: tableField.getType().getMinorType();
+ MaterializedField field = MaterializedField.create(colName,
Review Comment:
Please see [this
comment](https://github.com/apache/drill/pull/2937#issuecomment-2320908961).
--
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]