Skip to content

Backport of #94359 to 25.8.16: Allow positional arguments in distributed queries#1820

Merged
zvonand merged 1 commit into
stable-25.8from
backports/25.8.16/94359_2
May 22, 2026
Merged

Backport of #94359 to 25.8.16: Allow positional arguments in distributed queries#1820
zvonand merged 1 commit into
stable-25.8from
backports/25.8.16/94359_2

Conversation

@ianton-ru

Copy link
Copy Markdown

Backport of ClickHouse#94359 by @simonmichal
Allow positional arguments in distributed queries

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):

Allow positional arguments in distributed queries (ClickHouse#94359 by @simonmichal)

Description

In ClickHouse#62289 positional argument substitution was disabled at remote, however in case of a view that can be expanded only in remote this can lead to NOT_AN_AGGREGATE error. This MR enables positional argument substitutions for views.

Tests

Using the reproducer from ClickHouse#89940 :

:) SELECT *
FROM remote('127.0.0.{1|2|3}', currentDatabase(), experiment_by_platform);

SELECT *
FROM remote('127.0.0.{1|2|3}', currentDatabase(), experiment_by_platform)

Query id: c3175e92-73bc-47c4-99cb-0a4235a0d76c

   ┌─sector──┐
1. │ tech    │
2. │ finance │
3. │ health  │
   └─────────┘

3 rows in set. Elapsed: 0.027 sec.

Making sure fix from ClickHouse#62289 is still working:

:) select 0 as x
from remote('127.0.0.{1|2|3}', system.one)
group by x

SELECT 0 AS x
FROM remote('127.0.0.{1|2|3}', system.one)
GROUP BY x

Query id: 846db696-6be2-470d-825b-6cf3deb90a67

   ┌─x─┐
1. │ 0 │
   └───┘

1 row in set. Elapsed: 0.010 sec.

Comment for reviewer

Changes in src/Processors/QueryPlan/ParallelReplicasLocalPlan.cpp are reduced comparing with original PR.

new_context->setSetting("enable_positional_arguments", Field(false));

is replaced on

new_context->setPositionalArgumentsAlreadyResolved(true);

but in 25.8 code includes only one such place.
Others were added later, in ClickHouse#88696 and ClickHouse@7c8d833 (I did not find proper PR with this commit, so link only on the commit)

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

Allow positional arguments in distributed queries
@github-actions

Copy link
Copy Markdown

Workflow [PR], commit [013e40f]

@zvonand zvonand merged commit 34590f8 into stable-25.8 May 22, 2026
170 of 181 checks passed
@zvonand zvonand added the verified Approved for release label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

25.8 25.8 Altinity Stable 25.8.24.10001 backport Backport verified Approved for release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants