paleolimbot commented on code in PR #870:
URL: https://github.com/apache/arrow-adbc/pull/870#discussion_r1255832425


##########
c/driver/postgresql/postgresql_test.cc:
##########
@@ -638,6 +638,48 @@ TEST_F(PostgresStatementTest, UpdateInExecuteQuery) {
   }
 }
 
+TEST_F(PostgresStatementTest, BatchSizeHint) {
+  ASSERT_THAT(quirks()->EnsureSampleTable(&connection, "batch_size_hint_test", 
&error),
+              IsOkStatus(&error));
+  ASSERT_THAT(AdbcStatementNew(&connection, &statement, &error), 
IsOkStatus(&error));
+
+  ASSERT_EQ(AdbcStatementSetOption(&statement, 
"adbc.postgresql.batch_size_hint_bytes",
+                                   "-1", nullptr),
+            ADBC_STATUS_INVALID_ARGUMENT);
+  ASSERT_EQ(AdbcStatementSetOption(&statement, 
"adbc.postgresql.batch_size_hint_bytes",
+                                   "not a valid number", nullptr),
+            ADBC_STATUS_INVALID_ARGUMENT);
+
+  ASSERT_THAT(AdbcStatementSetOption(&statement, 
"adbc.postgresql.batch_size_hint_bytes",
+                                     "1", &error),

Review Comment:
   Yes (although because it's a only hint and because it's easier to implement, 
the batch size is approximated as the sum of the sizes of the COPY messages, 
which here would actually be `sizeof(int16_t) + sizeof(int32_t) + 
sizeof(int64_t)`).



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