MCPcopy Create free account
hub / github.com/apache/impala / Prepare

Method Prepare

be/src/exec/hdfs-table-sink.cc:103–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103Status HdfsTableSink::Prepare(RuntimeState* state, MemTracker* parent_mem_tracker) {
104 SCOPED_TIMER(profile()->total_time_counter());
105 RETURN_IF_ERROR(TableSinkBase::Prepare(state, parent_mem_tracker));
106 unique_id_str_ = PrintId(state->fragment_instance_id(), "-");
107
108 // Resolve table id and set input tuple descriptor.
109 table_desc_ = static_cast<const HdfsTableDescriptor*>(
110 state->desc_tbl().GetTableDescriptor(table_id_));
111
112 if (table_desc_ == nullptr) {
113 stringstream error_msg;
114 error_msg << "Failed to get table descriptor for table id: " << table_id_;
115 return Status(error_msg.str());
116 }
117
118 staging_dir_ = Substitute("$0/_impala_insert_staging/$1", table_desc_->hdfs_base_dir(),
119 PrintId(state->query_id(), "_"));
120
121 // Sanity check.
122 if (!IsIceberg()) {
123 DCHECK_LE(partition_key_expr_evals_.size(), table_desc_->num_cols())
124 << DebugString();
125 DCHECK_EQ(partition_key_expr_evals_.size(), table_desc_->num_clustering_cols())
126 << DebugString();
127 DCHECK_GE(output_expr_evals_.size(),
128 table_desc_->num_cols() - table_desc_->num_clustering_cols()) << DebugString();
129 }
130
131 return Status::OK();
132}
133
134void HdfsTableSink::BuildPartitionDescMap() {
135 for (const HdfsTableDescriptor::PartitionIdToDescriptorMap::value_type& id_to_desc:

Callers

nothing calls this directly

Calls 12

PrintIdFunction · 0.85
SubstituteFunction · 0.85
OKFunction · 0.85
total_time_counterMethod · 0.80
GetTableDescriptorMethod · 0.80
num_colsMethod · 0.80
num_clustering_colsMethod · 0.80
StatusClass · 0.70
DebugStringFunction · 0.50
strMethod · 0.45
query_idMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected