Repository navigation
Backport #116129 to 26.6: Fix iceberg identity partitioned reading - #116675
robot-ch-test-poll2 wants to merge 6 commits into
Conversation
|
Workflow [BackportPR], commit [f6fe813] Summary: ❌
|
|
@groeneai could you please resolve the conflicts and fix builds? |
|
I resolved this locally against current The conflict is one hunk, in const bool keep_in_reader = format_supports_prewhere && !has_schema_transform;
return std::make_shared<FormatFilterInfo>(
format_filter_info->filter_actions_dag, format_filter_info->context.lock(),
mapper,
keep_in_reader ? row_level_filter : nullptr,
keep_in_reader ? prewhere_info : nullptr);That is also the failure on all 7 builds. Two more
Deleting both is enough; diff at the bottom. Two things I would rather leave to you. Comparing this branch's diff against #116129 per file, added lines are
Verified: merged Build fixups, applying on top of the mergediff --git a/src/Storages/ObjectStorage/DataLakes/Iceberg/Compaction.cpp b/src/Storages/ObjectStorage/DataLakes/Iceberg/Compaction.cpp
--- a/src/Storages/ObjectStorage/DataLakes/Iceberg/Compaction.cpp
+++ b/src/Storages/ObjectStorage/DataLakes/Iceberg/Compaction.cpp
@@ -192,13 +192,6 @@ static Plan getPlan(
persistent_table_components.path_resolver.resolve(data_file->parsed_entry->file_path_key),
0,
Iceberg::getIdentityPartitionColumnValues(*data_file, *persistent_table_components.schema_processor));
- /// One DataFilePlan per source *data file*, keyed by the data file's own path.
- /// Keying by the manifest path made every data file after the first in a
- /// manifest reuse the first file's plan, so writeDataFiles rewrote only one
- /// file per manifest and the rest of the manifest's data silently disappeared
- /// from the compacted table. The map still deduplicates the same data file
- /// referenced from multiple snapshots' manifest lists.
- const auto & data_file_path = data_file->parsed_entry->file_path_key;
std::shared_ptr<DataFilePlan> data_file_ptr;
if (!plan.path_to_data_file.contains(manifest_file.manifest_file_path))
{
diff --git a/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp b/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp
--- a/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp
+++ b/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp
@@ -122,26 +122,6 @@ static void logIcebergFileStats(const ObjectInfoPtr & object_info, const LoggerP
#endif
}
-/// Whether reading this object goes through row-level delete transformers (Iceberg
-/// position/equality deletes, Delta Lake deletion vectors). The count-from-files cache
-/// is keyed only by the file path and its modification time, but delete files change the
-/// number of rows the file contributes WITHOUT touching the file itself, so both
-/// directions are unsafe: a count cached before a delete resurfaces deleted rows, and a
-/// count cached after it goes stale once the deletes are compacted away. Such files must
-/// neither use nor populate the cache.
-static bool hasAttachedDeletes(const ObjectInfo & object_info)
-{
-#if USE_AVRO
- if (const auto * iceberg_object = dynamic_cast<const IcebergDataObjectInfo *>(&object_info))
- {
- if (!iceberg_object->info.position_deletes_objects.empty() || !iceberg_object->info.equality_deletes_objects.empty())
- return true;
- }
-#endif
- return object_info.data_lake_metadata && object_info.data_lake_metadata->excluded_rows
- && object_info.data_lake_metadata->excluded_rows->size() > 0;
-}
-
static bool readsIdentityPartitionColumn(
const ActionsDAG & dag, const std::vector<std::pair<String, Field>> & identity_partition_columns)
{
@@ -996,18 +976,11 @@ StorageObjectStorageSource::ReaderHolder StorageObjectStorageSource::createReade
stripped_prewhere_info = format_filter_info->prewhere_info;
}
const bool keep_in_reader = format_supports_prewhere && !has_schema_transform;
- auto result = std::make_shared<FormatFilterInfo>(
+ return std::make_shared<FormatFilterInfo>(
format_filter_info->filter_actions_dag, format_filter_info->context.lock(),
mapper,
keep_in_reader ? row_level_filter : nullptr,
keep_in_reader ? prewhere_info : nullptr);
- /// `mapper` is scoped to the schema this specific file was written under, so it
- /// maps field_id -> the column name *that file* used. Keep the current/query-side
- /// mapper around too (see `current_schema_column_mapper` doc comment) for readers
- /// that need to resolve query-side filter column names (e.g. GeoParquet spatial
- /// pruning) back to a field_id.
- result->current_schema_column_mapper = format_filter_info->column_mapper;
- return result;
}
} |
…r` here The cherry-pick carried master's tail that assigns `result->current_schema_column_mapper`, so the build failed: error: no member named 'current_schema_column_mapper' in 'DB::FormatFilterInfo' That member keeps the query-side mapper for readers that resolve filter column names back to a field id (GeoParquet spatial pruning), and it does not exist in this branch. Return the newly built `FormatFilterInfo` directly, which leaves the same shape as `backport/26.3/116129`.
The branch was 375 commits behind and GitHub reported it `CONFLICTING`, which is why it had no CI at all. The only conflict is `StorageObjectStorageSource.cpp`, in two places, both resolved in favour of this pull request: - The identity-partition helpers (`readsIdentityPartitionColumn`, `substituteIdentityPartitionColumns`, `buildIdentityPartitionColumnsDag`) are what the pull request adds and 26.6 has nothing there. - The `FormatFilterInfo` built for a schema-changed file must be given the local `row_level_filter` / `prewhere_info`, not `format_filter_info->...`. Those locals are where the identity partition values have just been substituted into the filters, which is the whole point of this change; taking 26.6's spelling would bypass the substitution. `master` passes the locals in the same way.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Every build failed on
Compaction.cpp:201: error: unused variable 'data_file_path' [-Werror,-Wunused-variable]
The cherry-pick brought the comment and the declaration of #111617's keying
fix as context of the changed constructor call, but not the code: the three
lookups still used `manifest_file.manifest_file_path`, which the comment right
above them explains makes every data file after the first in a manifest reuse
the first file's plan, so the rest of the manifest's data silently disappears
from the compacted table. 26.6 never received that part of #111617 (#119206
carried only the trivial-count fix), so `-Werror` caught a real hole, not a
stylistic one. Use `data_file_path` for the `contains` check and both map
accesses, which is what `master` does and how the 26.3 backport resolved the
same conflict.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
… test The backport moves `DBMS_CLUSTER_PROCESSING_PROTOCOL_VERSION` from 6 straight to 9, defining 7 and 8 as constants so the number space matches `master`. But 26.6 has no code for version 8, `read_source_index` from #95181, which was never backported. The version is negotiated as `min(worker, own)` and the task response is written straight onto the connection, so in a mixed 26.6/26.7+ cluster both sides would agree on 9, one would write a field the other never reads, and the stream would misalign in both directions. Carry the version-8 field exactly as `master` does: this release never sets `read_source_index`, so it writes an empty one, and a 26.6 worker that receives a set one throws `UNKNOWN_PROTOCOL` instead of reading the wrong shards, which is the same fail-closed rule `master` applies on the sending side. Also restore `test_row_policy_over_csv`, which the cherry-pick dropped because it appends after a test that does not exist on 26.6; the change it covers is carried verbatim. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Original pull-request #116129
Cherry-pick pull-request #116574
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job