Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable getConstantResultForNonConstArguments for IS NULL with old analyzer #66654

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

KochetovNicolai
Copy link
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix Unknown identifier and Column is not under aggregate function errors for queries with the expression (column IS NULL). The bug was triggered by #65088, with the disabled analyzer only.

@KochetovNicolai KochetovNicolai added pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-cloud labels Jul 17, 2024
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-bugfix Pull request with bugfix, not backported by default label Jul 17, 2024
@KochetovNicolai KochetovNicolai added old-analyzer Relevant when analyzer is disabled pr-bugfix Pull request with bugfix, not backported by default and removed pr-bugfix Pull request with bugfix, not backported by default labels Jul 17, 2024
@robot-clickhouse
Copy link
Member

robot-clickhouse commented Jul 17, 2024

This is an automated comment for commit f16a05c with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help❌ failure
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc❌ failure
Successful checks
Check nameDescriptionStatus
Bugfix validationChecks that either a new test (functional or integration) or there some changed tests that fail with the binary built on master branch✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@vdimir vdimir self-assigned this Jul 17, 2024
@vdimir
Copy link
Member

vdimir commented Jul 18, 2024

Stateless tests (release, old analyzer, s3, DatabaseReplicated) [1/3] — fail: 1, passed: 2231, skipped: 44 Details

Test failure seems related

2024-07-18 04:52:49 Reason: result differs with reference:  
2024-07-18 04:52:49 --- /usr/share/clickhouse-test/queries/0_stateless/02892_orc_filter_pushdown.reference	2024-07-18 04:28:56.738480967 +1000
2024-07-18 04:52:49 +++ /tmp/clickhouse-test/0_stateless/02892_orc_filter_pushdown.stdout	2024-07-18 04:52:49.789840290 +1000
2024-07-18 04:52:49 @@ -206,7 +206,7 @@
2024-07-18 04:52:49  select count(), min(negative_or_null), max(negative_or_null) from file('02892.orc', ORC, 'number UInt64, negative_or_null Int64') where (negative_or_null < -500);
2024-07-18 04:52:49  596	-1099	-501
2024-07-18 04:52:49  select count(), sum(number) from file('02892.orc', ORC, 'number UInt64, negative_or_null Int64') where indexHint(negative_or_null is null);
2024-07-18 04:52:49 -0	0
2024-07-18 04:52:49 +1000	499500
2024-07-18 04:52:49  select count(), min(negative_or_null), max(negative_or_null) from file('02892.orc', ORC, 'number UInt64, negative_or_null Int64') where (negative_or_null is null);
2024-07-18 04:52:49  0	0	0
2024-07-18 04:52:49  select count(), sum(number) from file('02892.orc', ORC, 'number UInt64, negative_or_null Int64') where indexHint(negative_or_null in (0, -1, -10, -100, -1000));
2024-07-18 04:52:49 

@Algunenano
Copy link
Member

Fuzzer reports look related. E.g:

2024.07.18 19:12:55.882492 [ 186 ] {94ac332b-3148-4135-8cb4-6adeeef12c51} <Debug> executeQuery: (from [::ffff:127.0.0.1]:49728) (comment: /workspace/ch/tests/queries/0_stateless/03206_is_null_constant_result_old_analyzer_bug.sql) SELECT CAST(indexHint('02892.orc', 9, 9, 9, toUInt256(9), 9, 9, toLowCardinality(9), 9, 9, 9, 9, 9, 9, 9, 9, 9), 'Boolean'), now() FROM numbers(2) GROUP BY CAST(number IS NULL, 'Boolean'), now() FORMAT `Null` (stage: Complete)
2024.07.18 19:12:55.887498 [ 186 ] {94ac332b-3148-4135-8cb4-6adeeef12c51} <Trace> Planner: Query to stage Complete
2024.07.18 19:12:55.888318 [ 186 ] {94ac332b-3148-4135-8cb4-6adeeef12c51} <Trace> Planner: Query from stage FetchColumns to stage Complete
2024.07.18 19:12:55.889454 [ 186 ] {94ac332b-3148-4135-8cb4-6adeeef12c51} <Fatal> : Logical error: 'Bad cast from type DB::ColumnVector<char8_t> to DB::ColumnLowCardinality'.
2024.07.18 19:12:55.930509 [ 735 ] {} <Trace> system.text_log_sender.DistributedInsertQueue.default: Finished processing `/workspace/db/store/63c/63c5421d-59f8-4417-8a65-0e05cdadd358/shard1_replica1/254.bin` (took 1394 ms)
2024.07.18 19:12:55.930690 [ 735 ] {} <Trace> system.text_log_sender.DistributedInsertQueue.default/Bg: Execution took 1394 ms.
2024.07.18 19:12:56.000212 [ 861 ] {} <Trace> AsynchronousMetrics: MemoryTracking: was 1.76 GiB, peak 2.17 GiB, free memory in arenas 0.00 B, will set to 1.77 GiB (RSS), difference: 16.07 MiB
2024.07.18 19:12:56.021202 [ 186 ] {94ac332b-3148-4135-8cb4-6adeeef12c51} <Fatal> : Stack trace (when copying this message, always include the lines below):

