15 #ifndef IMPALA_EXEC_HDFS_SEQUENCE_WRITER_H
16 #define IMPALA_EXEC_HDFS_SEQUENCE_WRITER_H
30 class TupleDescriptor;
34 struct OutputPartition;
44 const std::vector<ExprContext*>& output_exprs);
51 virtual void Close() {
return; }
58 const std::vector<int32_t>& row_group_indices,
virtual std::string file_extension() const
Returns the file extension for this writer.
void EncodeRow(TupleRow *row, WriteStream *buf)
std::string sync_marker_
16 byte sync marker (a uuid)
static const char * VALUE_CLASS_NAME
Name of java class to use when reading the values.
HdfsSequenceTableWriter(HdfsTableSink *parent, RuntimeState *state, OutputPartition *output, const HdfsPartitionDescriptor *partition, const HdfsTableDescriptor *table_desc, const std::vector< ExprContext * > &output_exprs)
uint64_t unflushed_rows_
number of rows consumed since last flush
Status ConsumeRow(TupleRow *row)
processes a single row, delegates to Compress or NoCompress ConsumeRow().
char escape_char_
Escape character for text encoding.
virtual void Close()
Called once when this writer should cleanup any resources.
bool record_compression_
true if compression is applied on each record individually
uint64_t approx_block_size_
std::string codec_name_
name of codec, only set if compress_flag_
WriteStream row_buf_
Temporary Buffer for a single row.
Status WriteFileHeader()
writes the SEQ file header to HDFS
bool compress_flag_
true if compression is enabled
virtual Status Finalize()
std::string neg1_sync_marker_
A -1 infront of the sync marker, used in decompressed formats.
virtual Status AppendRowBatch(RowBatch *rows, const std::vector< int32_t > &row_group_indices, bool *new_file)
~HdfsSequenceTableWriter()
virtual Status Init()
Do initialization of writer.
Metadata for a single partition inside an Hdfs table.
Status WriteCompressedBlock()
writes the contents of out_ as a single compressed block
WriteStream out_
buffer which holds accumulated output
boost::scoped_ptr< Codec > compressor_
the codec for compressing, only set if compress_flag_
char field_delim_
Character delimiting fields.
void WriteEscapedString(const StringValue *str_val, WriteStream *buf)
writes the str_val to the buffer, escaping special characters
static uint8_t SEQ6_CODE[4]
Magic characters used to identify the file type.
virtual uint64_t default_block_size() const
virtual Status InitNewFile()
Called when a new file is started.
MemPool * mem_pool_
memory pool used by codec to allocate output buffer