Skip to content

Iceberg table BAD_GET on CREATE #85409

@PedroTadim

Description

@PedroTadim

Describe the bug

Easy to reproduce.

How to reproduce

With local named collection, run:

CREATE TABLE t0 (c0 Int) ENGINE = IcebergLocal(local, path = 't0/') PARTITION BY (c0::Int); --DB::Exception: Bad get: has String, requested Int64. (BAD_GET)

Error message and/or stacktrace

Stack trace:

<Error> TCPHandler: Code: 170. DB::Exception: Bad get: has String, requested Int64. (BAD_GET), Stack trace (when copying this message, always include the lines below):

0. contrib/llvm-project/libcxx/include/__exception/exception.h:113: Poco::Exception::Exception(String const&, int) @ 0x0000000026ed6532
1. src/Common/Exception.cpp:119: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000001423f929
2. src/Common/Exception.h:122: DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000cee5f0e
3. src/Common/Exception.h:57: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000cee5691
4. src/Common/Exception.h:140: DB::Exception::Exception<std::basic_string_view<char, std::char_traits<char>>, std::basic_string_view<char, std::char_traits<char>>>(int, FormatStringHelperImpl<std::type_identity<std::basic_string_view<char, std::char_traits<char>>>::type, std::type_identity<std::basic_string_view<char, std::char_traits<char>>>::type>, std::basic_string_view<char, std::char_traits<char>>&&, std::basic_string_view<char, std::char_traits<char>>&&) @ 0x0000000019da6bb6
5. src/Core/Field.cpp:874: DB::NearestFieldTypeImpl<__decay(long), void>::Type& DB::Field::safeGet<long>() & @ 0x0000000019da7639
6. src/Core/Field.h:437: DB::getPartitionField(std::shared_ptr<DB::IAST>, std::unordered_map<String, int, std::hash<String>, std::equal_to<String>, std::allocator<std::pair<String const, int>>> const&, int&) @ 0x000000001990a939
7. src/Storages/ObjectStorage/DataLakes/Iceberg/Utils.cpp:530: DB::getPartitionSpec(std::shared_ptr<DB::IAST>, std::unordered_map<String, int, std::hash<String>, std::equal_to<String>, std::allocator<std::pair<String const, int>>> const&) @ 0x000000001990b7ee
8. src/Storages/ObjectStorage/DataLakes/Iceberg/Utils.cpp:590: DB::createEmptyMetadataFile(String, DB::ColumnsDescription const&, std::shared_ptr<DB::IAST>, unsigned long) @ 0x000000001990cf3c
9. src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.cpp:478: 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&) @ 0x00000000198956de
10. src/Storages/ObjectStorage/DataLakes/DataLakeConfiguration.h:112: DB::DataLakeConfiguration<DB::StorageLocalConfiguration, 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&) @ 0x00000000178b7b13
11. src/Storages/ObjectStorage/StorageObjectStorage.cpp:128: DB::StorageObjectStorage::StorageObjectStorage(std::shared_ptr<DB::StorageObjectStorageConfiguration>, std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context const>, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>, DB::LoadingStrictnessLevel, std::shared_ptr<DataLake::ICatalog>, bool, bool, bool, std::shared_ptr<DB::IAST>, bool, bool) @ 0x00000000196f0576
12. contrib/llvm-project/libcxx/include/__memory/construct_at.h:41: DB::StorageObjectStorage* std::construct_at[abi:se190107]<DB::StorageObjectStorage, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>, bool const&, bool, bool, std::shared_ptr<DB::IAST>&, DB::StorageObjectStorage*>(DB::StorageObjectStorage*, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>&&, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>&&, bool const&, bool&&, bool&&, std::shared_ptr<DB::IAST>&) @ 0x000000001e406635
13. contrib/llvm-project/libcxx/include/__memory/construct_at.h:49: std::shared_ptr<DB::StorageObjectStorage> std::allocate_shared[abi:se190107]<DB::StorageObjectStorage, std::allocator<DB::StorageObjectStorage>, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>, bool const&, bool, bool, std::shared_ptr<DB::IAST>&, 0>(std::allocator<DB::StorageObjectStorage> const&, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>&&, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>&&, bool const&, bool&&, bool&&, std::shared_ptr<DB::IAST>&) @ 0x000000001e40636c
14. contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:851: DB::(anonymous namespace)::createStorageObjectStorage(DB::StorageFactory::Arguments const&, std::shared_ptr<DB::StorageObjectStorageConfiguration>) @ 0x000000001e405206
15. src/Storages/ObjectStorage/registerStorageObjectStorage.cpp:274: std::shared_ptr<DB::IStorage> std::__function::__policy_invoker<std::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::__call_impl[abi:se190107]<std::__function::__default_alloc_func<DB::registerStorageIceberg(DB::StorageFactory&)::$_4, std::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>>(std::__function::__policy_storage const*, DB::StorageFactory::Arguments const&) @ 0x000000001e405ccd
16. contrib/llvm-project/libcxx/include/__functional/function.h:716: ? @ 0x000000001e0b8fc2
17. src/Interpreters/InterpreterCreateQuery.cpp:1955: DB::InterpreterCreateQuery::doCreateTable(DB::ASTCreateQuery&, DB::InterpreterCreateQuery::TableProperties const&, std::unique_ptr<DB::DDLGuard, std::default_delete<DB::DDLGuard>>&, DB::LoadingStrictnessLevel) @ 0x000000001b176a49
18. src/Interpreters/InterpreterCreateQuery.cpp:1752: DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) @ 0x000000001b17006c
19. src/Interpreters/InterpreterCreateQuery.cpp:2362: DB::InterpreterCreateQuery::execute() @ 0x000000001b17ce12
20. src/Interpreters/executeQuery.cpp:1561: 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>) @ 0x000000001b503a57
21. src/Interpreters/executeQuery.cpp:1770: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001b4feec5
22. src/Server/TCPHandler.cpp:739: DB::TCPHandler::runImpl() @ 0x000000001ee1e88f
23. src/Server/TCPHandler.cpp:2740: DB::TCPHandler::run() @ 0x000000001ee38724
24. base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x0000000026f8cf07
25. base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x0000000026f8d4e5
26. base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x0000000026f2c6bf
27. base/poco/Foundation/src/Thread_POSIX.cpp:341: Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000026f29d91
28. start_thread @ 0x00000000000a27f1
29. __clone3 @ 0x0000000000133c9c

Metadata

Metadata

Assignees

Labels

comp-datalakeData lake table formats (Iceberg/Delta/Hudi) integration.fuzzProblem found by one of the fuzzerspotential bugTo be reviewed by developers and confirmed/rejected.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions