Skip to content

Commit

Permalink
PARQUET-2355: Deprecate parquet-thrift
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko committed Oct 18, 2023
1 parent 5ee5133 commit 16a1aa5
Show file tree
Hide file tree
Showing 45 changed files with 46 additions and 283 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


@Deprecated
public abstract class AbstractThriftWriteSupport<T> extends WriteSupport<T> {
public static final String PARQUET_THRIFT_CLASS = "parquet.thrift.class";
private static final Logger LOG = LoggerFactory.getLogger(AbstractThriftWriteSupport.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
/**
* Output format that turns Thrift bytes into Parquet format using the thrift TProtocol layer
*/
@Deprecated
public class ParquetThriftBytesOutputFormat extends ParquetOutputFormat<BytesWritable> {

public static void setThriftClass(Job job, Class<? extends TBase<?, ?>> thriftClass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import org.apache.parquet.hadoop.ParquetInputFormat;

@Deprecated
public class ParquetThriftInputFormat<T> extends ParquetInputFormat<T> {

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/**
* @param <T> the thrift class use for serialization
*/
@Deprecated
public class ParquetThriftOutputFormat<T extends TBase<?,?>> extends ParquetOutputFormat<T> {

public static void setThriftClass(Job job, Class<? extends TBase<?,?>> thriftClass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.parquet.thrift.ThriftSchemaConverter;
import org.apache.parquet.thrift.struct.ThriftType.StructType;

@Deprecated
public class TBaseWriteSupport<T extends TBase<?, ?>> extends AbstractThriftWriteSupport<T> {

private static Configuration conf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.apache.parquet.thrift.ThriftSchemaConverter;
import org.apache.parquet.thrift.struct.ThriftType.StructType;

@Deprecated
public class ThriftBytesWriteSupport extends WriteSupport<BytesWritable> {
private static final Logger LOG = LoggerFactory.getLogger(ThriftBytesWriteSupport.class);
private static final String PARQUET_PROTOCOL_CLASS = "parquet.protocol.class";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Deprecated
public class ThriftReadSupport<T> extends ReadSupport<T> {
private static final Logger LOG = LoggerFactory.getLogger(ThriftReadSupport.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
/**
* To create a Parquet file from the Thrift binary of records
*/
@Deprecated
public class ThriftToParquetFileWriter implements Closeable {

private final RecordWriter<Void, BytesWritable> recordWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
* be notified through {@link FieldIgnoredHandler#handleFieldIgnored(org.apache.thrift.protocol.TField)}
* and {@link FieldIgnoredHandler#handleRecordHasFieldIgnored()}
*/
@Deprecated
public class BufferedProtocolReadToWrite implements ProtocolPipe {

private interface Action {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*
* This interface is essentially a union of {keep, drop, sentinelUnion}
*/
@Deprecated
public interface ConvertedField {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/**
* Throw this exception when the schema used for decoding is not compatible with the schema in the data.
*/
@Deprecated
public class DecodingSchemaMismatchException extends ParquetEncodingException {
public DecodingSchemaMismatchException(String s) {
super(s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/**
* Implements this class to handle when fields get ignored in {@link BufferedProtocolReadToWrite}
*/
@Deprecated
public abstract class FieldIgnoredHandler {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* A {@link FieldProjectionFilter} that keeps only the first primitive field
* that it encounters.
*/
@Deprecated
class KeepOnlyFirstPrimitiveFilter implements FieldProjectionFilter {
private boolean found = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
/**
* Allows simple implementation of partial protocols
*/
@Deprecated
public abstract class ParquetProtocol extends TProtocol {

private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.slf4j.LoggerFactory;


@Deprecated
class ParquetReadProtocol extends ParquetProtocol {
private static final Logger LOG = LoggerFactory.getLogger(ParquetReadProtocol.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Deprecated
public class ParquetWriteProtocol extends ParquetProtocol {

public static final String WRITE_THREE_LEVEL_LISTS = "parquet.thrift.write-three-level-lists";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/**
* reads one record from an input and writes it to an output
*/
@Deprecated
public interface ProtocolPipe {
void readOne(TProtocol in, TProtocol out) throws TException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
/**
* Class to read from one protocol and write to another one
*/
@Deprecated
public class ProtocolReadToWrite implements ProtocolPipe {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Thrown when an error happened reading a thrift record
* Ignoring this exception will skip the bad record
*/
@Deprecated
public class SkippableException extends ParquetRuntimeException {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.parquet.schema.MessageType;
import org.apache.parquet.thrift.struct.ThriftType.StructType;

@Deprecated
public class TBaseRecordConverter<T extends TBase<?,?>> extends ThriftRecordConverter<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/**
* Metadata for thrift stored in the file footer
*/
@Deprecated
public class ThriftMetaData {
private static final Logger LOG = LoggerFactory.getLogger(ThriftMetaData.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* To read a parquet file into thrift objects
* @param <T> the thrift type
*/
@Deprecated
public class ThriftParquetReader<T extends TBase<?,?>> extends ParquetReader<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*
* @param <T> the type of the thrift class used to write data
*/
@Deprecated
public class ThriftParquetWriter<T extends TBase<?,?>> extends ParquetWriter<T> {

public ThriftParquetWriter(Path file, Class<T> thriftClass, CompressionCodecName compressionCodecName) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TProtocol;

@Deprecated
abstract public class ThriftReader<T> {

public abstract T readOneRecord(TProtocol protocol) throws TException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
*
* @param <T> the Java type of records created by this converter
*/
@Deprecated
public class ThriftRecordConverter<T> extends RecordMaterializer<T> {

private static final Logger LOG = LoggerFactory.getLogger(ThriftRecordConverter.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
* Visitor Class for converting a thrift definition to parquet message type.
* Projection can be done by providing a {@link FieldProjectionFilter}
*/
@Deprecated
class ThriftSchemaConvertVisitor implements ThriftType.StateVisitor<ConvertedField, ThriftSchemaConvertVisitor.State> {
private final FieldProjectionFilter fieldProjectionFilter;
private final boolean doProjection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* Given a thrift class, this class converts it to parquet schema,
* a {@link FieldProjectionFilter} can be specified for projection pushdown.
*/
@Deprecated
public class ThriftSchemaConverter {
private final FieldProjectionFilter fieldProjectionFilter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* usage:
* STORE 'foo' USING parquet.thrift.pig.ParquetThriftStorer('my.thrift.Class');
*/
@Deprecated
public class ParquetThriftStorer extends StoreFunc {

private RecordWriter<Void, Tuple> recordWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
/**
* Stores Pig tuples as Thrift objects
*/
@Deprecated
public class TupleToThriftWriteSupport extends WriteSupport<Tuple> {

private final String className;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* See {@link StrictFieldProjectionFilter} and
* {@link org.apache.parquet.thrift.projection.deprecated.DeprecatedFieldProjectionFilter}
*/
@Deprecated
public interface FieldProjectionFilter {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/**
* Represents an immutable column path as a sequence of fields.
*/
@Deprecated
public class FieldsPath {
private final ArrayList<ThriftField> fields;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@
/**
* Stricter Implementation of {@link FieldProjectionFilter}.
*
* See {@link org.apache.parquet.thrift.projection.deprecated.DeprecatedFieldProjectionFilter} for the previous
* syntax that allows for more powerful glob patterns, but has less error reporting and less strict requirements.
*
* This filter requires that every *possible* expansion of glob expressions (like '{x,y,z}') must match at least one
* column. Each expansion may match more than one if it contains wildcards ('*').
*
* Note that this class is stateful -- it keeps track of which expanded glob paths have matched a column, so that it can
* throw when {@link #assertNoUnmatchedPatterns()} is called.
*/
@Deprecated
public class StrictFieldProjectionFilter implements FieldProjectionFilter {
private static final Logger LOG = LoggerFactory.getLogger(FieldProjectionFilter.class);
private static final String GLOB_SEPARATOR = ";";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* thrown if the schema can not be projected/filtered
*/

@Deprecated
public class ThriftProjectionException extends ParquetRuntimeException {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
/**
* Create a dummy events for all required fields according to thrift definition
*/
@Deprecated
class DefaultEventsVisitor implements ThriftType.StateVisitor<Void, Void> {
List<ParquetProtocol> dummyEvents= new ArrayList<ParquetProtocol>();
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* when required fields are missing.
* {@link ProtocolEventsAmender} will use this class to generate events for missing required fields
*/
@Deprecated
class DefaultProtocolEventsGenerator {
public static ParquetProtocol READ_FIELD_STOP = new ParquetProtocol("readFieldBegin() => STOP") {
final TField stop = new TField("", TType.STOP, (short) 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/**
* fill in default value for required fields in TProtocols after projection is specified.
*/
@Deprecated
public class ProtocolEventsAmender {
List<TProtocol> rootEvents;
List<TProtocol> fixedEvents = new ArrayList<TProtocol>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.parquet.thrift.struct.ThriftField;
import org.apache.parquet.thrift.struct.ThriftTypeID;

@Deprecated
public class ReadFieldBeginProtocol extends ParquetProtocol {
private final ThriftField field;
private final byte thriftType;
Expand Down
Loading

0 comments on commit 16a1aa5

Please sign in to comment.