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

Method Codegen

be/src/exec/hdfs-scan-node-base.cc:548–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548void HdfsScanPlanNode::Codegen(FragmentState* state) {
549 DCHECK(state->ShouldCodegen());
550 PlanNode::Codegen(state);
551 if (IsNodeCodegenDisabled()) return;
552 for (const THdfsFileFormat::type format : tnode_->hdfs_scan_node.file_formats) {
553 llvm::Function* fn;
554 Status status;
555 switch (format) {
556 case THdfsFileFormat::TEXT:
557 status = HdfsTextScanner::Codegen(this, state, &fn);
558 break;
559 case THdfsFileFormat::SEQUENCE_FILE:
560 status = HdfsSequenceScanner::Codegen(this, state, &fn);
561 break;
562 case THdfsFileFormat::AVRO:
563 status = HdfsAvroScanner::Codegen(this, state, &fn);
564 break;
565 case THdfsFileFormat::PARQUET:
566 case THdfsFileFormat::ORC:
567 status = HdfsColumnarScanner::Codegen(this, state, &fn);
568 break;
569 default:
570 // No codegen for this format
571 fn = nullptr;
572 status = Status::Expected("Not implemented for this format.");
573 }
574 DCHECK(fn != nullptr || !status.ok());
575 const char* format_name = _THdfsFileFormat_VALUES_TO_NAMES.find(format)->second;
576 if (status.ok()) {
577 LlvmCodeGen* codegen = state->codegen();
578 DCHECK(codegen != nullptr);
579 codegen->AddFunctionToJit(
580 fn, &codegend_fn_map_[static_cast<THdfsFileFormat::type>(format)]);
581 }
582 AddCodegenStatus(status, format_name);
583 }
584}
585
586Status HdfsScanNodeBase::Open(RuntimeState* state) {
587 RETURN_IF_ERROR(ScanNode::Open(state));

Callers

nothing calls this directly

Calls 5

ShouldCodegenMethod · 0.45
okMethod · 0.45
findMethod · 0.45
codegenMethod · 0.45
AddFunctionToJitMethod · 0.45

Tested by

no test coverage detected