0. ./contrib/llvm-project/libcxx/include/exception:141: Poco::Exception::Exception(String const&, int) @ 0x000000001df05703
1. ./build_docker/./src/Common/Exception.cpp:110: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000f7f8cf5
2. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x00000000073e23a0
3. DB::Exception::Exception<String, String>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<String>::type>, String&&, String&&) @ 0x00000000073e4686
4. _Z11typeid_castIRKN2DB20ColumnLowCardinalityEKNS0_7IColumnEQsr3stdE14is_reference_vIT_EES6_RT0_ @ 0x000000000794043a
5. COW<DB::IColumn>::immutable_ptr<DB::IColumn> std::__function::__policy_invoker<COW<DB::IColumn>::immutable_ptr<DB::IColumn> (std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>&, std::shared_ptr<DB::IDataType const> const&, DB::ColumnNullable const*, unsigned long)>::__call_impl<std::__function::__default_alloc_func<DB::(anonymous namespace)::FunctionCast::prepareUnpackDictionaries(std::shared_ptr<DB::IDataType const> const&, std::shared_ptr<DB::IDataType const> const&) const::'lambda0'(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>&, std::shared_ptr<DB::IDataType const> const&, DB::ColumnNullable const*, unsigned long), COW<DB::IColumn>::immutable_ptr<DB::IColumn> (std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>&, std::shared_ptr<DB::IDataType const> const&, DB::ColumnNullable const*, unsigned long)>>(std::__function::__policy_storage const*, std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>&, std::shared_ptr<DB::IDataType const> const&, DB::ColumnNullable const*, unsigned long) @ 0x00000000077fc5ed
6. DB::(anonymous namespace)::ExecutableFunctionCast::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x0000000007535787
7. DB::IExecutableFunction::executeDryRunImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x0000000007422824
8. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x00000000085221c7
9. DB::IExecutableFunction::defaultImplementationForConstantArguments(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x0000000008521c9e
10. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x0000000008522154
11. DB::IExecutableFunction::executeWithoutSparseColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x0000000008522e97
12. DB::IExecutableFunction::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x0000000008524acf
13. ./contrib/boost/boost/smart_ptr/intrusive_ptr.hpp:117: DB::ActionsDAG::evaluatePartialResult(std::unordered_map<DB::ActionsDAG::Node const*, DB::ColumnWithTypeAndName, std::hash<DB::ActionsDAG::Node const*>, std::equal_to<DB::ActionsDAG::Node const*>, std::allocator<std::pair<DB::ActionsDAG::Node const* const, DB::ColumnWithTypeAndName>>>&, std::vector<DB::ActionsDAG::Node const*, std::allocator<DB::ActionsDAG::Node const*>> const&, unsigned long, bool) @ 0x0000000017082ca6
14. ./build_docker/./src/Interpreters/ActionsDAG.cpp:0: DB::ActionsDAG::updateHeader(DB::Block const&) const @ 0x00000000170810bf
15. ./build_docker/./src/Processors/Transforms/ExpressionTransform.cpp:10: DB::ExpressionTransform::transformHeader(DB::Block const&, DB::ActionsDAG const&) @ 0x000000001a0b33ea
16. ./build_docker/./src/Processors/QueryPlan/ExpressionStep.cpp:32: DB::ExpressionStep::ExpressionStep(DB::DataStream const&, std::shared_ptr<DB::ActionsDAG> const&) @ 0x000000001a2f77b0
17. ./contrib/llvm-project/libcxx/include/string:1499: DB::(anonymous namespace)::addExpressionStep(DB::QueryPlan&, std::shared_ptr<DB::ActionsAndProjectInputsFlag> const&, String const&, std::vector<std::shared_ptr<DB::ActionsDAG>, std::allocator<std::shared_ptr<DB::ActionsDAG>>>&) @ 0x0000000017a46b41
18. ./contrib/llvm-project/libcxx/include/string:1499: DB::Planner::buildPlanForQueryNode() @ 0x0000000017a3ff05
19. ./build_docker/./src/Planner/Planner.cpp:1261: DB::Planner::buildQueryPlanIfNeeded() @ 0x0000000017a38f03
20. ./src/Planner/Planner.h:44: DB::InterpreterSelectQueryAnalyzer::getQueryPlan() @ 0x0000000017a3633b
21. ./build_docker/./src/Interpreters/executeQuery.cpp:1175: DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x0000000017e9c69e
22. ./build_docker/./src/Interpreters/executeQuery.cpp:1390: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x0000000017e98958
23. ./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:612: DB::TCPHandler::runImpl() @ 0x0000000019c2dd59
24. ./build_docker/./src/Server/TCPHandler.cpp:2368: DB::TCPHandler::run() @ 0x0000000019c4b768
25. ./build_docker/./base/poco/Net/src/TCPServerConnection.cpp:57: Poco::Net::TCPServerConnection::start() @ 0x000000001e0121a3
26. ./contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:48: Poco::Net::TCPServerDispatcher::run() @ 0x000000001e012a12
27. ./build_docker/./base/poco/Foundation/src/ThreadPool.cpp:219: Poco::PooledThread::run() @ 0x000000001df8b283
28. ./build_docker/./base/poco/Foundation/src/Thread.cpp:46: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x000000001df89550
29. ./base/poco/Foundation/include/Poco/SharedPtr.h:231: Poco::ThreadImpl::runnableEntry(void*) @ 0x000000001df87a2a
30. __tsan_thread_start_func @ 0x000000000735af2f
31. ? @ 0x00007f01f61aeac3

@KochetovNicolai KochetovNicolai added this pull request to the merge queue Jul 19, 2024
@KochetovNicolai KochetovNicolai removed this pull request from the merge queue due to a manual request Jul 19, 2024
@KochetovNicolai
Copy link
Member Author

Repro
select count() GROUP BY CAST(indexHint(toLowCardinality(9)), 'String')

@KochetovNicolai
Copy link
Member Author

Repro fails in with and without the PR. I will make a separate fix.

robot-clickhouse added a commit that referenced this pull request Jul 19, 2024
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jul 19, 2024
robot-ch-test-poll added a commit that referenced this pull request Jul 19, 2024
Backport #66654 to 24.6: Disable getConstantResultForNonConstArguments for IS NULL with old analyzer
robot-clickhouse added a commit that referenced this pull request Jul 19, 2024
Backport #66654 to 24.5: Disable getConstantResultForNonConstArguments for IS NULL with old analyzer
@alesapin alesapin removed pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backports-created-cloud pr-synced-to-cloud The PR is synced to the cloud repo labels Jul 30, 2024
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
old-analyzer Relevant when analyzer is disabled pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backports-created-cloud pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-cloud
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants