16 #ifndef IMPALA_EXEC_DATA_SINK_H
17 #define IMPALA_EXEC_DATA_SINK_H
19 #include <boost/scoped_ptr.hpp>
24 #include "gen-cpp/DataSinks_types.h"
25 #include "gen-cpp/Exprs_types.h"
33 class TPlanExecRequest;
34 class TPlanExecParams;
35 class TPlanFragmentExecParams;
64 const TDataSink& thrift_sink,
const std::vector<TExpr>& output_exprs,
65 const TPlanFragmentExecParams& params,
74 TInsertStats* dst_stats);
78 const std::string& prefix =
"");
boost::scoped_ptr< MemTracker > expr_mem_tracker_
virtual void Close(RuntimeState *state)=0
virtual RuntimeProfile * profile()=0
Returns the runtime profile for the sink.
virtual Status Open(RuntimeState *state)=0
Call before Send() or Close().
Superclass of all data sinks.
std::map< std::string, TInsertPartitionStatus > PartitionStatusMap
static std::string OutputInsertStats(const PartitionStatusMap &stats, const std::string &prefix="")
Outputs the insert stats contained in the map of insert partition updates to a string.
static void MergeInsertStats(const TInsertStats &src_stats, TInsertStats *dst_stats)
const RowDescriptor & row_desc() const
virtual Status Prepare(RuntimeState *state)
virtual Status Send(RuntimeState *state, RowBatch *batch, bool eos)=0
static Status CreateDataSink(ObjectPool *pool, const TDataSink &thrift_sink, const std::vector< TExpr > &output_exprs, const TPlanFragmentExecParams ¶ms, const RowDescriptor &row_desc, boost::scoped_ptr< DataSink > *sink)