public final class ParquetWriter extends java.lang.Object implements TableWriter
ParquetRow.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes a writer, which means the table is complete now.
|
static ParquetWriter |
create(TableSchema schema,
AlluxioURI uri)
Creates a Parquet writer.
|
static ParquetWriter |
create(TableSchema schema,
AlluxioURI uri,
int rowGroupSize,
boolean enableDictionary)
Creates a Parquet writer specifying a row group size and whether to have dictionary enabled.
|
static ParquetWriter |
create(TableSchema schema,
AlluxioURI uri,
int rowGroupSize,
boolean enableDictionary,
java.lang.String compressionCodec)
Creates a Parquet writer specifying a row group size.
|
static ParquetWriter |
create(TableSchema schema,
AlluxioURI uri,
PartitionInfo partitionInfo)
Creates a parquet writer based on the partitionInfo.
|
long |
getBytes()
Note that the bytes written should take compression and encoding into consideration.
|
int |
getRows() |
void |
write(TableRow row)
Writes a row.
|
public static ParquetWriter create(TableSchema schema, AlluxioURI uri) throws java.io.IOException
create in interface TableWriterschema - the schemauri - the URI to the outputjava.io.IOExceptionpublic static ParquetWriter create(TableSchema schema, AlluxioURI uri, @Nullable PartitionInfo partitionInfo) throws java.io.IOException
create in interface TableWriterschema - the schemauri - the URI to the outputpartitionInfo - the partitionInfo (default configuration is used if null)java.io.IOExceptionpublic static ParquetWriter create(TableSchema schema, AlluxioURI uri, int rowGroupSize, boolean enableDictionary) throws java.io.IOException
schema - the schemauri - the URI to the outputrowGroupSize - the row group sizeenableDictionary - whether to enable dictionaryjava.io.IOExceptionpublic static ParquetWriter create(TableSchema schema, AlluxioURI uri, int rowGroupSize, boolean enableDictionary, java.lang.String compressionCodec) throws java.io.IOException
schema - the schemauri - the URI to the outputrowGroupSize - the row group sizeenableDictionary - whether to enable dictionarycompressionCodec - the compression codec namejava.io.IOExceptionpublic void write(TableRow row) throws java.io.IOException
TableWriterwrite in interface TableWriterrow - a rowjava.io.IOException - when write failspublic void close()
throws java.io.IOException
TableWriterclose in interface TableWriterclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException - when failing to close the underlying output streampublic int getRows()
getRows in interface TableWriterpublic long getBytes()
TableWritergetBytes in interface TableWriterCopyright © 2022. All Rights Reserved.