apla / node-clickhouse

Yandex ClickHouse driver for nodejs
MIT License
217 stars 50 forks source link

Format option is not correctly applied for SELECT query with WITH clause #56

Closed jirisamek closed 3 years ago

jirisamek commented 4 years ago

Example:

ClickHouse({format: "JSON"}) Query:

WITH sum(bytes) as s
SELECT
    formatReadableSize(s),
    table
FROM system.parts
GROUP BY table
ORDER BY s

Current behaviour:

Execution of the query produces result formatted as plaintext.

Expected behaviour:

Execution of the query produces result formatted JSON.

Workaround:

Explicitly add FROMAT JSON to the query.

WITH sum(bytes) as s
SELECT
    formatReadableSize(s),
    table
FROM system.parts
GROUP BY table
ORDER BY s
FORMAT JSON
evle commented 3 years ago

@nezed same issue here

nezed commented 3 years ago

Fixed with #66