Skip to content

[SPARK-30492][SQL] Eliminate deprecation warnings in ORC datasource #27179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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 @@ -22,8 +22,10 @@
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.orc.TypeDescription;

import java.io.IOException;
import java.util.List;

/**
* This is based on hive-exec-1.2.1
Expand All @@ -41,10 +43,11 @@ public class SparkOrcNewRecordReader extends

public SparkOrcNewRecordReader(Reader file, Configuration conf,
long offset, long length) throws IOException {
if (file.getTypes().isEmpty()) {
List<TypeDescription> subTypes = file.getSchema().getChildren();
if (subTypes == null) {
numColumns = 0;
} else {
numColumns = file.getTypes().get(0).getSubtypesCount();
numColumns = subTypes.size();
}
value = new OrcStruct(numColumns);
this.reader = OrcInputFormat.createReaderFromFile(file, conf, offset,
Expand Down