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

Method Open

be/src/exec/hdfs-scanner.cc:93–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93Status HdfsScanner::Open(ScannerContext* context) {
94 context_ = context;
95 RETURN_IF_ERROR(ValidateSlotDescriptors());
96 file_metadata_utils_.SetFile(state_, scan_node_->GetFileDesc(
97 context->partition_descriptor()->id(), context->GetStream()->filename()));
98 stream_ = context->GetStream();
99
100 // Clone the scan node's conjuncts map. The cloned evaluators must be closed by the
101 // caller.
102 for (const auto& entry: scan_node_->conjuncts_map()) {
103 RETURN_IF_ERROR(ScalarExprEvaluator::Clone(&obj_pool_, scan_node_->runtime_state(),
104 expr_perm_pool_.get(), context_->expr_results_pool(), entry.second,
105 &conjunct_evals_map_[entry.first]));
106 }
107 DCHECK(conjunct_evals_map_.find(scan_node_->tuple_desc()->id()) !=
108 conjunct_evals_map_.end());
109 conjunct_evals_ = &conjunct_evals_map_[scan_node_->tuple_desc()->id()];
110
111 // Set up the scan node's dictionary filtering conjuncts map.
112 if (scan_node_->thrift_dict_filter_conjuncts_map() != nullptr) {
113 for (auto& entry : *(scan_node_->thrift_dict_filter_conjuncts_map())) {
114 SlotDescriptor* slot_desc = state_->desc_tbl().GetSlotDescriptor(entry.first);
115 TupleId tuple_id = (slot_desc->type().IsCollectionType() ?
116 slot_desc->children_tuple_descriptor()->id() :
117 slot_desc->parent()->id());
118 auto conjunct_evals_it = conjunct_evals_map_.find(tuple_id);
119 DCHECK(conjunct_evals_it != conjunct_evals_map_.end());
120 const vector<ScalarExprEvaluator*>& conjunct_evals = conjunct_evals_it->second;
121
122 // Convert this slot's list of conjunct indices into a list of pointers
123 // into conjunct_evals_.
124 for (int conjunct_idx : entry.second) {
125 DCHECK_LT(conjunct_idx, conjunct_evals.size());
126 DCHECK((conjunct_evals)[conjunct_idx] != nullptr);
127 dict_filter_map_[entry.first].push_back((conjunct_evals)[conjunct_idx]);
128 }
129 }
130 }
131
132 std::map<const SlotId, const SlotDescriptor*> slot_descs_written;
133 template_tuple_ = file_metadata_utils_.CreateTemplateTuple(
134 context_->partition_descriptor()->id(), template_tuple_pool_.get(),
135 &slot_descs_written);
136 template_tuple_map_[scan_node_->tuple_desc()] = template_tuple_;
137
138 decompress_timer_ = ADD_TIMER(scan_node_->runtime_profile(), "DecompressionTime");
139 return Status::OK();
140}
141
142Status HdfsScanner::ProcessSplit() {
143 DCHECK(scan_node_->HasRowBatchQueue());

Callers

nothing calls this directly

Calls 15

OKFunction · 0.85
SetFileMethod · 0.80
partition_descriptorMethod · 0.80
GetStreamMethod · 0.80
IsCollectionTypeMethod · 0.80
push_backMethod · 0.80
CreateTemplateTupleMethod · 0.80
getMethod · 0.65
GetFileDescMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected