16 #ifndef IMPALA_EXEC_HDFS_TABLE_WRITER_H
17 #define IMPALA_EXEC_HDFS_TABLE_WRITER_H
20 #include <boost/scoped_ptr.hpp>
21 #include <boost/unordered_map.hpp>
45 const std::vector<ExprContext*>& output_expr_ctxs);
74 const std::vector<int32_t>& row_group_indices,
83 virtual void Close() = 0;
102 return Write(reinterpret_cast<const uint8_t*>(data), len);
108 return Write(reinterpret_cast<uint8_t*>(&v),
sizeof(T));
static const int HDFS_FLUSH_WRITE_SIZE
HdfsTableSink * parent_
Parent table sink object.
virtual uint64_t default_block_size() const =0
RuntimeState * state_
Runtime state.
virtual Status InitNewFile()=0
Called when a new file is started.
TInsertStats & stats()
Returns the stats for this writer.
Status Write(const char *data, int32_t len)
Write to the current hdfs file.
virtual ~HdfsTableWriter()
const HdfsTableDescriptor * table_desc_
Table descriptor of table to be written.
virtual Status AppendRowBatch(RowBatch *batch, const std::vector< int32_t > &row_group_indices, bool *new_file)=0
HdfsTableWriter(HdfsTableSink *parent, RuntimeState *state, OutputPartition *output_partition, const HdfsPartitionDescriptor *partition_desc, const HdfsTableDescriptor *table_desc, const std::vector< ExprContext * > &output_expr_ctxs)
virtual Status Finalize()=0
std::vector< ExprContext * > output_expr_ctxs_
Expressions that materialize output values.
virtual Status Init()=0
Do initialization of writer.
virtual std::string file_extension() const =0
Returns the file extension for this writer.
virtual void Close()=0
Called once when this writer should cleanup any resources.
TInsertStats stats_
Subclass should populate any file format specific stats.
Metadata for a single partition inside an Hdfs table.
OutputPartition * output_
Structure describing partition written to by this writer.