Skip to content

Unexpected TABLE_ALREADY_EXISTS on SELECT from iceberg table function on 25.8 antalya #1683

@alsugiliazova

Description

@alsugiliazova

Describe the bug
I used latest build from this pr #1638: https://altinity-build-artifacts.s3.amazonaws.com/PRs/1638/c8076ef48299e32de097b8571eb35d3a2bc83510/build_arm_release/clickhouse-common-static_25.8.16.20002.altinityantalya_arm64.deb

 SELECT count(), hostName()
                                      FROM iceberg(
                                          'http://minio:9000/warehouse/data/remote_initiator_288d4192_3f3f_11f1_b30f_de7b9eea348f',
                                          '[masked]:Secret(name='minio_root_user')',
                                          '[masked]:Secret(name='minio_root_password')'
                                      )
                                      GROUP BY hostName()
                                      SETTINGS 
                                              object_storage_remote_initiator = 1, 
                                              object_storage_cluster = 'cluster_with_user_and_pwd',
                                              log_comment = 'log_comment_2984b724_3f3f_11f1_b30f_de7b9eea348f'
Received exception from server (version 25.8.16):
Code: 57. DB::Exception: Received from localhost:9000. DB::Exception: Iceberg table with path data/remote_initiator_288d4192_3f3f_11f1_b30f_de7b9eea348f already exists. (TABLE_ALREADY_EXISTS)

Trace:

2026.04.23 20:06:33.759661 [ 39 ] {} <Error> TCPHandler: Code: 57. DB::Exception: Iceberg table with path data/remote_initiator_288d4192_3f3f_11f1_b30f_de7b9eea348f already exists. (TABLE_ALREADY_EXISTS), Stack trace (when copying this message, always include the lines below):

