| 576 | } |
| 577 | |
| 578 | Status DescriptorTbl::CreatePartKeyExprs( |
| 579 | const HdfsTableDescriptor& hdfs_tbl, ObjectPool* pool) { |
| 580 | // Prepare and open partition exprs |
| 581 | for (const auto& part_entry : hdfs_tbl.partition_descriptors()) { |
| 582 | HdfsPartitionDescriptor* part_desc = part_entry.second; |
| 583 | vector<ScalarExpr*> partition_key_value_exprs; |
| 584 | RETURN_IF_ERROR(ScalarExpr::Create(part_desc->thrift_partition_key_exprs_, |
| 585 | RowDescriptor(), nullptr, pool, &partition_key_value_exprs)); |
| 586 | for (const ScalarExpr* partition_expr : partition_key_value_exprs) { |
| 587 | DCHECK(partition_expr->IsLiteral()); |
| 588 | DCHECK(!partition_expr->HasFnCtx()); |
| 589 | DCHECK_EQ(partition_expr->GetNumChildren(), 0); |
| 590 | } |
| 591 | // TODO: RowDescriptor should arguably be optional in Prepare for known literals. |
| 592 | // Partition exprs are not used in the codegen case. Don't codegen them. |
| 593 | RETURN_IF_ERROR(ScalarExprEvaluator::Create(partition_key_value_exprs, nullptr, |
| 594 | pool, nullptr, nullptr, &part_desc->partition_key_value_evals_)); |
| 595 | RETURN_IF_ERROR(ScalarExprEvaluator::Open( |
| 596 | part_desc->partition_key_value_evals_, nullptr)); |
| 597 | } |
| 598 | return Status::OK(); |
| 599 | } |
| 600 | |
| 601 | Status DescriptorTbl::DeserializeThrift(const TDescriptorTableSerialized& serial_tbl, |
| 602 | TDescriptorTable* desc_tbl) { |
nothing calls this directly
no test coverage detected