public final class ParquetWriter extends 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,
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 IOException
create
in interface TableWriter
schema
- the schemauri
- the URI to the outputIOException
public static ParquetWriter create(TableSchema schema, AlluxioURI uri, @Nullable PartitionInfo partitionInfo) throws IOException
create
in interface TableWriter
schema
- the schemauri
- the URI to the outputpartitionInfo
- the partitionInfo (default configuration is used if null)IOException
public static ParquetWriter create(TableSchema schema, AlluxioURI uri, int rowGroupSize, boolean enableDictionary) throws IOException
schema
- the schemauri
- the URI to the outputrowGroupSize
- the row group sizeenableDictionary
- whether to enable dictionaryIOException
public static ParquetWriter create(TableSchema schema, AlluxioURI uri, int rowGroupSize, boolean enableDictionary, String compressionCodec) throws IOException
schema
- the schemauri
- the URI to the outputrowGroupSize
- the row group sizeenableDictionary
- whether to enable dictionarycompressionCodec
- the compression codec nameIOException
public void write(TableRow row) throws IOException
TableWriter
write
in interface TableWriter
row
- a rowIOException
- when write failspublic void close() throws IOException
TableWriter
close
in interface TableWriter
close
in interface Closeable
close
in interface AutoCloseable
IOException
- when failing to close the underlying output streampublic int getRows()
getRows
in interface TableWriter
public long getBytes()
TableWriter
getBytes
in interface TableWriter
Copyright © 2023. All Rights Reserved.