ryan-syed commented on code in PR #1455:
URL: https://github.com/apache/arrow-adbc/pull/1455#discussion_r1449598871
##########
go/adbc/driver/snowflake/connection_test.go:
##########
@@ -276,30 +320,45 @@ func TestPrepareColumnsSQL(t *testing.T) {
tableType := [2]string{"BASE TABLE", "VIEW"}
expected := `SELECT table_type, table_catalog, table_schema,
table_name, column_name,
- ordinal_position,
is_nullable::boolean, data_type, numeric_precision,
- numeric_precision_radix,
numeric_scale, is_identity::boolean,
- identity_generation,
identity_increment,
- character_maximum_length,
character_octet_length, datetime_precision, comment
- FROM
- (
- SELECT T.table_type, C.*
- FROM
-
"DEMO_DB".INFORMATION_SCHEMA.TABLES AS T
- JOIN
-
"DEMO_DB".INFORMATION_SCHEMA.COLUMNS AS C
- ON
- T.table_catalog
= C.table_catalog AND T.table_schema = C.table_schema AND t.table_name =
C.table_name
- UNION ALL
- SELECT T.table_type, C.*
- FROM
-
"DEMOADB".INFORMATION_SCHEMA.TABLES AS T
- JOIN
-
"DEMOADB".INFORMATION_SCHEMA.COLUMNS AS C
- ON
- T.table_catalog
= C.table_catalog AND T.table_schema = C.table_schema AND t.table_name =
C.table_name
- )
- WHERE TABLE_CATALOG ILIKE ?
AND TABLE_SCHEMA ILIKE ? AND TABLE_NAME ILIKE ? AND COLUMN_NAME ILIKE ? AND
TABLE_TYPE IN ('BASE TABLE','VIEW')
- ORDER BY table_catalog,
table_schema, table_name, ordinal_position`
+ ordinal_position, is_nullable::boolean, data_type, numeric_precision,
+ numeric_precision_radix, numeric_scale, is_identity::boolean,
+ identity_generation, identity_increment,
+ character_maximum_length, character_octet_length, datetime_precision,
comment,
+ constraint_name, constraint_type FROM (SELECT T.table_type,
+ C.*,
+ K.constraint_name, K.constraint_type
+ FROM
+ "DEMO_DB".INFORMATION_SCHEMA.TABLES AS T
+ JOIN
+ "DEMO_DB".INFORMATION_SCHEMA.COLUMNS AS C
+ ON
+ T.table_catalog = C.table_catalog
+ AND T.table_schema = C.table_schema
+ AND T.table_name = C.table_name
+ LEFT OUTER JOIN
+ "DEMO_DB".INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS K
+ ON
+ T.table_catalog = K.table_catalog
+ AND T.table_schema = K.table_schema
+ AND T.table_name = K.table_name UNION ALL SELECT
T.table_type,
+ C.*,
+ K.constraint_name, K.constraint_type
Review Comment:
Adding a test similar to
[TestMetadataGetObjectsColumnsXdbc](https://github.com/apache/arrow-adbc/blob/2afbbb7d4d471d21fe20eed976bf4c0b20151732/go/adbc/driver/snowflake/driver_test.go#L409)
will be helpful to verify the table constraints are returned correctly. Adding
tests in the CSharp layer would also work.
--
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]