Package org.apache.parquet.proto
Class ProtoWriteSupport<T extends com.google.protobuf.MessageOrBuilder>
- java.lang.Object
-
- org.apache.parquet.hadoop.api.WriteSupport<T>
-
- org.apache.parquet.proto.ProtoWriteSupport<T>
-
public class ProtoWriteSupport<T extends com.google.protobuf.MessageOrBuilder> extends WriteSupport<T>
Implementation ofWriteSupport
for writing Protocol Buffers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.parquet.hadoop.api.WriteSupport
WriteSupport.FinalizedWriteContext, WriteSupport.WriteContext
-
-
Field Summary
Fields Modifier and Type Field Description static String
PB_CLASS_WRITE
static String
PB_SPECS_COMPLIANT_WRITE
-
Constructor Summary
Constructors Constructor Description ProtoWriteSupport()
ProtoWriteSupport(Class<? extends com.google.protobuf.Message> protobufClass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WriteSupport.FinalizedWriteContext
finalizeWrite()
String
getName()
WriteSupport.WriteContext
init(org.apache.hadoop.conf.Configuration configuration)
void
prepareForWrite(RecordConsumer recordConsumer)
static void
setSchema(org.apache.hadoop.conf.Configuration configuration, Class<? extends com.google.protobuf.Message> protoClass)
static void
setWriteSpecsCompliant(org.apache.hadoop.conf.Configuration configuration, boolean writeSpecsCompliant)
Make parquet-protobuf use the LIST and MAP wrappers for collections.void
write(T record)
Writes Protocol buffer to parquet file.
-
-
-
Field Detail
-
PB_CLASS_WRITE
public static final String PB_CLASS_WRITE
- See Also:
- Constant Field Values
-
PB_SPECS_COMPLIANT_WRITE
public static final String PB_SPECS_COMPLIANT_WRITE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProtoWriteSupport
public ProtoWriteSupport()
-
ProtoWriteSupport
public ProtoWriteSupport(Class<? extends com.google.protobuf.Message> protobufClass)
-
-
Method Detail
-
getName
public String getName()
- Overrides:
getName
in classWriteSupport<T extends com.google.protobuf.MessageOrBuilder>
-
setSchema
public static void setSchema(org.apache.hadoop.conf.Configuration configuration, Class<? extends com.google.protobuf.Message> protoClass)
-
setWriteSpecsCompliant
public static void setWriteSpecsCompliant(org.apache.hadoop.conf.Configuration configuration, boolean writeSpecsCompliant)
Make parquet-protobuf use the LIST and MAP wrappers for collections. Set to false if you need backward compatibility with parquet before PARQUET-968 (1.9.0 and older).- Parameters:
configuration
- The hadoop configurationwriteSpecsCompliant
- If set to true, the old schema style will be used (without wrappers).
-
write
public void write(T record)
Writes Protocol buffer to parquet file.- Specified by:
write
in classWriteSupport<T extends com.google.protobuf.MessageOrBuilder>
- Parameters:
record
- instance of Message.Builder or Message.
-
prepareForWrite
public void prepareForWrite(RecordConsumer recordConsumer)
- Specified by:
prepareForWrite
in classWriteSupport<T extends com.google.protobuf.MessageOrBuilder>
-
init
public WriteSupport.WriteContext init(org.apache.hadoop.conf.Configuration configuration)
- Specified by:
init
in classWriteSupport<T extends com.google.protobuf.MessageOrBuilder>
-
finalizeWrite
public WriteSupport.FinalizedWriteContext finalizeWrite()
- Overrides:
finalizeWrite
in classWriteSupport<T extends com.google.protobuf.MessageOrBuilder>
-
-