Skip to content

Commit

Permalink
[FLINK-8230] [orc] Fix NPEs when reading nested columns.
Browse files Browse the repository at this point in the history
- fixes NPEs for null-valued structs, lists, and maps
- fixes NPEs for repeating structs, lists, and maps
- adds test for deeply nested data with nulls
- adds test for columns with repeating values

This closes apache#5373.
  • Loading branch information
fhueske authored and twalthr committed Jan 31, 2018
1 parent 3cfc5ae commit bcead3b
Show file tree
Hide file tree
Showing 9 changed files with 1,993 additions and 1,522 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import java.util.Arrays;
import java.util.List;

import static org.apache.flink.orc.OrcUtils.fillRows;
import static org.apache.flink.orc.OrcBatchReader.fillRows;

/**
* InputFormat to read ORC files.
Expand Down Expand Up @@ -128,7 +128,7 @@ public OrcRowInputFormat(String path, TypeDescription orcSchema, Configuration o

// configure OrcRowInputFormat
this.schema = orcSchema;
this.rowType = (RowTypeInfo) OrcUtils.schemaToTypeInfo(schema);
this.rowType = (RowTypeInfo) OrcBatchReader.schemaToTypeInfo(schema);
this.conf = orcConfig;
this.batchSize = batchSize;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private OrcTableSource(String path, TypeDescription orcSchema, Configuration orc
this.predicates = predicates;

// determine the type information from the ORC schema
RowTypeInfo typeInfoFromSchema = (RowTypeInfo) OrcUtils.schemaToTypeInfo(this.orcSchema);
RowTypeInfo typeInfoFromSchema = (RowTypeInfo) OrcBatchReader.schemaToTypeInfo(this.orcSchema);

// set return type info
if (selectedFields == null) {
Expand Down
Loading

0 comments on commit bcead3b

Please sign in to comment.