Skip to content

Remote initiator global JOIN without analyzer fails with 'No alias for subquery or table function in JOIN' after #2228 #2748

Open

Description

@alsugiliazova

✅ I checked the Altinity Stable Builds lifecycle table, and the Altinity Stable Build version I'm using is still supported.

Type of problem

Bug report - something's broken

Describe the situation

#2228 ("Remove object_storage_cluster_join_mode=local") says that object_storage_cluster_join_mode='global' now works with the old analyzer, and it rewrote test_remote_initiator_global_join_without_analyzer to expect a result. The query fails instead. When object_storage_remote_initiator=1 and allow_experimental_analyzer=0, the query that the initiator sends to the remote node is rejected with Code: 206 ... No alias for subquery or table function in JOIN.

This issue:

  • Fails test_storage_iceberg_with_spark/test_remote_initiator.py::test_remote_initiator_global_join_without_analyzer[s3]
  • Reproduces on every build type that runs integration tests (amd_tsan, amd_asan_ubsan, arm_binary) on every run since the merge, so it is deterministic
  • Was not caught on the PR because Remove object_storage_cluster_join_mode=local #2228 excluded the ARM and all sanitizer jobs, which skipped every integration job

How to reproduce the behavior

Environment

  • Version: 26.6.8.20003.altinityantalya (also every antalya-26.6 build since 2026-10-26)
  • Build type: any

Steps

cd tests/integration
./runner 'test_storage_iceberg_with_spark/test_remote_initiator.py::test_remote_initiator_global_join_without_analyzer'

The query the test runs, where t1 is an Iceberg table and t2 is a Memory table:

SELECT t1.tag, t1.number, t2.number2
FROM <iceberg_table> AS t1
JOIN <memory_table> AS t2 USING (tag)
SETTINGS
    object_storage_remote_initiator = 1,
    object_storage_remote_initiator_cluster = 'cluster_simple',
    object_storage_cluster_join_mode = 'global',
    allow_experimental_analyzer = 0

Expected behavior

Returns 1 1 2.


Actual behavior

E   helpers.client.QueryRuntimeException: Client failed! Return code: 206, stderr: Received exception from server (version 26.6.8):
E   Code: 206. DB::Exception: Received from 172.16.1.10:9000. DB::Exception: No alias for subquery or table function in JOIN
    (set joined_subquery_requires_alias=0 to disable restriction).
    While processing ' remote('node1:9000', icebergS3('http://minio1:9001/root/.../', 'minio', '[HIDDEN]', 'Parquet', '`tag` Nullable(Int32), `number` Nullable(Int32)') AS t1)'. Stack trace:

5. src/Interpreters/JoinedTables.cpp:277:23: DB::JoinedTables::resolveTables()
6. src/Interpreters/InterpreterSelectQuery.cpp:701:37: DB::InterpreterSelectQuery::InterpreterSelectQuery(...)
9. src/Storages/StorageDistributed.cpp:1378:18: DB::StorageDistributed::read(...)
10. src/Storages/IStorageCluster.cpp:641:34: DB::IStorageCluster::readFromRemoteInitiator(...)
11. src/Storages/IStorageCluster.cpp:701:9: DB::IStorageCluster::read(...)

Root cause analysis

In the old-analyzer path, IStorageCluster::readFromRemoteInitiator rewrites the left table expression into a remote(...) table function, but it attaches the alias to the inner table function:

remote('node1:9000', icebergS3(...) AS t1)

The alias should be on the outer table expression (remote(...) AS t1). In the query that the remote node receives, the JOIN's left side therefore has no alias, and JoinedTables::resolveTables rejects it under joined_subquery_requires_alias=1. That rewrite logic is in the ~450 lines #2228 changed in src/Storages/IStorageCluster.cpp.

Before #2228, this combination returned an explicit error (object_storage_cluster_join_mode!='allow' is not supported without allow_experimental_analyzer=true), and the test asserted that error. The PR replaced the guard with the new path and updated the test, but the test never ran on the PR.


Additional context

CI failure

Timeline on antalya-26.6 MasterCI

Related PR

Activity

  1. added
    bug
    swarms
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    antalya-26.6antalya-26.6.8.20003bugswarms

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions