ClickHouse/tests/queries/0_stateless/01278_format_multiple_queries.sh

19 lines
340 B
Bash
Raw Normal View History

2020-05-13 16:31:23 +00:00
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
2020-08-01 00:51:12 +00:00
. "$CURDIR"/../shell_config.sh
2020-05-13 16:31:23 +00:00
set -e
format="$CLICKHOUSE_FORMAT -n"
$format <<EOF
SELECT a, b AS x FROM table AS t
JOIN table2 AS t2 ON (t.id = t2.t_id)
WHERE 1 = 1
;
SELECT a, b AS x,
x == 0 ? a : b
FROM table2 AS t WHERE t.id != 0
EOF