Skip to content

Read a type that a schema set names but the data lacks as an empty table #2997

Backlog

Description

@piotrszul

Follow-up to #2881 (Load FHIR resources with a schema defined up front).

Problem

With a defined schema set, a resource type that the set names but the data lacks keeps today's behaviour: the source does not list it, reading it is an error, and a sink writes nothing for it.

For example, the schema set covers Patient, Observation and Condition, but today's NDJSON drop has no Condition records. No Condition table is written, so a downstream consumer that queries it fails with "table not found" until the first Condition arrives. A stream's table likewise exists only after its first batch that holds that type.

This is the same problem #2881 solves for missing elements, but for missing tables.

Proposal

When a schema set names a type that the data lacks, the read returns an empty dataset with that type's defined schema. A sink then writes an empty table with the schema, so every table in the set exists from the first write, streams included.

Open questions

  • Whether this applies to every source, or only to file and bulk sources, where "absent" means no files.
  • How resourceTypes() lists such a type.

Activity

  1. added
    PoF_line
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PoF_line

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions