This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE TABLE hits | |
( | |
WatchID BIGINT NOT NULL, | |
JavaEnable SMALLINT NOT NULL, | |
Title TEXT, | |
GoodEvent SMALLINT NOT NULL, | |
EventTime TIMESTAMP NOT NULL, | |
EventDate DATE NOT NULL, | |
CounterID INTEGER NOT NULL, | |
ClientIP INTEGER NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE TABLE hits | |
( | |
WatchID BIGINT NOT NULL, | |
JavaEnable SMALLINT NOT NULL, | |
Title TEXT, | |
GoodEvent SMALLINT NOT NULL, | |
EventTime TIMESTAMP NOT NULL, | |
EventDate DATE NOT NULL, | |
CounterID INTEGER NOT NULL, | |
ClientIP INTEGER NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- TPCH Q18 | |
SELECT c_name, | |
c_custkey, | |
o_orderkey, | |
o_orderdate, | |
o_totalprice, | |
Sum(l_quantity) | |
FROM 'https://pub-0873f8bfe2ba4caa8c1b40c21b39bc10.r2.dev/customer/part-0.parquet' (file_format => 'parquet') AS customer, | |
'https://pub-0873f8bfe2ba4caa8c1b40c21b39bc10.r2.dev/orders/part-0.parquet' (file_format => 'parquet') AS orders, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
http query 1323b708-3b00-4bdd-9ec8-3ecef7faf350: already stopped, reason Ok(()), new reason Err(Code: 1043, displayText = killed by http. | |
<Backtrace disabled by default. Please use RUST_BACKTRACE=1 to enable> ) | |
Log labels | |
fields_message http query 1323b708-3b00-4bdd-9ec8-3ecef7faf350: already stopped, reason Ok(()), new reason Err(Code: 1043, displayText = killed by http. <Backtrace disabled by default. Please use RUST_BACKTRACE=1 to enable> ) | |
job databend-query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Table: | |
``` | |
create table t7861( | |
c1 VARCHAR NULL, | |
c2 VARCHAR NULL, | |
c3 VARCHAR NULL, | |
c4 VARCHAR NULL, | |
c5 VARCHAR NULL, | |
c6 VARCHAR NULL, | |
c7 VARCHAR NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE IF NOT EXISTS tpch; | |
USE tpch; | |
CREATE TABLE IF NOT EXISTS nation ( N_NATIONKEY INTEGER NOT NULL, | |
N_NAME VARCHAR NOT NULL, | |
N_REGIONKEY INT NOT NULL, | |
N_COMMENT VARCHAR); | |
CREATE TABLE IF NOT EXISTS region ( R_REGIONKEY INT NOT NULL, | |
R_NAME VARCHAR NOT NULL, | |
R_COMMENT VARCHAR); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q1: | |
SELECT DayOfWeek, count(*) AS c FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC; | |
Q2: | |
SELECT DayOfWeek, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC; | |
Q3: | |
SELECT Origin, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY Origin ORDER BY c DESC LIMIT 10; | |
Q4: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS ontime ( | |
YEAR NUMBER(38,0), | |
QUARTER NUMBER(38,0), | |
MONTH NUMBER(38,0), | |
DAYOFMONTH NUMBER(38,0), | |
DAYOFWEEK NUMBER(38,0), | |
FLIGHTDATE VARCHAR(16777216), | |
REPORTING_AIRLINE VARCHAR(16777216), | |
DOT_ID_REPORTING_AIRLINE NUMBER(38,0), | |
IATA_CODE_REPORTING_AIRLINE VARCHAR(16777216), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bohu@thinkpad:~/github/cppwork/ClickHouse/build$ ./programs/clickhouse client | |
ClickHouse client version 21.9.1.1. | |
Connecting to localhost:9000 as user default. | |
Connected to ClickHouse server version 21.9.1 revision 54449. | |
thinkpad :) SELECT avg(number) FROM numbers_mt(100000000000) | |
SELECT avg(number) | |
FROM numbers_mt(100000000000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bohu@thinkpad:~/github/cppwork/ClickHouse/build$ ./programs/clickhouse client | |
ClickHouse client version 21.9.1.1. | |
Connecting to localhost:9000 as user default. | |
Connected to datafuse server version 2021.5.0 revision 54405. | |
ClickHouse client version is older than ClickHouse server. It may lack support for new features. | |
datafuse :) SELECT avg(number) FROM numbers_mt(100000000000) | |
SELECT avg(number) |
NewerOlder