0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000010eb06f0
1. DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000b949a58
2. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000b949528
3. DB::Exception::Exception<String const&>(int, FormatStringHelperImpl<std::type_identity<String const&>::type>, String const&) @ 0x000000000c746338
4. DB::IcebergMetadata::createInitial(std::shared_ptr<DB::IObjectStorage> const&, std::weak_ptr<DB::StorageObjectStorageConfiguration> const&, std::shared_ptr<DB::Context const> const&, std::optional<DB::ColumnsDescription> const&, std::shared_ptr<DB::IAST>, bool, std::shared_ptr<DataLake::ICatalog>, DB::StorageID const&) @ 0x0000000013bd602c
5. DB::DataLakeConfiguration<DB::StorageS3Configuration, DB::IcebergMetadata>::create(std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context const>, std::optional<DB::ColumnsDescription> const&, std::shared_ptr<DB::IAST>, bool, std::shared_ptr<DataLake::ICatalog>, DB::StorageID const&) @ 0x0000000012f06d50
6. DB::StorageIcebergConfiguration::create(std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context const>, std::optional<DB::ColumnsDescription> const&, std::shared_ptr<DB::IAST>, bool, std::shared_ptr<DataLake::ICatalog>, DB::StorageID const&) @ 0x0000000012efc914
7. DB::StorageObjectStorageCluster::StorageObjectStorageCluster(String const&, std::shared_ptr<DB::StorageObjectStorageConfiguration>, std::shared_ptr<DB::IObjectStorage>, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const>, String const&, std::optional<DB::FormatSettings>, DB::LoadingStrictnessLevel, std::shared_ptr<DataLake::ICatalog>, bool, bool, bool, bool, bool) @ 0x0000000013936bdc
8. std::shared_ptr<DB::StorageObjectStorageCluster> std::allocate_shared[abi:ne190107]<DB::StorageObjectStorageCluster, std::allocator<DB::StorageObjectStorageCluster>, String const&, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>&, DB::StorageID, DB::ColumnsDescription&, DB::ConstraintsDescription, std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const>&, String, std::nullopt_t const&, DB::LoadingStrictnessLevel, std::nullptr_t, bool, bool, bool, bool, bool, 0>(std::allocator<DB::StorageObjectStorageCluster> const&, String const&, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>&, DB::StorageID&&, DB::ColumnsDescription&, DB::ConstraintsDescription&&, std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const>&, String&&, std::nullopt_t const&, DB::LoadingStrictnessLevel&&, std::nullptr_t&&, bool&&, bool&&, bool&&, bool&&, bool&&) @ 0x0000000012f550e0
9. DB::TableFunctionObjectStorageCluster<DB::IcebergClusterDefinition, DB::StorageIcebergConfiguration, true>::executeImpl(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const>, String const&, DB::ColumnsDescription, bool) const @ 0x0000000012f58c30
10. DB::ITableFunction::execute(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const>, String const&, DB::ColumnsDescription, bool, bool) const @ 0x0000000013809c34
11. DB::Context::executeTableFunction(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::ITableFunction> const&) @ 0x000000001501fe10
12. DB::QueryAnalyzer::resolveTableFunction(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, DB::QueryExpressionsAliasVisitor&, bool) @ 0x000000001492448c
13. DB::QueryAnalyzer::resolve(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::Context const>) @ 0x0000000014916798
14. DB::QueryAnalysisPass::run(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::Context const>) @ 0x0000000014915df0
15. DB::(anonymous namespace)::buildQueryTreeDistributed(DB::SelectQueryInfo&, std::shared_ptr<DB::StorageSnapshot> const&, DB::StorageID const&, std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::IAST> const&) @ 0x0000000015b7d78c
16. DB::StorageDistributed::read(DB::QueryPlan&, std::vector<String, std::allocator<String>> const&, std::shared_ptr<DB::StorageSnapshot> const&, DB::SelectQueryInfo&, std::shared_ptr<DB::Context const>, DB::QueryProcessingStage::Enum, unsigned long, unsigned long) @ 0x0000000015b7b4ec
17. DB::IStorageCluster::read(DB::QueryPlan&, std::vector<String, std::allocator<String>> const&, std::shared_ptr<DB::StorageSnapshot> const&, DB::SelectQueryInfo&, std::shared_ptr<DB::Context const>, DB::QueryProcessingStage::Enum, unsigned long, unsigned long) @ 0x0000000015b30da0
18. DB::(anonymous namespace)::buildQueryPlanForTableExpression(std::shared_ptr<DB::IQueryTreeNode>, std::shared_ptr<DB::IQueryTreeNode> const&, DB::SelectQueryInfo const&, DB::SelectQueryOptions const&, std::shared_ptr<DB::PlannerContext>&, bool, bool) @ 0x0000000014b85220
19. DB::buildJoinTreeQueryPlan(std::shared_ptr<DB::IQueryTreeNode> const&, DB::SelectQueryInfo const&, DB::SelectQueryOptions&, std::unordered_set<String, std::hash<String>, std::equal_to<String>, std::allocator<String>> const&, std::shared_ptr<DB::PlannerContext>&) @ 0x0000000014b7d514
20. DB::Planner::buildPlanForQueryNode() @ 0x0000000014b67db0
21. DB::Planner::buildQueryPlanIfNeeded() @ 0x0000000014b646ec
22. DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::unique_ptr<DB::ReadBuffer, std::default_delete<DB::ReadBuffer>>&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::ImplicitTransactionControlExecutor>) @ 0x00000000155b1eb4
23. DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x00000000155ad768
24. DB::TCPHandler::runImpl() @ 0x00000000169bb310
25. DB::TCPHandler::run() @ 0x00000000169d7d28
26. Poco::Net::TCPServerConnection::start() @ 0x000000001b4dfe98
27. Poco::Net::TCPServerDispatcher::run() @ 0x000000001b4e0434
28. Poco::PooledThread::run() @ 0x000000001b4a5d9c
29. Poco::ThreadImpl::runnableEntry(void*) @ 0x000000001b4a4110
30. ? @ 0x000000000007d5b8
31. ? @ 0x00000000000e5edc

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions