It's happening when the left table is any non-MergeTree engine, and parallel replicas are applied to the right table.
Steps to reproduce:
https://pastila.nl/?071fe961/348bfa8907696c4c33158b439882c5c0#yhmcsIe8T/lJjbjeT7EgNg==
It yields two plans to join:
left plan:
Expression (Change column names to column identifiers)
Header: __table1.id Int32
Actions: INPUT : 0 -> id Int32 : 0
ALIAS id :: 0 -> __table1.id Int32 : 1
Positions: 1
ReadFromMemoryStorage
Header: id Int32
right plan:
ReadFromRemoteParallelReplicas (query: SELECT `__table1`.`id` AS `id`, `__table2`.`id` AS `b.id` FROM `default`.`xxx` AS `__table1` ALL INNER JOIN `default`.`ttt` AS `__table2` ON `__table1`.`id` = `__table2`.`id`, Replica: 127.0.0.1, Replica: 127.0.0.2, Replica: 127.0.0.3, Replica: 127.0.0.4, Replica: 127.0.0.5, Replica: 127.0.0.6, Replica: 127.0.0.7, Replica: 127.0.0.8, Replica: 127.0.0.9, Replica: 127.0.0.10, Replica: 127.0.0.11)
Header: __table1.id Int32
__table2.id Int32
The plan for the right side has from_stage = WithMergeableState, and moreover, it seems like it is already a joined plan that has two columns for some reason.