mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 20:12:02 +00:00
Compare aliases for TableNode
This commit is contained in:
parent
831c4dbffd
commit
02239dd9f9
@ -56,7 +56,7 @@ bool TableNode::isEqualImpl(const IQueryTreeNode & rhs, CompareOptions) const
|
||||
{
|
||||
const auto & rhs_typed = assert_cast<const TableNode &>(rhs);
|
||||
return storage_id == rhs_typed.storage_id && table_expression_modifiers == rhs_typed.table_expression_modifiers &&
|
||||
temporary_table_name == rhs_typed.temporary_table_name;
|
||||
temporary_table_name == rhs_typed.temporary_table_name && getAlias() == rhs_typed.getAlias();
|
||||
}
|
||||
|
||||
void TableNode::updateTreeHashImpl(HashState & state, CompareOptions) const
|
||||
|
@ -0,0 +1,6 @@
|
||||
1
|
||||
2
|
||||
3
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
@ -0,0 +1,16 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (x Int32) ENGINE = MergeTree ORDER BY x;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
|
||||
SET allow_experimental_analyzer = 1;
|
||||
|
||||
SELECT t2.x FROM t1 JOIN t1 as t2 ON t1.x = t2.x GROUP BY t1.x; -- { serverError NOT_AN_AGGREGATE }
|
||||
SELECT t2.x FROM t1 as t0 JOIN t1 as t2 ON t1.x = t2.x GROUP BY t1.x; -- { serverError NOT_AN_AGGREGATE }
|
||||
SELECT t2.x FROM t1 as t0 JOIN t1 as t2 ON t0.x = t2.x GROUP BY t0.x; -- { serverError NOT_AN_AGGREGATE }
|
||||
SELECT t2.x FROM t1 JOIN t1 as t2 ON t1.x = t2.x GROUP BY x; -- { serverError NOT_AN_AGGREGATE }
|
||||
SELECT t1.x FROM t1 JOIN t1 as t2 ON t1.x = t2.x GROUP BY t2.x; -- { serverError NOT_AN_AGGREGATE }
|
||||
SELECT x FROM t1 JOIN t1 as t2 ON t1.x = t2.x GROUP BY t2.x; -- { serverError NOT_AN_AGGREGATE }
|
||||
SELECT x FROM t1 JOIN t1 as t2 USING (x) GROUP BY t2.x; -- { serverError NOT_AN_AGGREGATE }
|
||||
|
||||
SELECT t1.x FROM t1 JOIN t1 as t2 ON t1.x = t2.x GROUP BY x ORDER BY ALL;
|
||||
SELECT x, sum(t2.x) FROM t1 JOIN t1 as t2 ON t1.x = t2.x GROUP BY t1.x ORDER BY ALL;
|
Loading…
Reference in New Issue
Block a user