ClickHouse TPC-DS (Decision Support Benchmark).
data scale = 1 (1GB of data)
ClickHouse server version 20.3.2.1 revision 54433
1. Working queries out of box or with minor fixes
[*] query required some minor fixes (see related remarks below)
2. Fixable failed queries
Fixes described below will require modification of related template-files or generated queries.
2.1 'Illegal types Float64 and Decimal(9, 2) of arguments of function multiply'
github issue 9881
To fix: need to explicitly cast Float64 to Decimal(7, 2) .
# fail
SELECT toDecimal32(10 , 2 ) > 1 .2 * toDecimal32(3 , 2 );
/* Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: Illegal types Float64 and Decimal(9, 2) of arguments of function multiply. */
# success
SELECT toDecimal32(10 , 2 ) > CAST(1 .2 , ' Decimal(7, 2)' ) * toDecimal32(3 , 2 );
2.2 INTERSECT / EXCEPT operators not implemented
To fix: need to use IN -operator.
# fail
SELECT *
FROM (
SELECT * FROM numbers(2 )
INTERSECT
SELECT * FROM numbers(3 ));
# success
SELECT *
FROM (
SELECT DISTINCT number FROM numbers(2 )
WHERE number IN (SELECT number FROM numbers(3 )));
2.3 [NOT] EXISTS-operator not implemented (to test for the existence of rows)
To fix: need to use count -aggregate.
# fail
SELECT 1
WHERE EXISTS (SELECT NULL );
# success
SELECT 1
WHERE (SELECT count () FROM (SELECT NULL )) > 0 ;
# success
SELECT 1
WHERE (SELECT count () FROM (SELECT 1 WHERE 1 = 0 )) > 0 ;
2.4 Intervals like this '+ 30 days' not supported
To fix: need to use INTERVAL data type.
# fail
SELECT (now() + 30 days);
# success
SELECT (now() + INTERVAL 30 day);
3.1 Memory limit exceeded
Code: 241. DB::Exception: Received from localhost:9000. DB::Exception: Memory limit (for query) exceeded: would use 9.34 GiB (attempt to allocate chunk of 67108864 bytes), maximum: 9.31 GiB.
Remark: when run test under Docker, make sure that the memory limit much more max_memory_usage (see Docker -> Settings -> Advance).
expression's result contains more than 1 row
expression's result used in FROM/WHERE clauses
with customer_total_return as (select .. )
select c_customer_id
from customer_total_return ctr1, /* <-- */
store, customer
where ctr1 .ctr_total_return > (
select ..
from customer_total_return ctr2 /* <-- */
);
expression name precedes the CTE query definition
with customer_total_return as (..)
3.3 OVER(PARTITION BY)-clause not implemented
3.4 RANK OVER(PARTITION BY/ORDER BY)-clause not implemented
3.5 GROUPING aggregate function not implemented
3.6 'Column "x" is not under aggregate function and not in GROUP BY'
Affected queries
query_72.sql (need to add alias in ORDER BY -clause for column d_week_seq
)
3.7.1 'Multiple JOIN do not support asterisks for complex queries yet'
github issue 9853
github issue 10481
3.7.2 'Cannot refer column "x" to table'
github issue 9855
# success
SELECT count ()
FROM numbers(4 ) AS n1, numbers(3 ) AS n2
WHERE n1 .number > (select avg (n .number ) from numbers(3 ) n);
# fail
SELECT count ()
FROM numbers(4 ) AS n1, numbers(3 ) AS n2, numbers(6 ) AS n3
WHERE n1 .number > (select avg (n .number ) from numbers(3 ) n);
/* Code: 352. DB::Exception: Received from localhost:9000. DB::Exception: Cannot refer column 'n.number' to table. */
3.7.3 'Missing columns: "x" while processing query'
github issue 9861
# success
SELECT dummy, name
FROM system .one , system .columns
WHERE (SELECT count () FROM system .columns WHERE name != ' ' ) > 0 AND dummy = 0
LIMIT 1 ;
# fail
SELECT dummy, name
FROM system .one , system .columns
WHERE (SELECT count () FROM system .columns WHERE name != ' ' AND dummy = 0 ) > 0
LIMIT 1 ;
# fail
SELECT o .dummy , name
FROM system .one o, system .columns
WHERE (SELECT count () FROM system .columns WHERE name != ' ' AND o .dummy = 0 ) > 0
LIMIT 1 ;
3.7.4 'COMMA to CROSS JOIN rewriter is not enabled or cannot rewrite query'
github issue 9863
# success
SELECT *
FROM (
SELECT dummy, name
FROM system .one , system .columns ) oc, system .formats ;
SELECT *
FROM (
SELECT dummy, name
FROM system .one , system .columns , system .tables ) oct;
# fail
SELECT *
FROM (
SELECT dummy, name
FROM system .one , system .columns , system .tables ) oct, system .formats ;
3.7.5 'Mix of COMMA and other JOINS is not supported'
github issue 9864
# fail
SELECT *
FROM system .tables , system .one
LEFT OUTER JOIN system .columns ON (dummy = is_in_partition_key);
3.7.6 'Logical error: CROSS JOIN has expressions'
github issue 9910
3.8 'Aggregate function "x" is found inside another aggregate function in query'
github issue 9715
TPC-DS Tools or take already downloaded
Vertica White paper - Benchmarks Prove the Value of an Analytical Database for Big Data
Vertica TPC-DS benchmark performance analysis
tidb-bench