ClickHouse/tests/queries/0_stateless/02552_client_format_settings.sql
Azat Khuzhin 911fabd0dc Fix applying settings for FORMAT on the client
Previously the following query does not works correctly:

    SELECT number FROM numbers(5) SETTINGS output_format_json_array_of_rows = 1 FORMAT JSONEachRow

While this one works OK:

    SELECT number FROM numbers(5) FORMAT JSONEachRow SETTINGS output_format_json_array_of_rows = 1

The problem is in which AST those settings are stored, use the logic as
executeQuery() has to apply them:

  c83f701696/src/Interpreters/executeQuery.cpp (L467-L497)

Note, the only problem should be with the settings for FORMAT, since
client applies thoes settings (and formats) locally w/o server, while in
case of i.e. HTTP it will be applied on the server and everything will
works fine.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-07 18:29:40 +01:00

6 lines
272 B
SQL

-- Test from https://github.com/ClickHouse/ClickHouse/issues/45880
-- { echo }
SELECT number FROM numbers(5) SETTINGS output_format_json_array_of_rows = 1 FORMAT JSONEachRow;
SELECT number FROM numbers(5) FORMAT JSONEachRow SETTINGS output_format_json_array_of_rows = 1;