ywc88 commented on code in PR #1099:
URL: https://github.com/apache/arrow-adbc/pull/1099#discussion_r1343217432


##########
c/validation/adbc_validation.cc:
##########
@@ -945,6 +945,65 @@ void ConnectionTest::TestMetadataGetObjectsConstraints() {
   // TODO: can't be done portably (need to create tables with primary keys and 
such)
 }
 
+void ConstraintTest(AdbcGetObjectsConstraint* constraint, std::string key_type,

Review Comment:
   Can we use `const` here?
   
   `const AdbcGetObjectsConstraint* constraint, const std::string& key_type, 
const std::vector<std::string>& columns`



##########
c/validation/adbc_validation.cc:
##########
@@ -945,6 +945,65 @@ void ConnectionTest::TestMetadataGetObjectsConstraints() {
   // TODO: can't be done portably (need to create tables with primary keys and 
such)
 }
 
+void ConstraintTest(AdbcGetObjectsConstraint* constraint, std::string key_type,
+                    std::vector<std::string> columns) {
+  std::string_view constraint_type(constraint->constraint_type.data,
+                                   constraint->constraint_type.size_bytes);
+  int number_of_columns = columns.size();
+  ASSERT_EQ(constraint_type, key_type);
+  ASSERT_EQ(constraint->n_column_names, number_of_columns)
+      << "expected constraint " << key_type
+      << " of adbc_fkey_child_test to be applied to " << 
std::to_string(number_of_columns)
+      << " column(s), found: " << constraint->n_column_names;
+
+  int column_index;
+  for (column_index = 0; column_index < number_of_columns; column_index++) {
+    std::string_view constraint_column_name(
+        constraint->constraint_column_names[column_index].data,
+        constraint->constraint_column_names[column_index].size_bytes);
+    ASSERT_EQ(constraint_column_name, columns[column_index]);
+  }
+}
+
+void ForeignKeyColumnUsagesTest(AdbcGetObjectsConstraint* constraint,

Review Comment:
   Same here.



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