Skip to content

Commit 94cf4be

Browse files
committed
[parquet-thrift] start removing things marked for deprecation
1 parent 9db6236 commit 94cf4be

23 files changed

+9
-1245
lines changed

parquet-thrift/pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,6 @@
120120
<type>test-jar</type>
121121
<scope>test</scope>
122122
</dependency>
123-
<dependency>
124-
<groupId>org.apache.parquet</groupId>
125-
<artifactId>parquet-pig</artifactId>
126-
<version>1.15.0</version>
127-
</dependency>
128-
<dependency>
129-
<groupId>org.apache.pig</groupId>
130-
<artifactId>pig</artifactId>
131-
<version>${pig.version}</version>
132-
<classifier>${pig.classifier}</classifier>
133-
<scope>provided</scope>
134-
</dependency>
135123
<dependency>
136124
<groupId>javax.annotation</groupId>
137125
<artifactId>javax.annotation-api</artifactId>

parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/ParquetThriftBytesOutputFormat.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,4 @@ public ParquetThriftBytesOutputFormat(
7272
FieldIgnoredHandler errorHandler) {
7373
super(new ThriftBytesWriteSupport(configuration, protocolFactory, thriftClass, buffered, errorHandler));
7474
}
75-
76-
/**
77-
* @param protocolFactory the protocol factory to use to read the bytes
78-
* @param thriftClass thriftClass the class to extract the schema from
79-
* @param buffered whether we should buffer each record
80-
* @param errorHandler handle record corruption and schema incompatible exception
81-
* @deprecated Use @link{ParquetThriftBytesOutputFormat(
82-
* Configuration configuration, TProtocolFactory protocolFactory,
83-
* {@literal Class<\? extends TBase<\?, ?>>} thriftClass, boolean buffered,
84-
* FieldIgnoredHandler errorHandler)} instead.
85-
*/
86-
@Deprecated
87-
public ParquetThriftBytesOutputFormat(
88-
TProtocolFactory protocolFactory,
89-
Class<? extends TBase<?, ?>> thriftClass,
90-
boolean buffered,
91-
FieldIgnoredHandler errorHandler) {
92-
this(new Configuration(), protocolFactory, thriftClass, buffered, errorHandler);
93-
}
9475
}

parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/ParquetThriftOutputFormat.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
public class ParquetThriftOutputFormat<T extends TBase<?, ?>> extends ParquetOutputFormat<T> {
3030

3131
public static void setThriftClass(Job job, Class<? extends TBase<?, ?>> thriftClass) {
32-
ThriftWriteSupport.setThriftClass(ContextUtil.getConfiguration(job), thriftClass);
32+
TBaseWriteSupport.setThriftClass(ContextUtil.getConfiguration(job), thriftClass);
3333
}
3434

3535
public static Class<? extends TBase<?, ?>> getThriftClass(Job job) {
36-
return ThriftWriteSupport.getThriftClass(ContextUtil.getConfiguration(job));
36+
return TBaseWriteSupport.getThriftClass(ContextUtil.getConfiguration(job));
3737
}
3838

3939
public ParquetThriftOutputFormat() {
40-
super(new ThriftWriteSupport<T>());
40+
super(new TBaseWriteSupport<T>());
4141
}
4242
}

parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/ThriftBytesWriteSupport.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,6 @@ public ThriftBytesWriteSupport() {
9999
this.errorHandler = null;
100100
}
101101

102-
/**
103-
* @deprecated Use @link{ThriftBytesWriteSupport(Configuration configuration,
104-
* TProtocolFactory protocolFactory, {@literal Class<? extends TBase<?,?>>} thriftClass,
105-
* boolean buffered, FieldIgnoredHandler errorHandler)} instead
106-
*/
107-
@Deprecated
108-
public ThriftBytesWriteSupport(
109-
TProtocolFactory protocolFactory,
110-
Class<? extends TBase<?, ?>> thriftClass,
111-
boolean buffered,
112-
FieldIgnoredHandler errorHandler) {
113-
this(new Configuration(), protocolFactory, thriftClass, buffered, errorHandler);
114-
}
115-
116102
public ThriftBytesWriteSupport(
117103
Configuration configuration,
118104
TProtocolFactory protocolFactory,

parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/ThriftReadSupport.java

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.util.Map;
2424
import java.util.Set;
2525
import org.apache.hadoop.conf.Configuration;
26-
import org.apache.hadoop.mapred.JobConf;
2726
import org.apache.parquet.Strings;
2827
import org.apache.parquet.conf.HadoopParquetConfiguration;
2928
import org.apache.parquet.conf.ParquetConfiguration;
@@ -39,7 +38,6 @@
3938
import org.apache.parquet.thrift.projection.FieldProjectionFilter;
4039
import org.apache.parquet.thrift.projection.StrictFieldProjectionFilter;
4140
import org.apache.parquet.thrift.projection.ThriftProjectionException;
42-
import org.apache.parquet.thrift.projection.deprecated.DeprecatedFieldProjectionFilter;
4341
import org.apache.parquet.thrift.struct.ThriftType.StructType;
4442
import org.apache.thrift.TBase;
4543
import org.apache.thrift.protocol.TProtocol;
@@ -49,13 +47,6 @@
4947
public class ThriftReadSupport<T> extends ReadSupport<T> {
5048
private static final Logger LOG = LoggerFactory.getLogger(ThriftReadSupport.class);
5149

52-
/**
53-
* Deprecated. Use {@link #STRICT_THRIFT_COLUMN_FILTER_KEY}
54-
* Accepts a ";" delimited list of globs in the syntax implemented by {@link DeprecatedFieldProjectionFilter}
55-
*/
56-
@Deprecated
57-
public static final String THRIFT_COLUMN_FILTER_KEY = "parquet.thrift.column.filter";
58-
5950
/**
6051
* Accepts a ";" delimited list of glob paths, in the syntax implemented by {@link StrictFieldProjectionFilter}
6152
*/
@@ -73,20 +64,6 @@ public class ThriftReadSupport<T> extends ReadSupport<T> {
7364

7465
protected Class<T> thriftClass;
7566

76-
/**
77-
* A {@link ThriftRecordConverter} builds an object by working with {@link TProtocol}. The default
78-
* implementation creates standard Apache Thrift {@link TBase} objects; to support alternatives, such
79-
* as <a href="http://github.com/twitter/scrooge">Twiter's Scrooge</a>, a custom converter can be specified.
80-
*
81-
* @param conf a mapred jobconf
82-
* @param klass a thrift class
83-
* @deprecated use {@link #setRecordConverterClass(Configuration, Class)} below
84-
*/
85-
@Deprecated
86-
public static void setRecordConverterClass(JobConf conf, Class<?> klass) {
87-
setRecordConverterClass((Configuration) conf, klass);
88-
}
89-
9067
/**
9168
* A {@link ThriftRecordConverter} builds an object by working with {@link TProtocol}. The default
9269
* implementation creates standard Apache Thrift {@link TBase} objects; to support alternatives, such
@@ -99,11 +76,6 @@ public static void setRecordConverterClass(Configuration conf, Class<?> klass) {
9976
conf.set(RECORD_CONVERTER_CLASS_KEY, klass.getName());
10077
}
10178

102-
@Deprecated
103-
public static void setProjectionPushdown(JobConf jobConf, String projectionString) {
104-
jobConf.set(THRIFT_COLUMN_FILTER_KEY, projectionString);
105-
}
106-
10779
public static void setStrictFieldProjectionFilter(Configuration conf, String semicolonDelimitedGlobs) {
10880
conf.set(STRICT_THRIFT_COLUMN_FILTER_KEY, semicolonDelimitedGlobs);
10981
}
@@ -113,31 +85,12 @@ public static FieldProjectionFilter getFieldProjectionFilter(Configuration conf)
11385
}
11486

11587
public static FieldProjectionFilter getFieldProjectionFilter(ParquetConfiguration conf) {
116-
String deprecated = conf.get(THRIFT_COLUMN_FILTER_KEY);
11788
String strict = conf.get(STRICT_THRIFT_COLUMN_FILTER_KEY);
11889

119-
if (Strings.isNullOrEmpty(deprecated) && Strings.isNullOrEmpty(strict)) {
90+
if (Strings.isNullOrEmpty(strict)) {
12091
return null;
12192
}
12293

123-
if (!Strings.isNullOrEmpty(deprecated) && !Strings.isNullOrEmpty(strict)) {
124-
throw new ThriftProjectionException("You cannot provide both "
125-
+ THRIFT_COLUMN_FILTER_KEY
126-
+ " and "
127-
+ STRICT_THRIFT_COLUMN_FILTER_KEY
128-
+ "! "
129-
+ THRIFT_COLUMN_FILTER_KEY
130-
+ " is deprecated.");
131-
}
132-
133-
if (!Strings.isNullOrEmpty(deprecated)) {
134-
LOG.warn(
135-
"Using {} is deprecated. Please see the docs for {}!",
136-
THRIFT_COLUMN_FILTER_KEY,
137-
STRICT_THRIFT_COLUMN_FILTER_KEY);
138-
return new DeprecatedFieldProjectionFilter(deprecated);
139-
}
140-
14194
return StrictFieldProjectionFilter.fromSemicolonDelimitedString(strict);
14295
}
14396

@@ -166,8 +119,8 @@ public org.apache.parquet.hadoop.api.ReadSupport.ReadContext init(InitContext co
166119
if (partialSchemaString != null && projectionFilter != null) {
167120
throw new ThriftProjectionException(String.format(
168121
"You cannot provide both a partial schema and field projection filter."
169-
+ "Only one of (%s, %s, %s) should be set.",
170-
PARQUET_READ_SCHEMA, STRICT_THRIFT_COLUMN_FILTER_KEY, THRIFT_COLUMN_FILTER_KEY));
122+
+ "Only one of (%s, %s) should be set.",
123+
PARQUET_READ_SCHEMA, STRICT_THRIFT_COLUMN_FILTER_KEY));
171124
}
172125

173126
// set requestedProjections only when it's specified
@@ -197,13 +150,6 @@ protected MessageType getProjectedSchema(
197150
.convert((Class<TBase<?, ?>>) thriftClass);
198151
}
199152

200-
@Deprecated
201-
@SuppressWarnings("unchecked")
202-
protected MessageType getProjectedSchema(FieldProjectionFilter fieldProjectionFilter) {
203-
return new ThriftSchemaConverter(new Configuration(), fieldProjectionFilter)
204-
.convert((Class<TBase<?, ?>>) thriftClass);
205-
}
206-
207153
private void initThriftClassFromMultipleFiles(Map<String, Set<String>> fileMetadata, Configuration conf)
208154
throws ClassNotFoundException {
209155
initThriftClassFromMultipleFiles(fileMetadata, new HadoopParquetConfiguration(conf));

parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/ThriftWriteSupport.java

Lines changed: 0 additions & 85 deletions
This file was deleted.

parquet-thrift/src/main/java/org/apache/parquet/thrift/TBaseRecordConverter.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,6 @@
3030

3131
public class TBaseRecordConverter<T extends TBase<?, ?>> extends ThriftRecordConverter<T> {
3232

33-
/**
34-
* This is for compatibility only.
35-
*
36-
* @param thriftClass a thrift class
37-
* @param requestedParquetSchema the requested Parquet schema
38-
* @param thriftType the thrift type
39-
* @deprecated will be removed in 2.x
40-
*/
41-
@Deprecated
42-
public TBaseRecordConverter(final Class<T> thriftClass, MessageType requestedParquetSchema, StructType thriftType) {
43-
this(thriftClass, requestedParquetSchema, thriftType, (HadoopParquetConfiguration) null);
44-
}
45-
4633
@SuppressWarnings("unused")
4734
public TBaseRecordConverter(
4835
final Class<T> thriftClass, MessageType requestedParquetSchema, StructType thriftType, Configuration conf) {

parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftParquetReader.java

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -34,55 +34,7 @@
3434
*
3535
* @param <T> the thrift type
3636
*/
37-
public class ThriftParquetReader<T extends TBase<?, ?>> extends ParquetReader<T> {
38-
39-
/**
40-
* @param file the file to read
41-
* @param thriftClass the class used to read
42-
* @throws IOException if there is an error while reading
43-
* @deprecated use {@link #build(Path)}
44-
*/
45-
@Deprecated
46-
public ThriftParquetReader(Path file, Class<T> thriftClass) throws IOException {
47-
super(file, new ThriftReadSupport<T>(thriftClass));
48-
}
49-
50-
/**
51-
* @param conf the configuration
52-
* @param file the file to read
53-
* @param thriftClass the class used to read
54-
* @throws IOException if there is an error while reading
55-
* @deprecated use {@link #build(Path)}
56-
*/
57-
@Deprecated
58-
public ThriftParquetReader(Configuration conf, Path file, Class<T> thriftClass) throws IOException {
59-
super(conf, file, new ThriftReadSupport<T>(thriftClass));
60-
}
61-
62-
/**
63-
* will use the thrift class based on the file metadata if a thrift class information is present
64-
*
65-
* @param file the file to read
66-
* @throws IOException if there is an error while reading
67-
* @deprecated use {@link #build(Path)}
68-
*/
69-
@Deprecated
70-
public ThriftParquetReader(Path file) throws IOException {
71-
super(file, new ThriftReadSupport<T>());
72-
}
73-
74-
/**
75-
* will use the thrift class based on the file metadata if a thrift class information is present
76-
*
77-
* @param conf the configuration
78-
* @param file the file to read
79-
* @throws IOException if there is an error while reading
80-
* @deprecated use {@link #build(Path)}
81-
*/
82-
@Deprecated
83-
public ThriftParquetReader(Configuration conf, Path file) throws IOException {
84-
super(conf, file, new ThriftReadSupport<T>());
85-
}
37+
public class ThriftParquetReader<T extends TBase<?, ?>> {
8638

8739
public static <T extends TBase<?, ?>> Builder<T> build(Path file) {
8840
return new Builder<T>(file);

parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftRecordConverter.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -821,24 +821,6 @@ public void end() {
821821
private boolean missingRequiredFieldsInProjection = false;
822822
private boolean ignoreNullElements = IGNORE_NULL_LIST_ELEMENTS_DEFAULT;
823823

824-
/**
825-
* This is for compatibility only.
826-
*
827-
* @param thriftReader the class responsible for instantiating the final object and read from the protocol
828-
* @param name the name of that type ( the thrift class simple name)
829-
* @param requestedParquetSchema the schema for the incoming columnar events
830-
* @param thriftType the thrift type descriptor
831-
* @deprecated will be removed in 2.x
832-
*/
833-
@Deprecated
834-
public ThriftRecordConverter(
835-
ThriftReader<T> thriftReader,
836-
String name,
837-
MessageType requestedParquetSchema,
838-
ThriftType.StructType thriftType) {
839-
this(thriftReader, name, requestedParquetSchema, thriftType, (ParquetConfiguration) null);
840-
}
841-
842824
/**
843825
* @param thriftReader the class responsible for instantiating the final object and read from the protocol
844826
* @param name the name of that type ( the thrift class simple name)

0 commit comments

Comments
 (0)