-
Notifications
You must be signed in to change notification settings - Fork 8.3k
ALTER RENAME COLUMN doesn't work with skip indices. #12303
Copy link
Copy link
Closed
Labels
featurenot plannedKnown issue, no plans to fix it currenltyKnown issue, no plans to fix it currenltyusability
Description
Describe the bug
If you try to rename column, which has any skip index on it, you will get an exception.
How to reproduce
DROP TABLE IF EXISTS t_ind;
CREATE TABLE t_ind
(
a UInt32,
INDEX i a TYPE minmax GRANULARITY 1
)
ENGINE = MergeTree
ORDER BY tuple();
INSERT INTO t_ind SELECT number from numbers(100);
SELECT count() FROM t_ind where a > 50;
ALTER TABLE t_ind RENAME COLUMN a TO b;
SELECT count() FROM t_ind where a > 50;
DROP TABLE IF EXISTS t_ind;
Stacktrace:
2020.07.09 00:27:44.712766 [ 17109 ] {1cfc1d3a-eb81-4564-998b-350ec3d3f07c} <Error> executeQuery: Code: 47, e.displayText() = DB::Exception: Missing columns: 'a' while processing query: 'a', required columns: 'a', source columns: 'b' (version 20.6.1.1) (from [::1]:55430) (in query: ALTER TABLE t_ind RENAME COLUMN a TO b; ), Stack trace (when copying this message, always include the lines below):
0. /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/exception:129: Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x103600cc in /home/ap11/ClickHouse/build_clang/programs/clickhouse
1. /home/ap11/ClickHouse/build_clang/../src/Common/Exception.cpp:38: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x9ada249 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
2. /home/ap11/ClickHouse/build_clang/../src/Interpreters/SyntaxAnalyzer.cpp:0: DB::SyntaxAnalyzerResult::collectUsedColumns(std::__1::shared_ptr<DB::IAST> const&, bool) @ 0xe0e84aa in /home/ap11/ClickHouse/build_clang/programs/clickhouse
3. /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/new:253: DB::SyntaxAnalyzer::analyze(std::__1::shared_ptr<DB::IAST>&, DB::NamesAndTypesList const&, std::__1::shared_ptr<DB::IStorage const>, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, bool) const @ 0xe0ef371 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
4. /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/memory:4206: DB::IndexDescription::getIndexFromAST(std::__1::shared_ptr<DB::IAST> const&, DB::ColumnsDescription const&, DB::Context const&) @ 0xe20c272 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
5. /home/ap11/ClickHouse/build_clang/../src/Storages/IndicesDescription.cpp:122: DB::IndexDescription::recalculateWithNewColumns(DB::ColumnsDescription const&, DB::Context const&) @ 0xe20cf71 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
6. /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/iterator:1480: DB::AlterCommands::apply(DB::StorageInMemoryMetadata&, DB::Context const&) const @ 0xe1f645e in /home/ap11/ClickHouse/build_clang/programs/clickhouse
7. /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/__hash_table:90: DB::MergeTreeData::checkAlterIsPossible(DB::AlterCommands const&, DB::Settings const&) const @ 0xe3e2a53 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
8. /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/memory:3826: DB::InterpreterAlterQuery::execute() @ 0xde8eaa6 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
9. /home/ap11/ClickHouse/build_clang/../src/Interpreters/executeQuery.cpp:0: DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0xe124073 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
10. /home/ap11/ClickHouse/build_clang/../src/Interpreters/executeQuery.cpp:653: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0xe12344e in /home/ap11/ClickHouse/build_clang/programs/clickhouse
11. /home/ap11/ClickHouse/build_clang/../src/Server/TCPHandler.cpp:0: DB::TCPHandler::runImpl() @ 0xe589ba7 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
12. /home/ap11/ClickHouse/build_clang/../src/Server/TCPHandler.cpp:0: DB::TCPHandler::run() @ 0xe592067 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
13. /home/ap11/ClickHouse/build_clang/../contrib/poco/Net/src/TCPServerConnection.cpp:57: Poco::Net::TCPServerConnection::start() @ 0x102e0587 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
14. /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/atomic:1036: Poco::Net::TCPServerDispatcher::run() @ 0x102e0a08 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
15. /home/ap11/ClickHouse/build_clang/../contrib/poco/Foundation/src/ThreadPool.cpp:213: Poco::PooledThread::run() @ 0x103bbe77 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
16. /home/ap11/ClickHouse/build_clang/../contrib/poco/Foundation/include/Poco/SharedPtr.h:156: Poco::ThreadImpl::runnableEntry(void*) @ 0x103b9e36 in /home/ap11/ClickHouse/build_clang/programs/clickhouse
17. start_thread @ 0x76db in /lib/x86_64-linux-gnu/libpthread-2.27.so
18. /build/glibc-OTsEL5/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97: __GI___clone @ 0x12188f in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featurenot plannedKnown issue, no plans to fix it currenltyKnown issue, no plans to fix it currenltyusability