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


##########
java/driver/flight-sql/src/main/java/org/apache/arrow/adbc/driver/flightsql/InfoMetadataBuilder.java:
##########
@@ -145,7 +150,12 @@ VectorSchemaRoot build() throws AdbcException {
 
     root.setRowCount(dstIndex);
     VectorSchemaRoot result = root;
-    root = null;
+    try {
+      root = VectorSchemaRoot.create(StandardSchemas.GET_INFO_SCHEMA, 
allocator);

Review Comment:
   The class overall is AutoCloseable, and when it is closed it will clear the 
root. So in this method, we need to "transfer ownership" of the root out. 
Instead of dealing with making the root nullable, I decided to just give it an 
empty root always.



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