feat(csharp/src/Drivers/Apache): Add support for native metadata queries using statement options#2665
Conversation
…d GetCrossReference
|
@davidhcoe / @CurtHagenlocher - Open to suggestions about option/parameter naming. |
CurtHagenlocher
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround on this! I left a few suggestions, and some merge conflicts will need to be resolved manually.
| public const string ColumnName = "adbc.apache.column_name"; | ||
| public const string ForeignCatalogName = "adbc.apache.foreign_catalog_name"; | ||
| public const string ForeignSchemaName = "adbc.apache.foreign_schema_name"; | ||
| public const string ForeignTableName = "adbc.apache.foreign_table_name"; |
There was a problem hiding this comment.
I wish I had insisted more strongly on a different set of names in the beginning because now we're never going to change them :(. I find it's "just weird" to call these things "adbc.apache" as if the entire project wasn't an Apache project already. They should have been named something like "adbc.hiveserver2".
Anyway, I think we should take a cue from the existing option names for ingestion e.g. adbc.ingest.target_catalog and name these after their semantic purpose, so maybe something like adbc.get_metadata.target_catalog, adbc.get_metadata.target_db_schema, etc. trying to aim for maximum consistency with metadata identifier names that already exist.
There was a problem hiding this comment.
@CurtHagenlocher
Using the pattern adbc.get_metadata.*. Let me know if these names make sense.
…ies using statement options (apache#2665) This feature adds support for making native metadata queries to data source. The caller sets statement options to determine the metadata command and parameters. ### Statement Options | Option | Description | Default | | :--- | :--- | :--- | | `adbc.apache.statement.is_metadata_command` | Indicate that the value of `AdbcStatement.SqlQuery` contains the name of a native metadata command. If set to `True`, it indicates a metadata command query whereas a value of `False` indicates a SQL command query. <br><br>Supported metadata commands include: `GetPrimaryKeys`, `GetCrossReference`, `GetCatalogs`, `GetSchemas`, `GetTables`, and `GetColumns`. | `False` | | `adbc.apache.catalog_name` | The catalog name (or pattern) when used with a metadata command query. <br><br>Supported metadata commands include: `GetPrimaryKeys`, `GetCrossReference`, `GetSchemas`, `GetTables`, and `GetColumns`. | | | `adbc.apache.schema_name` | The schema name (or pattern) when used with a metadata command query. <br><br>Supported metadata commands include: `GetPrimaryKeys`, `GetCrossReference`, `GetSchemas`, `GetTables`, and `GetColumns`. | | | `adbc.apache.table_name` | The table name (or pattern) when used with a metadata command query. <br><br>Supported metadata commands include: `GetPrimaryKeys`, `GetCrossReference`, `GetSchemas`, `GetTables`, and `GetColumns`. | | | `adbc.apache.table_types` | The comma-separated list of table types when used with a metadata command query. <br><br>Supported metadata commands include: `GetTables`. | | | `adbc.apache.column_name` | The column name (or pattern) when used with a metadata command query. <br><br>Supported metadata commands include: `GetColumns`. | | | `adbc.apache.foreign_catalog_name` | The foreign (i.e., child) catalog name (or pattern) when used with a metadata command query. <br><br>Supported metadata commands include: `GetCrossReference`. | | | `adbc.apache.foreign_schema_name` | The foreign (i.e., child) schema name (or pattern) when used with a metadata command query. <br><br>Supported metadata commands include: `GetCrossReference`. | | | `adbc.apache.foreign_table_name` | The foreign (i.e., child) table name (or pattern) when used with a metadata command query. <br><br>Supported metadata commands include: `GetCrossReference`. | |
This feature adds support for making native metadata queries to data source.
The caller sets statement options to determine the metadata command and parameters.
Statement Options
adbc.apache.statement.is_metadata_commandAdbcStatement.SqlQuerycontains the name of a native metadata command. If set toTrue, it indicates a metadata command query whereas a value ofFalseindicates a SQL command query.Supported metadata commands include:
GetPrimaryKeys,GetCrossReference,GetCatalogs,GetSchemas,GetTables, andGetColumns.Falseadbc.apache.catalog_nameSupported metadata commands include:
GetPrimaryKeys,GetCrossReference,GetSchemas,GetTables, andGetColumns.adbc.apache.schema_nameSupported metadata commands include:
GetPrimaryKeys,GetCrossReference,GetSchemas,GetTables, andGetColumns.adbc.apache.table_nameSupported metadata commands include:
GetPrimaryKeys,GetCrossReference,GetSchemas,GetTables, andGetColumns.adbc.apache.table_typesSupported metadata commands include:
GetTables.adbc.apache.column_nameSupported metadata commands include:
GetColumns.adbc.apache.foreign_catalog_nameSupported metadata commands include:
GetCrossReference.adbc.apache.foreign_schema_nameSupported metadata commands include:
GetCrossReference.adbc.apache.foreign_table_nameSupported metadata commands include:
GetCrossReference.