Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying empty table fails with No snapshots found #108

Open
buremba opened this issue Feb 22, 2025 · 0 comments
Open

Querying empty table fails with No snapshots found #108

buremba opened this issue Feb 22, 2025 · 0 comments

Comments

@buremba
Copy link

buremba commented Feb 22, 2025

I have an empty table where the metadata.json is as follows:

{
  "format-version" : 2,
  "table-uuid" : "06018e7d-c2e2-4446-afce-37b26cd6fa8b",
  "location" : "s3://universql-test",
  "last-sequence-number" : 0,
  "last-updated-ms" : 1740192346580,
  "last-column-id" : 15,
  "current-schema-id" : 0,
  "schemas" : [ {
    "type" : "struct",
    "schema-id" : 0,
    "fields" : [ {
      "id" : 1,
      "name" : "PTS",
      "required" : true,
      "type" : "timestamp"
    }]
  } ],
  "default-spec-id" : 0,
  "partition-specs" : [ {
    "spec-id" : 0,
    "fields" : [ ]
  } ],
  "last-partition-id" : 999,
  "default-sort-order-id" : 0,
  "sort-orders" : [ {
    "order-id" : 0,
    "fields" : [ ]
  } ],
  "properties" : {
    "format-version" : "2"
  },
  "current-snapshot-id" : -1,
  "snapshots" : [ ],
  "snapshot-log" : [ ]
}

When I try to query the file as follows:

CREATE OR REPLACE VIEW universql_demo.table_name AS SELECT * FROM ICEBERG_SCAN('s3://.../metadata.json')

The query fails with IO Error: No snapshots found. Ideally it would be great to return empty table as as per Iceberg spec, snapshots can be added later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant