| 414 | } |
| 415 | |
| 416 | Tuple* HdfsScanPlanNode::InitTemplateTuple( |
| 417 | const std::vector<ScalarExprEvaluator*>& evals, MemPool* pool) const { |
| 418 | if (partition_key_slots_.empty() && !HasVirtualColumnInTemplateTuple()) return nullptr; |
| 419 | Tuple* template_tuple = Tuple::Create(tuple_desc_->byte_size(), pool); |
| 420 | for (int i = 0; i < partition_key_slots_.size(); ++i) { |
| 421 | const SlotDescriptor* slot_desc = partition_key_slots_[i]; |
| 422 | ScalarExprEvaluator* eval = evals[slot_desc->col_pos()]; |
| 423 | // Exprs guaranteed to be literals, so can safely be evaluated without a row. |
| 424 | RawValue::Write(eval->GetValue(NULL), template_tuple, slot_desc, nullptr); |
| 425 | } |
| 426 | return template_tuple; |
| 427 | } |
| 428 | |
| 429 | int HdfsScanPlanNode::GetMaterializedSlotIdx(const std::vector<int>& path) const { |
| 430 | auto result = path_to_materialized_slot_idx_.find(path); |