Skip to content

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

Open
ianton-ru wants to merge 1 commit into
releases/25.8.16from
backports/25.8.16/94359
Open

Backport of #94359 to 25.8.16: Allow positional arguments in distributed queries#1795
ianton-ru wants to merge 1 commit into
releases/25.8.16from
backports/25.8.16/94359

Conversation

@ianton-ru
Copy link
Copy Markdown

@ianton-ru ianton-ru commented May 15, 2026

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 [c5727d8]

@ianton-ru ianton-ru changed the title Merge pull request #94359 from simonmichal/issue-89940 Backport of #94359 to 25.8.16: Allow positional arguments in distributed queries May 15, 2026
@ianton-ru ianton-ru added backport Backport 25.8 25.8 Altinity Stable 25.8.16 25.8.16 Stable labels May 15, 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.16 25.8.16 Stable backport Backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants