Skip to content

Instantly share code, notes, and snippets.

View marcoslot's full-sized avatar

Marco Slot marcoslot

View GitHub Profile
@marcoslot
marcoslot / example.sql
Last active April 1, 2025 07:59
ESRI pagination in Crunchy Data Warehouse
select load_esri('esri', 'https://map.oshawa.ca/arcgis/rest/services/Operational/OpenData/MapServer/1/query?where=1%3D1&orderByFields=OBJECTID&OutFields=*&f=pjson');
@marcoslot
marcoslot / ais.sql
Last active December 12, 2024 06:19
Load AIS data into Iceberg
-- Load data from https://coast.noaa.gov/htdata/CMSP/AISDataHandler/2024/index.html into Iceberg
--
-- To prepare: create extension crunchy_spatial_analytics cascade;
-- Clean up previous creation
-- drop table if exists ais, loaded_ais_files;
-- Create the AIS Iceberg table
create table ais (
@marcoslot
marcoslot / create-table.sql
Last active July 29, 2024 19:21
Overture in Crunchy Bridge for Analytics
create foreign table addresses ()
server crunchy_lake_analytics
options (path 's3://overturemaps-us-west-2/release/2024-07-22.0/theme=addresses/type=*/*.parquet');
create foreign table base ()
server crunchy_lake_analytics
options (path 's3://overturemaps-us-west-2/release/2024-07-22.0/theme=base/type=*/*.parquet');
create foreign table buildings ()
server crunchy_lake_analytics