paleolimbot commented on code in PR #4031:
URL: https://github.com/apache/arrow-adbc/pull/4031#discussion_r2893744933
##########
c/include/arrow-adbc/adbc.h:
##########
@@ -1858,6 +1858,96 @@ AdbcStatusCode AdbcConnectionGetObjects(struct
AdbcConnection* connection, int d
struct ArrowArrayStream* out,
struct AdbcError* error);
+/// \brief Get a hierarchical view of all functions and procedures.
+///
+/// The result is an Arrow dataset with the following schema:
+///
+/// | Field Name | Field Type |
+/// |--------------------------|-------------------------|
+/// | catalog_name | utf8 |
+/// | catalog_db_schemas | list<DB_SCHEMA_SCHEMA> |
+///
+/// DB_SCHEMA_SCHEMA is a Struct with fields:
+///
+/// | Field Name | Field Type |
+/// |--------------------------|-------------------------|
+/// | db_schema_name | utf8 |
+/// | db_schema_routines | list<ROUTINE_SCHEMA> |
+///
+/// ROUTINE_SCHEMA is a Struct with fields:
+///
+/// | Field Name | Field Type | Comments |
+/// |--------------------------|-------------------------|----------|
+/// | routine_name | utf8 not null | |
+/// | routine_specific_name | utf8 not null | (1) |
+/// | routine_type | utf8 not null | (2) |
+/// | routine_remarks | utf8 | (3) |
+/// | routine_parameters | list<PARAMETER_SCHEMA> | (4) |
+/// | routine_result | list<PARAMETER_SCHEMA> | (4) |
+/// | routine_parameter_schema | binary | (5) |
+/// | routine_result_schema | binary | (5) |
+///
+/// 1. A name that uniquely identifies the routine, to disambiguate
+/// overloads.
+/// 2. 'FUNCTION', 'PROCEDURE', or a vendor-specific name (e.g. 'TABLE
+/// FUNCTION').
+/// 3. Vendor-specific description of the routine.
+/// 4. Metadata about the accepted parameters and return values as structured
+/// Arrow data. Only populated if include_columns is set, otherwise null.
+/// 5. Metadata about the accepted parameters and return values as an Arrow
+/// schema, serialized as an IPC message containing a schema Flatbuffers
+/// structure. Only populated if include_arrow_schema is set, otherwise
+/// null.
Review Comment:
> I'm not sure that metadata is necessarily commonly exposed
Yes, this is probably unique to systems where the driver is the database
(and decimals have type-level precision/scale). It is roughly what is needed to
do syntax checking on SQL expressions although can be approximated by a fixed
list of overloads of coarser types.
Maybe if a fully serialized vendor/driver-specific type (e.g., what would
appear in CREATE TABLE) were available in the parameter schema and we had a
function to convert that to an arrow type? (The function that can do the
reverse of that would be #3793 I think)
Or you can ignore me and funnel Arrow IPC via the Arrow C Data interface 🙂
(I just think it's a shame we never agreed on a string representation of a data
type that would make this cleaner)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]