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

Fixing aliases for GLOBAL IN #64517

Merged
merged 11 commits into from
Jun 3, 2024
Merged

Conversation

KochetovNicolai
Copy link
Member

@KochetovNicolai KochetovNicolai commented May 28, 2024

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 the Expression nodes list expected 1 projection names and Unknown expression or identifier errors for queries with aliases to GLOBAL IN.

Fixes #64445

@KochetovNicolai KochetovNicolai added pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-cloud analyzer Issues and pull-requests related to new analyzer labels May 28, 2024
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-bugfix Pull request with bugfix, not backported by default label May 28, 2024
@robot-ch-test-poll4
Copy link
Contributor

robot-ch-test-poll4 commented May 28, 2024

This is an automated comment for commit 84d2bbc 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
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR⏳ pending
Successful checks
Check nameDescriptionStatus
A SyncIf it fails, ask a maintainer for help✅ success
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process✅ 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
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Mergeable CheckChecks if all other necessary checks are successful✅ success
PR CheckThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ 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

@novikd novikd self-assigned this May 28, 2024
Copy link
Member

@novikd novikd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add a test from the issue description.

src/Storages/buildQueryTreeForShard.cpp Outdated Show resolved Hide resolved
@@ -6566,7 +6578,8 @@ ProjectionNames QueryAnalyzer::resolveExpressionNode(QueryTreeNodePtr & node, Id
scope.scope_node->formatASTForErrorMessage());

auto & table_node = node->as<TableNode &>();
result_projection_names.push_back(table_node.getStorageID().getFullNameNotQuoted());
if (result_projection_names.empty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: when can it be non-empty?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the scenario I saw, we can resolve identifier x alias y as TableNode (by alias), and in this case, at first, alias would be added to projection names, and then the storage name.

@alexey-milovidov
Copy link
Member

Cloud does not use GLOBAL IN; backport still makes sense to simplify other backports.

@KochetovNicolai KochetovNicolai added this pull request to the merge queue May 31, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 31, 2024
@KochetovNicolai
Copy link
Member Author

In stress tests, probably we stuck in distributed async inserts.

| | | | | | | | | | | | | | | | | | | | | | | | | | | 14   0x000000001c9aafdf in DB::DistributedAsyncInsertDirectoryQueue::run at /build/src/Storages/Distributed/DistributedAsyncInsertDirectoryQueue.cpp:200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 13   0x000000001c9aab26 in DB::DistributedAsyncInsertDirectoryQueue::processFiles at /build/src/Storages/Distributed/DistributedAsyncInsertDirectoryQueue.cpp:374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x000000001c9af031 in DB::DistributedAsyncInsertDirectoryQueue::processFile at /build/src/Storages/Distributed/DistributedAsyncInsertDirectoryQueue.cpp:430
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x000000001c9c1fe8 in DB::RemoteInserter::onFinish at /build/src/QueryPipeline/RemoteInserter.cpp:127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x000000001d23ef4b in DB::Connection::receivePacket at /build/src/Client/Connection.cpp:1074
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x0000000012d7c0ac in DB::readVarUInt at /build/src/IO/VarInt.h:114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   DB::varint_impl::readVarUInt<true> at /build/src/IO/VarInt.h:95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x0000000012d7c34f in DB::ReadBuffer::eof at /build/src/IO/ReadBuffer.h:106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x000000000afe6a0a in DB::ReadBuffer::next at /build/src/IO/ReadBuffer.h:70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x0000000012f03b6a in DB::ReadBufferFromPocoSocket::nextImpl at /build/src/IO/ReadBufferFromPocoSocket.cpp:81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x0000000022778ead in Poco::Net::SecureStreamSocketImpl::receiveBytes at /build/base/poco/NetSSL_OpenSSL/src/SecureStreamSocketImpl.cpp:139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x00000000227752fd in Poco::Net::SecureSocketImpl::receiveBytes at /build/base/poco/NetSSL_OpenSSL/src/SecureSocketImpl.cpp:350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x0000000022773e7f in Poco::Net::SecureSocketImpl::mustRetry at /build/base/poco/NetSSL_OpenSSL/src/SecureSocketImpl.cpp:480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x00000000227b8b88 in Poco::Net::SocketImpl::pollImpl at /build/base/poco/Net/src/SocketImpl.cpp:436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12   0x00007fb0e76c8bcf in poll () from /lib/x86_64-linux-gnu/libc.so.6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x000000001c9aef76 in DB::DistributedAsyncInsertDirectoryQueue::processFile at /build/src/Storages/Distributed/DistributedAsyncInsertDirectoryQueue.cpp:424
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x000000001c9c1918 in DB::RemoteInserter::RemoteInserter at /build/src/QueryPipeline/RemoteInserter.cpp:59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x000000001d23ef4b in DB::Connection::receivePacket at /build/src/Client/Connection.cpp:1074
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x0000000012d7c0ac in DB::readVarUInt at /build/src/IO/VarInt.h:114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    DB::varint_impl::readVarUInt<true> at /build/src/IO/VarInt.h:95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x0000000012d7c34f in DB::ReadBuffer::eof at /build/src/IO/ReadBuffer.h:106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x000000000afe6a0a in DB::ReadBuffer::next at /build/src/IO/ReadBuffer.h:70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x0000000012f03b6a in DB::ReadBufferFromPocoSocket::nextImpl at /build/src/IO/ReadBufferFromPocoSocket.cpp:81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x0000000022778ead in Poco::Net::SecureStreamSocketImpl::receiveBytes at /build/base/poco/NetSSL_OpenSSL/src/SecureStreamSocketImpl.cpp:139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x00000000227752fd in Poco::Net::SecureSocketImpl::receiveBytes at /build/base/poco/NetSSL_OpenSSL/src/SecureSocketImpl.cpp:350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x0000000022773e7f in Poco::Net::SecureSocketImpl::mustRetry at /build/base/poco/NetSSL_OpenSSL/src/SecureSocketImpl.cpp:480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x00000000227b8b88 in Poco::Net::SocketImpl::pollImpl at /build/base/poco/Net/src/SocketImpl.cpp:436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x00007fb0e76c8bcf in poll () from /lib/x86_64-linux-gnu/libc.so.6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x000000001c9aabbc in DB::DistributedAsyncInsertDirectoryQueue::processFiles at /build/src/Storages/Distributed/DistributedAsyncInsertDirectoryQueue.cpp:377
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x000000001c9af031 in DB::DistributedAsyncInsertDirectoryQueue::processFile at /build/src/Storages/Distributed/DistributedAsyncInsertDirectoryQueue.cpp:430
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x000000001c9c1fe8 in DB::RemoteInserter::onFinish at /build/src/QueryPipeline/RemoteInserter.cpp:127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x000000001d23ef4b in DB::Connection::receivePacket at /build/src/Client/Connection.cpp:1074
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x0000000012d7c0ac in DB::readVarUInt at /build/src/IO/VarInt.h:114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    DB::varint_impl::readVarUInt<true> at /build/src/IO/VarInt.h:95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x0000000012d7c34f in DB::ReadBuffer::eof at /build/src/IO/ReadBuffer.h:106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x000000000afe6a0a in DB::ReadBuffer::next at /build/src/IO/ReadBuffer.h:70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x0000000012f03b6a in DB::ReadBufferFromPocoSocket::nextImpl at /build/src/IO/ReadBufferFromPocoSocket.cpp:81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x0000000022778ead in Poco::Net::SecureStreamSocketImpl::receiveBytes at /build/base/poco/NetSSL_OpenSSL/src/SecureStreamSocketImpl.cpp:139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x00000000227752fd in Poco::Net::SecureSocketImpl::receiveBytes at /build/base/poco/NetSSL_OpenSSL/src/SecureSocketImpl.cpp:350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x0000000022773e7f in Poco::Net::SecureSocketImpl::mustRetry at /build/base/poco/NetSSL_OpenSSL/src/SecureSocketImpl.cpp:480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x00000000227b8b88 in Poco::Net::SocketImpl::pollImpl at /build/base/poco/Net/src/SocketImpl.cpp:436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1    0x00007fb0e76c8bcf in poll () from /lib/x86_64-linux-gnu/libc.so.6

@KochetovNicolai KochetovNicolai added this pull request to the merge queue Jun 3, 2024
Merged via the queue into master with commit 49043d4 Jun 3, 2024
75 of 83 checks passed
@KochetovNicolai KochetovNicolai deleted the fix-some-aliases-for-global-in branch June 3, 2024 13:30
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 3, 2024
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jun 3, 2024
@Felixoid Felixoid removed pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backports-created-cloud labels Jun 7, 2024
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jun 7, 2024
@maxknv maxknv removed the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jun 8, 2024
robot-ch-test-poll4 added a commit that referenced this pull request Jun 10, 2024
…e5fcfb2013eabcf38be007840acdd

Cherry pick #64517 to 24.4: Fixing aliases for GLOBAL IN
robot-ch-test-poll4 added a commit that referenced this pull request Jun 10, 2024
…e5fcfb2013eabcf38be007840acdd

Cherry pick #64517 to 24.5: Fixing aliases for GLOBAL IN
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jun 10, 2024
robot-ch-test-poll4 added a commit that referenced this pull request Jun 10, 2024
Backport #64517 to 24.5: Fixing aliases for GLOBAL IN
@maxknv maxknv removed pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backports-created-cloud labels Jun 12, 2024
novikd added a commit that referenced this pull request Jun 27, 2024
Backport #64517 to 24.4: Fixing aliases for GLOBAL IN
robot-ch-test-poll added a commit that referenced this pull request Jun 27, 2024
…e5fcfb2013eabcf38be007840acdd

Cherry pick #64517 to 24.3: Fixing aliases for GLOBAL IN
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer Issues and pull-requests related to new analyzer 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 pr-synced-to-cloud The PR is synced to the cloud repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logical Error: Expression nodes list expected 1 projection names. Actual 2.
10 participants