| 496 | HdfsScanNodeBase::~HdfsScanNodeBase() {} |
| 497 | |
| 498 | Status HdfsScanNodeBase::Prepare(RuntimeState* state) { |
| 499 | SCOPED_TIMER(runtime_profile_->total_time_counter()); |
| 500 | RETURN_IF_ERROR(ScanNode::Prepare(state)); |
| 501 | AddBytesReadCounters(); |
| 502 | |
| 503 | // Prepare collection conjuncts |
| 504 | for (const auto& entry: conjuncts_map_) { |
| 505 | TupleDescriptor* tuple_desc = state->desc_tbl().GetTupleDescriptor(entry.first); |
| 506 | // conjuncts_ are already prepared in ExecNode::Prepare(), don't try to prepare again |
| 507 | if (tuple_desc == tuple_desc_) { |
| 508 | conjunct_evals_map_[entry.first] = conjunct_evals(); |
| 509 | } else { |
| 510 | DCHECK(conjunct_evals_map_[entry.first].empty()); |
| 511 | RETURN_IF_ERROR(ScalarExprEvaluator::Create(entry.second, state, pool_, |
| 512 | expr_perm_pool(), expr_results_pool(), &conjunct_evals_map_[entry.first])); |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | // Prepare stats statistics conjuncts. |
| 517 | if (stats_tuple_id_ != -1) { |
| 518 | RETURN_IF_ERROR(ScalarExprEvaluator::Create(stats_conjuncts_, state, pool_, |
| 519 | expr_perm_pool(), expr_results_pool(), &stats_conjunct_evals_)); |
| 520 | } |
| 521 | |
| 522 | // Check if reservation was enough to allocate at least one buffer. The |
| 523 | // reservation calculation in HdfsScanNode.java should guarantee this. |
| 524 | // Hitting this error indicates a misconfiguration or bug. |
| 525 | int64_t min_buffer_size = ExecEnv::GetInstance()->disk_io_mgr()->min_buffer_size(); |
| 526 | if (scan_range_params_->size() > 0 |
| 527 | && resource_profile_.min_reservation < min_buffer_size) { |
| 528 | return Status(TErrorCode::INTERNAL_ERROR, |
| 529 | Substitute("HDFS scan min reservation $0 must be >= min buffer size $1", |
| 530 | resource_profile_.min_reservation, min_buffer_size)); |
| 531 | } |
| 532 | |
| 533 | // One-time initialization of state that is constant across scan ranges |
| 534 | iceberg_partition_filtering_pool_.reset(new MemPool(mem_tracker())); |
| 535 | runtime_profile()->AddInfoString("Table Name", hdfs_table_->fully_qualified_name()); |
| 536 | |
| 537 | if (HasRowBatchQueue()) { |
| 538 | // Add per volume stats to the runtime profile for Non MT scan node. |
| 539 | PerVolumeStats per_volume_stats; |
| 540 | stringstream str; |
| 541 | UpdateHdfsSplitStats(*scan_range_params_, &per_volume_stats); |
| 542 | PrintHdfsSplitStats(per_volume_stats, &str); |
| 543 | runtime_profile()->AddInfoString(HDFS_SPLIT_STATS_DESC, str.str()); |
| 544 | } |
| 545 | return Status::OK(); |
| 546 | } |
| 547 | |
| 548 | void HdfsScanPlanNode::Codegen(FragmentState* state) { |
| 549 | DCHECK(state->ShouldCodegen()); |
nothing calls this directly
no test coverage detected