Skip to content

v0.1 Querying Columnstore Outside Postgres

Inspecting mooncake.columnstore_tables and mooncake.data_files in pg_mooncake v0.1 and querying Delta Lake tables from Python Polars.
Legacy pg_mooncake v0.1 Archive (Delta Lake Engine)

This page documents pg_mooncake v0.1, which used direct CREATE TABLE ... USING columnstore DDL and Delta Lake storage. Starting in v0.2 and PGSTY’s v0.3.0 release, pg_mooncake uses moonlink real-time columnstore mirrors (CALL mooncake.create_table + USING mooncake) and Apache Iceberg v2. For current documentation, see Introduction and v0.1 vs v0.2 & v0.3.

Current v0.3.0 Metadata Function

In v0.2 and v0.3.0, use SELECT * FROM mooncake.list_tables(); to inspect table LSNs and Apache Iceberg v2 warehouse locations.

Finding Table Locations (v0.1)

In v0.1, mooncake.columnstore_tables listed the Delta Lake directory path for each USING columnstore table:

SELECT * FROM mooncake.columnstore_tables;

Example output:

    table_name     |                                          path
-------------------+----------------------------------------------------------------------------------------
 users_columnstore | /usr/local/pgsql/data/mooncake_local_tables/mooncake_postgres_users_columnstore_16446/
 events            | s3://my-bucket/mooncake_postgres_events_16459/

Viewing Data Files (v0.1)

SELECT * FROM mooncake.data_files;

Accessing v0.1 Delta Lake Tables with Polars

import polars as pl

local_path = "/usr/local/pgsql/data/mooncake_local_tables/mooncake_postgres_users_columnstore_16446/"
df = pl.scan_delta(local_path)
print(df.collect())