Skip to content

Commit 7126e4b

Browse files
committed
Temp
1 parent 1002a01 commit 7126e4b

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

velox/connectors/hive/iceberg/IcebergDataSink.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,28 @@ void IcebergDataSink::computePartitionAndBucketIds(const RowVectorPtr& input) {
409409
VELOX_CHECK(isPartitioned());
410410
VELOX_CHECK_NOT_NULL(transformEvaluator_);
411411
VELOX_CHECK_NOT_NULL(partitionIdGenerator_);
412+
std::vector<VectorPtr> children;
413+
children.reserve(input->childrenSize());
414+
415+
for (column_index_t i = 0; i < input->childrenSize(); ++i) {
416+
VELOX_CHECK(
417+
input->childAt(i)->type()->equivalent(*inputType_->childAt(i)),
418+
"Iceberg write input type mismatch at column {}. Expected {}, got {}.",
419+
i,
420+
inputType_->childAt(i)->toString(),
421+
input->childAt(i)->type()->toString());
422+
423+
children.push_back(input->childAt(i));
424+
}
425+
426+
auto inputForTransforms = std::make_shared<RowVector>(
427+
input->pool(),
428+
inputType_,
429+
input->nulls(),
430+
input->size(),
431+
std::move(children));
412432
// Step 1: Apply transforms to input partition columns.
413-
auto transformedColumns = transformEvaluator_->evaluate(input);
433+
auto transformedColumns = transformEvaluator_->evaluate(inputForTransforms);
414434

415435
// Step 2: Create RowVector based on transformed columns.
416436
const auto& transformedRowVector = std::make_shared<RowVector>(

0 commit comments

Comments
 (0)