Skip to content

feat(format): add generic metadata API - #4694

Open
lidavidm wants to merge 6 commits into
apache:spec-1.2.0from
lidavidm:gh-4400-sandbox
Open

feat(format): add generic metadata API#4694
lidavidm wants to merge 6 commits into
apache:spec-1.2.0from
lidavidm:gh-4400-sandbox

Conversation

@lidavidm

@lidavidm lidavidm commented Aug 17, 2026

Copy link
Copy Markdown
Member
  • Add a generic API for fetching metadata, modeled on ADO.NET's GetSchema
  • Define the standard metadata collections
  • Revert the current revisions to GetObjects in favor of not changing it

Related:

Closes #4400.

@lidavidm

Copy link
Copy Markdown
Member Author

I'm thinking we don't run-length-encode by default to simplify things further.

@lidavidm
lidavidm force-pushed the gh-4400-sandbox branch 2 times, most recently from f4b9198 to e222af1 Compare August 18, 2026 01:22
@lidavidm
lidavidm marked this pull request as ready for review August 27, 2026 02:32
@lidavidm
lidavidm requested a review from zeroshade as a code owner August 27, 2026 02:32

@CurtHagenlocher CurtHagenlocher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting! I've left a few comments and questions resulting from a first, casual review of the code.

/// |--------------------------|------------------------------|----------|
/// | collection_name | utf8 not null | |
/// | collection_description | utf8 | |
/// | collection_schema | extension<arrow.schema_json> | |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposal for this type seems to have stalled :(.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm talking to Kent, hopefully we can keep it going. Otherwise, I may propose an arrow.schema_ipc (even if that's a bit ugly)


/// \brief The "meta" collection returns the available metadata collections.
///
/// | Field Name | Field Type | Comments |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to say that the field types can be logical vs physical e.g. REE- or dictionary-encoded? Or is that always implicit? EDIT: I just saw that the consumer can explicitly ask for this kind of encoding if that's what they want. This doesn't necessarily imply that the producer is otherwise constrained to provide e.g. utf8 instead of utf8_view so I still think it would be value to express that explicitly if it's the case.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should require drivers to stick to the declared type unless requested, I can clarify this

/// \param[out] error An optional location to return an error message if necessary.
///
/// \return ADBC_STATUS_OK on success or an appropriate error code.
ADBC_EXPORT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these other changes/fixes be moved to a separate PR?

///
/// Drivers may add more fields at the end of standard schemas to reflect
/// vendor-specific metadata. Applications must access these using an offset
/// from the end of the schema and cannot assume that the index of the field

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to generally discourage access by ordinal?

/// - ADBC_METADATA_FILTER_PATTERN_COLUMN
#define ADBC_METADATA_COLLECTION_ROUTINE_COLUMNS "routine_columns"

/// \brief The "namespaces" collection returns a level of namespaces defined

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't seem to interact much with the other metadata, or at least I'm having trouble seeing how they would. Do you have an example of a scenario where these matter, and how they would impact e.g. the listing of tables?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I can take this out...I was trying to explore how things might work for databases that don't follow the catalog-schema-table hierarchy, especially now that Iceberg/Iceberg REST Catalog has introduced arbitrarily-nested namespaces into systems. But as mentioned I think we would basically have to duplicate all the metadata collections to support that and it's not worth trying to make them both fit into the same collections.

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

Successfully merging this pull request may close these issues.

2 participants