Skip to content

Bizarre behavior triggered by SHOW TABLES FROM schema #1247

Description

@beachhouse-spec

What happens?

When executing SHOW TABLES FROM iceberg_catalog.demo and demo is a non-existent schema, duckdb_iceberg does not throw an error. Instead, it creates a local schema with the same name purely on the client side without issuing a REST request to create it on the catalog server.

I found that this issue is caused by a combination of duckdb_iceberg optimistically creating unknown schemas, and the special execution logic of SHOW TABLES FROM (which will not enter IcebergSchemaEntry::LookupEntry but IcebergSchemaEntry::Scan preventing the unknown schema entry's exists=false state from being reset).

I'd like to know if this behavior is by design or if it's considered a bug. If it's a bug, I'd be happy to submit a fix for it.

To Reproduce

attch 'iceberg_catalog' as iceberg_catalog (...);
SELECT schema_name FROM information_schema.schemata WHERE catalog_name ='iceberg_catalog';
┌─────────────┐
│ schema_name │
│   varchar   │
├─────────────┤
│ main        │
└─────────────┘
 show tables from demo;
┌─────────┐
│  name   │
│ varchar │
└─────────┘
  0 rows 
SELECT schema_name FROM information_schema.schemata WHERE catalog_name ='iceberg_catalog';
┌─────────────┐
│ schema_name │
│   varchar   │
├─────────────┤
│ demo        │
│ main        │
└─────────────┘

OS:

centos x86_64

DuckDB Version:

v1.6.0

DuckDB Client:

cli

Hardware:

No response

Full Name:

Jade Gong

Affiliation:

Tencent Corporation

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageNeeds to be triaged by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions