You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mjuarros (via GitHub)" <gi...@apache.org> on 2026/10/07 21:11:13 UTC

[PR] GH-782: Preserve column nullability in Flight SQL JDBC metadata [arrow-java]

mjuarros opened a new pull request, #1335:
URL: https://github.com/apache/arrow-java/pull/1335

   ## What's Changed
   
   - Preserve Arrow field nullability when converting Flight SQL result fields into JDBC column metadata, using the JDBC `columnNullable` and `columnNoNulls` values.
   - Cover nullable and non-nullable columns in both converter tests and the JDBC prepared-statement metadata path.
   
   ## Verification
   
   - `mvn -o -pl :flight-sql-jdbc-core test` (JDK 17): 1,247 tests run, 0 failures, 0 errors, 44 skipped.
   - `mvn -o -pl :flight-sql-jdbc-core -Dtest=ConvertUtilsTest,ArrowFlightPreparedStatementTest -Dsurefire.failIfNoSpecifiedTests=false test` (JDK 17, after formatting): 16 run, 0 failures, 0 errors, 1 pre-existing skip.
   - `mvn -o -pl :flight-sql-jdbc-core spotless:check` (JDK 21): passed.
   - Standalone JDBC smoke check against a local Derby-backed Flight SQL example: `ID=0` (not nullable), `KEYNAME=1` (nullable) from `PreparedStatement.getMetaData()`.
   
   Closes #782.
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-782: Preserve column nullability in Flight SQL JDBC metadata [arrow-java]

Posted by "laurentgo (via GitHub)" <gi...@apache.org>.
laurentgo commented on PR #1335:
URL: https://github.com/apache/arrow-java/pull/1335#issuecomment-6146162876

   > @lidavidm @jbonofre @wgtmac @laurentgo sorry for tagging you all. I need some help with the failing RC/Binaries job it seems the issue is that the Develocity Maven extension is not compatible with the current build environment and I don't think its related to the changes I did, is this a common issue? how can we resolve it? Is it a matter of re-running the job or is there any action item on my end. Thanks for the help in advance.
   
   working on it


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-782: Preserve column nullability in Flight SQL JDBC metadata [arrow-java]

Posted by "mjuarros (via GitHub)" <gi...@apache.org>.
mjuarros commented on PR #1335:
URL: https://github.com/apache/arrow-java/pull/1335#issuecomment-6065036984

   @lidavidm @jbonofre @wgtmac @laurentgo sorry for tagging you all. I need some help with the failing RC/Binaries job it seems the issue is that the Develocity Maven extension is not compatible with the current build environment and I don't think its related to the changes I did, is this a common issue? how can we resolve it? Is it a matter of re-running the job or is there any action item on my end. Thanks for the help in advance.
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-782: Preserve column nullability in Flight SQL JDBC metadata [arrow-java]

Posted by "laurentgo (via GitHub)" <gi...@apache.org>.
laurentgo commented on code in PR #1335:
URL: https://github.com/apache/arrow-java/pull/1335#discussion_r4241240369


##########
flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightPreparedStatementTest.java:
##########
@@ -259,6 +260,29 @@ public void testReturnColumnCount() throws SQLException {
     }
   }
 
+  @Test
+  public void testReturnColumnNullability() throws SQLException {

Review Comment:
   I am wondering if we need a new test case or update an existing query as some of the existing columns while being marked nullable do not contain nullable data, and add the nullability check in one of the existing tests above



##########
flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightPreparedStatementTest.java:
##########
@@ -259,6 +260,29 @@ public void testReturnColumnCount() throws SQLException {
     }
   }
 
+  @Test
+  public void testReturnColumnNullability() throws SQLException {
+    final String query = "SELECT nullable, required FROM nullability_test";
+    final Schema schema =
+        new Schema(
+            Arrays.asList(
+                Field.nullable("nullable", ArrowType.Utf8.INSTANCE),
+                Field.notNullable("required", ArrowType.Utf8.INSTANCE)));
+    PRODUCER.addSelectQuery(query, schema, Collections.emptyList());
+    try (final PreparedStatement psmt = connection.prepareStatement(query)) {
+      assertAll(
+          "Column nullability is as expected",
+          () -> assertThat("nullable", equalTo(psmt.getMetaData().getColumnName(1))),

Review Comment:
   (nit) evaluation order should be swapped (`psmt.getMetadata().[...].equalsTo("nullable")` in order for the description to be accurate in case of an error.
   
   Same for other assertions below



##########
flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/utils/ConvertUtilsTest.java:
##########
@@ -104,6 +106,7 @@ public void testShouldConvertArrowFieldsToColumnMetaDataList() {
                     .setSchemaName("schema1")
                     .setTableName("table1")
                     .setColumnName("col2")
+                    .setNullable(ResultSetMetaData.columnNullable)

Review Comment:
   Maybe `col2` nullability should be changed so both paths are being tests?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-782: Preserve column nullability in Flight SQL JDBC metadata [arrow-java]

Posted by "mjuarros (via GitHub)" <gi...@apache.org>.
mjuarros commented on PR #1335:
URL: https://github.com/apache/arrow-java/pull/1335#issuecomment-6127484153

   Thanks @laurentgo. Addressed the feedback in e2d68e07: col2 is now non-nullable so the converter test covers both paths, the assertion order is fixed, and ResultSet-level nullability is now covered in ResultSetMetadataTest (nullable and non-nullable columns) and ArrowFlightStatementExecuteTest.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-782: Preserve column nullability in Flight SQL JDBC metadata [arrow-java]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #1335:
URL: https://github.com/apache/arrow-java/pull/1335#issuecomment-6046936691

   
   <!-- label_helper_comment -->
   Thank you for opening a pull request!
   
   Please label the PR with one or more of:
   
   - bug-fix
   - chore
   - dependencies
   - documentation
   - enhancement
   
   Also, add the 'breaking-change' label if appropriate.
   
   See [CONTRIBUTING.md](https://github.com/apache/arrow-java/blob/main/CONTRIBUTING.md) for details.
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org