lidavidm commented on code in PR #765:
URL: https://github.com/apache/arrow-adbc/pull/765#discussion_r1238835547


##########
adbc.h:
##########
@@ -1380,6 +1827,67 @@ AdbcStatusCode AdbcConnectionGetTableTypes(struct 
AdbcConnection* connection,
                                            struct ArrowArrayStream* out,
                                            struct AdbcError* error);
 
+/// \brief Get a view of types supported by the database.
+///
+/// The result is an Arrow schema with one field per type.  The field name is
+/// the database's name for the type, and the field type is the driver's
+/// mapping of the database type to an Arrow type.

Review Comment:
   So for PostgreSQL, only one timestamptz and one numeric type are listed, 
even though both types are technically parametrized. The driver, implementing 
this call, would also just return `timestamptz = timestamp[us, UTC]` and 
`numeric = decimal256(76, 0)` (the PostgreSQL `numeric` type would actually map 
to...something complicated, but ignore that).
   
   Composite types (structs) have to be [spelled 
out](https://www.postgresql.org/docs/current/rowtypes.html), so each one 
defined in the database would get its own entry here, and the driver should be 
able to reconstruct the child fields.
   
   There is a record type, which wouldn't map cleanly onto anything:
   
   ```
   postgres=# SELECT ROW(1, 2);
     row  
   -------
    (1,2)
   (1 row)
   
   postgres=# SELECT pg_typeof(ROW(1, 2));
    pg_typeof 
   -----------
    record
   (1 row)
   
   postgres=# SELECT ROW(1, 2) UNION ALL (SELECT ROW(1));
     row  
   -------
    (1,2)
    (1)
   (2 rows)
   ```
   
   I suppose we could stipulate that if there is no fixed type mapping for a 
type, the driver can just ignore it in this call.



-- 
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]

Reply via email to