Positional Arguments in ClickHouse SQL #6099
-
I am using The ClickHouse SQL ibis generates always seems to use positional arguments in the In ClickHouse Is there a reason import ibis
connection = ibis.clickhouse.connect()
t = connection.table("hello2")
query = t.group_by("aString").aggregate(t["anInt"].sum()).order_by(["aString"])
ibis.show_sql(query) prints SELECT
*
FROM (
SELECT
t0.aString,
SUM(t0.anInt)
FROM default.hello2 AS t0
GROUP BY
1 # if this was t0.aString older version of ClickHouse would be happy
) AS t1
ORDER BY
t1.aString |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I tried digging in the code and make a little hack that "seems" on a tiny test case to do what I want. Changing two lines here from if by:
sel = sel.group_by(*map(str, range(1, len(by) + 1)), dialect="clickhouse") to if group_bys := op.by:
sel = sel.group_by(*map(tr_val_no_alias, group_bys), dialect="clickhouse") seems to create SQL that an older version (as well as all new versions ) of ClickHouse would like.
prints
|
Beta Was this translation helpful? Give feedback.
-
opened feature request: #6101 |
Beta Was this translation helpful? Give feedback.
-
This was addressed in #6106. |
Beta Was this translation helpful? Give feedback.
This was addressed in #6106.