Skip to content

Instantly share code, notes, and snippets.

@zhzy0077
Created April 12, 2019 10:22
Show Gist options
  • Save zhzy0077/4fd32795691ae7725a323d9a61e55c9d to your computer and use it in GitHub Desktop.
Save zhzy0077/4fd32795691ae7725a323d9a61e55c9d to your computer and use it in GitHub Desktop.
cargo run -- --data-path ../../testing/data/csv/
Finished dev [unoptimized + debuginfo] target(s) in 0.22s
Running `datafusion-cli --data-path ../../testing/data/csv/`
> CREATE EXTERNAL TABLE aggregate_test_100 (
> c1 VARCHAR NOT NULL,
> c2 INT NOT NULL,
> c3 SMALLINT NOT NULL,
> c4 SMALLINT NOT NULL,
> c5 INT NOT NULL,
> c6 BIGINT NOT NULL,
> c7 SMALLINT NOT NULL,
> c8 INT NOT NULL,
> c9 BIGINT NOT NULL,
> c10 VARCHAR NOT NULL,
> c11 FLOAT NOT NULL,
> c12 DOUBLE NOT NULL,
> c13 VARCHAR NOT NULL
> )
> STORED AS CSV
> WITH HEADER ROW
> LOCATION 'aggregate_test_100.csv';
+--------+
| result |
+--------+
| true |
+--------+
1 row in set.
> SELECT c1, COUNT(c2) FROM aggregate_test_100 GROUP BY c1;
+----+-------+
| c1 | COUNT |
+----+-------+
| d | 18 |
+----+-------+
| c | 21 |
+----+-------+
| b | 19 |
+----+-------+
| a | 21 |
+----+-------+
| e | 21 |
+----+-------+
5 rows in set.
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment