-
Notifications
You must be signed in to change notification settings - Fork 8.3k
<Error> executeQuery: Code: 43, e.displayText() = DB::Exception: Illegal type Int64 of last argument for aggregate function with If suffix: #16588
Description
When i use argMaxIf function ,sometimes there will be problems.To be more precise, when I use a smaller amount of data, say 15,000,000 rows of data, I don't get this problem, but when I continue to insert 5,000,000 rows of data, the query sql reports the following error.
When divided into three sql ,three sql separate query HL_LOCK_TYPE,HL_LOCK_STATE,HL_BLOCKEDBY_INT_ID these three fields, is also no problem.
thanks
logs are below:
2020.11.01 18:29:29.947360 [ 160 ] {8c5cab1b-c410-4338-a7e0-4af011c72538} executeQuery: Code: 43, e.displayText() = DB::Exception: Illegal type Int64 of last argument for aggregate function with If suffix: While executing SourceFromNativeStream (version 20.8.4.11 (official build)) (from [::ffff:10.16.130.50]:52476) (in query: SELECT HL_LOCK_EXT_ID, HL_LOCK_INT_ID, argMaxIf(HL_LOCK_TYPE, offset, Sign > 0) AS HL_LOCK_TYPE, argMaxIf(HL_LOCK_STATE, offset, Sign > 0) AS HL_LOCK_STATE, argMaxIf(HL_BLOCKEDBY_INT_ID, offset, Sign > 0) AS HL_BLOCKEDBY_INT_ID FROM test.hive_locks2 GROUP BY HL_LOCK_EXT_ID, HL_LOCK_INT_ID HAVING sum(Sign) > 0;), Stack trace (when copying this message, always include the lines below):
- Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int) @ 0x18ba03d0 in /usr/bin/clickhouse
- DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int) @ 0xe606dad in /usr/bin/clickhouse
- DB::AggregateFunctionCombinatorIf::transformArguments(std::__1::vector<std::__1::shared_ptr<DB::IDataType const>, std::__1::allocator<std::__1::shared_ptr<DB::IDataType const> > > const&) const @ 0xf8fa4ff in /usr/bin/clickhouse
- DB::AggregateFunctionFactory::getImpl(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::vector<std::__1::shared_ptr<DB::IDataType const>, std::__1::allocator<std::__1::shared_ptr<DB::IDataType const> > > const&, DB::Array const&, DB::AggregateFunctionProperties&, bool, int) const @ 0x1520b19a in /usr/bin/clickhouse
- DB::AggregateFunctionFactory::get(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::vector<std::__1::shared_ptr<DB::IDataType const>, std::__1::allocator<std::__1::shared_ptr<DB::IDataType const> > > const&, DB::Array const&, DB::AggregateFunctionProperties&, int) const @ 0x1520b848 in /usr/bin/clickhouse
- DB::AggregateFunctionFactory::getImpl(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::vector<std::__1::shared_ptr<DB::IDataType const>, std::__1::allocator<std::__1::shared_ptr<DB::IDataType const> > > const&, DB::Array const&, DB::AggregateFunctionProperties&, bool, int) const @ 0x1520af01 in /usr/bin/clickhouse
- DB::AggregateFunctionFactory::get(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::vector<std::__1::shared_ptr<DB::IDataType const>, std::__1::allocator<std::__1::shared_ptr<DB::IDataType const> > > const&, DB::Array const&, DB::AggregateFunctionProperties&, int) const @ 0x1520b5c1 in /usr/bin/clickhouse
- ? @ 0x15486aba in /usr/bin/clickhouse
- std::__1::__function::__func<std::__1::shared_ptr<DB::IDataType const> ()(std::__1::shared_ptrDB::IAST const&), std::__1::allocator<std::__1::shared_ptr<DB::IDataType const> ()(std::__1::shared_ptrDB::IAST const&)>, std::__1::shared_ptr<DB::IDataType const> (std::__1::shared_ptrDB::IAST const&)>::operator()(std::__1::shared_ptrDB::IAST const&) @ 0x154885a7 in /usr/bin/clickhouse
- DB::DataTypeFactory::get(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::shared_ptrDB::IAST const&) const @ 0x154b1efc in /usr/bin/clickhouse
- DB::DataTypeFactory::get(std::__1::shared_ptrDB::IAST const&) const @ 0x154b2525 in /usr/bin/clickhouse
- DB::DataTypeFactory::get(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) const @ 0x154b2714 in /usr/bin/clickhouse
- DB::NativeBlockInputStream::readImpl() @ 0x15aba47e in /usr/bin/clickhouse
- DB::IBlockInputStream::read() @ 0x1545e1ad in /usr/bin/clickhouse
- ? @ 0x16525d5a in /usr/bin/clickhouse
- DB::ISource::work() @ 0x162b59bb in /usr/bin/clickhouse
- ? @ 0x162eb140 in /usr/bin/clickhouse
- ? @ 0x162ef39d in /usr/bin/clickhouse
- ? @ 0x162efc66 in /usr/bin/clickhouse
- ThreadPoolImplstd::__1::thread::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xe6345b7 in /usr/bin/clickhouse
- ? @ 0xe632b03 in /usr/bin/clickhouse
- start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
- __clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so