Skip to content

Commit 790a87c

Browse files
authored
[BugFix] fix iceberg transform compact bug (backport #62697) (#62766)
Signed-off-by: SevenJ <[email protected]>
1 parent 3bfca8a commit 790a87c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

be/src/runtime/descriptors.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ IcebergTableDescriptor::IcebergTableDescriptor(const TTableDescriptor& tdesc, Ob
239239
} else {
240240
_source_column_names = tdesc.icebergTable.partition_column_names; //to compat with lower fe, set this also
241241
_partition_column_names = tdesc.icebergTable.partition_column_names;
242+
for ([[maybe_unused]] const auto& _ : tdesc.icebergTable.partition_column_names) {
243+
_transform_exprs.emplace_back("identity"); //to compat with lower fe, set this also
244+
}
242245
}
243246
}
244247

be/src/runtime/iceberg_table_sink.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ Status IcebergTableSink::decompose_to_pipeline(pipeline::OpFactories prev_operat
102102
} else {
103103
auto source_column_index = iceberg_table_desc->partition_source_index_in_schema();
104104
partition_expr = iceberg_table_desc->get_partition_exprs();
105+
106+
//for 3.5 fe -> 4.0 be compact, try to set this.
107+
if (partition_expr.empty()) {
108+
auto output_expr = this->get_output_expr();
109+
for (const auto& index : source_column_index) {
110+
if (index < 0 || index >= this->get_output_expr().size()) {
111+
return Status::InternalError(fmt::format("Invalid partition index: {}", index));
112+
}
113+
partition_expr.push_back(output_expr[index]);
114+
}
115+
}
116+
105117
int idx = 0;
106118
for (auto& part_expr : partition_expr) {
107119
int index = source_column_index[idx];

0 commit comments

Comments
 (0)