Skip to content

Instantly share code, notes, and snippets.

View arkadius's full-sized avatar

Arek Burdach arkadius

View GitHub Profile
SET 'execution.runtime-mode' = 'batch';
SELECT * FROM product_orders_report ORDER BY report_timestamp desc;
CREATE TABLE product_orders_report
(
report_id BIGINT,
report_timestamp TIMESTAMP,
report_year_month STRING,
product_id BIGINT,
product_quantity_sum BIGINT
) PARTITIONED BY (report_year_month);
CREATE CATALOG nessie_catalog WITH (
'type'='iceberg',
'catalog-impl'='org.apache.iceberg.nessie.NessieCatalog',
'io-impl'='org.apache.iceberg.aws.s3.S3FileIO',
'uri'='http://nessie:19120/api/v2',
'warehouse' = 's3://warehouse',
's3.endpoint'='http://minio:9000'
);
USE CATALOG nessie_catalog;
INSERT INTO products (id, name, product_category, current_prise)
VALUES (1, 'Basic Widget', 0, 9.99),
(2, 'Premium Widget', 1, 19.99),
(3, 'Basic Gadget', 0, 14.99),
(4, 'Premium Gadget', 1, 29.99),
(5, 'Basic Tool', 0, 24.99),
(6, 'Premium Tool', 1, 49.99);
INSERT INTO orders (order_timestamp, order_date, id, customer_id)
VALUES (TO_TIMESTAMP('2024-09-12 14:25:30'), '2024-09-12', 1001, 2001),
CREATE TABLE orders
(
order_timestamp TIMESTAMP,
order_date STRING,
id BIGINT,
customer_id BIGINT
) PARTITIONED BY (order_date);
CREATE TABLE products
(
CREATE TABLE dumb
(
foo STRING
);
CREATE CATALOG nessie_catalog WITH (
'type'='iceberg',
'catalog-impl'='org.apache.iceberg.nessie.NessieCatalog',
'io-impl'='org.apache.iceberg.aws.s3.S3FileIO',
'uri'='http://nessie:19120/api/v2',
'warehouse' = 's3://warehouse',
's3.endpoint'='http://minio:9000'
);
USE CATALOG nessie_catalog;
docker compose exec flink-jobmanager sql-client.sh