This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new e0dfcea29 test(java/driver/jni): update mssql driver version (#4357)
e0dfcea29 is described below

commit e0dfcea2989a68342093e17f50f5ea79c3a2dcbd
Author: David Li <[email protected]>
AuthorDate: Wed Jun 3 18:41:29 2026 -0700

    test(java/driver/jni): update mssql driver version (#4357)
---
 .github/workflows/java.yml                         |  8 +--
 .../adbc/driver/jni/SqlServerIntegrationTest.java  | 61 +++++++++++++++-------
 2 files changed, 45 insertions(+), 24 deletions(-)

diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml
index 71ec92d69..f2a3f0a20 100644
--- a/.github/workflows/java.yml
+++ b/.github/workflows/java.yml
@@ -239,11 +239,11 @@ jobs:
       - name: Download thirdparty driver
         if: matrix.os == 'Linux' && matrix.arch == 'amd64'
         run: |
-          wget 
https://dbc-cdn.columnar.tech/mssql/v1.3.1/mssql_linux_amd64_v1.3.1.tar.gz
-          echo 
"e6723cf417403f313fb75c1ac03aea9b9ff857d4a947608c8ae44eacc1aa22b3  
mssql_linux_amd64_v1.3.1.tar.gz" > mssql_linux_amd64_v1.3.1.tar.gz.sha256
-          sha256sum -c mssql_linux_amd64_v1.3.1.tar.gz.sha256
+          wget 
https://dbc-cdn.columnar.tech/mssql/v1.4.0/mssql_linux_amd64_v1.4.0.tar.gz
+          echo 
"89371ba78ffa8d5037d2a4d5331bc8f125598774e1da6e5b46b3af45a34e288b  
mssql_linux_amd64_v1.4.0.tar.gz" > mssql_linux_amd64_v1.4.0.tar.gz.sha256
+          sha256sum -c mssql_linux_amd64_v1.4.0.tar.gz.sha256
 
-          tar xvf mssql_linux_amd64_v1.3.1.tar.gz
+          tar xvf mssql_linux_amd64_v1.4.0.tar.gz
           mkdir -p ~/.config/adbc/drivers/
           mv libadbc_driver_mssql.so ~/.config/adbc/drivers/
           echo "manifest_version = 1" > ~/.config/adbc/drivers/mssql.toml
diff --git 
a/java/driver/jni-validation/src/test/java/org/apache/arrow/adbc/driver/jni/SqlServerIntegrationTest.java
 
b/java/driver/jni-validation/src/test/java/org/apache/arrow/adbc/driver/jni/SqlServerIntegrationTest.java
index 2355484bd..57caaa51a 100644
--- 
a/java/driver/jni-validation/src/test/java/org/apache/arrow/adbc/driver/jni/SqlServerIntegrationTest.java
+++ 
b/java/driver/jni-validation/src/test/java/org/apache/arrow/adbc/driver/jni/SqlServerIntegrationTest.java
@@ -21,7 +21,10 @@ import static 
org.apache.arrow.adbc.driver.testsuite.ArrowAssertions.assertSchem
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
+import java.io.File;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -55,6 +58,7 @@ import org.junit.jupiter.api.Assumptions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 class SqlServerIntegrationTest {
   public static final String URI_ENV = "ADBC_MSSQL_TEST_URI";
@@ -91,6 +95,27 @@ class SqlServerIntegrationTest {
     allocator.close();
   }
 
+  @Test
+  void profile(@TempDir Path tempDir) throws Exception {
+    File profile = tempDir.resolve("myprofile.toml").toFile();
+    Files.writeString(
+        profile.toPath(),
+        String.format("profile_version = 
1\ndriver=\"mssql\"\n[Options]\nuri=\"%s\"\n", URI));
+
+    Map<String, Object> parameters = new HashMap<>();
+    JniDriver.PARAM_PROFILE.set(parameters, "myprofile");
+    JniDriver.PARAM_PROFILE_SEARCH_PATH.set(parameters, 
tempDir.toAbsolutePath().toString());
+    try (final var db = driver.open(parameters);
+        final var conn = db.connect();
+        final var stmt = conn.createStatement()) {
+      stmt.setSqlQuery("SELECT 1");
+      try (var result = stmt.executeQuery()) {
+        assertThat(result.getReader().loadNextBatch()).isTrue();
+        
assertThat(result.getReader().getVectorSchemaRoot().getVector(0).getObject(0)).isEqualTo(1);
+      }
+    }
+  }
+
   @Test
   void simple() throws Exception {
     try (var stmt = conn.createStatement()) {
@@ -179,11 +204,8 @@ class SqlServerIntegrationTest {
         "CREATE TABLE test_schema.foobar (a INT)",
         "CREATE TABLE foobar (b VARCHAR)");
 
-    // XXX: this appears to get the wrong table
-    // assertSchema(conn.getTableSchema(null, "test_schema", "foobar"))
-    //     .isEqualTo(new Schema(List.of(Field.nullable("a", 
Types.MinorType.INT.getType()))));
-    assertSchema(conn.getTableSchema(null, null, "foobar"))
-        .isEqualTo(new Schema(List.of(Field.nullable("b", 
Types.MinorType.VARCHAR.getType()))));
+    assertSchema(conn.getTableSchema(null, "test_schema", "foobar"))
+        .isEqualTo(new Schema(List.of(Field.nullable("a", 
Types.MinorType.INT.getType()))));
   }
 
   @Test
@@ -200,7 +222,7 @@ class SqlServerIntegrationTest {
     assertThat(e.getStatus()).isEqualTo(AdbcStatusCode.NOT_FOUND);
 
     e = assertThrows(AdbcException.class, () -> conn.setReadOnly(true));
-    assertThat(e.getStatus()).isEqualTo(AdbcStatusCode.INVALID_ARGUMENT);
+    assertThat(e.getStatus()).isEqualTo(AdbcStatusCode.NOT_IMPLEMENTED);
   }
 
   @Test
@@ -364,7 +386,7 @@ class SqlServerIntegrationTest {
 
     AdbcException e = assertThrows(AdbcException.class, () -> 
conn.setCurrentCatalog("foobar"));
     assertThat(e).hasMessageContaining("Database 'foobar' does not exist");
-    assertThat(e.getStatus()).isEqualTo(AdbcStatusCode.INTERNAL);
+    assertThat(e.getStatus()).isEqualTo(AdbcStatusCode.NOT_FOUND);
 
     // MSSQL does not let you change the search path
     e = assertThrows(AdbcException.class, () -> 
conn.setCurrentDbSchema("test_schema"));
@@ -558,22 +580,21 @@ class SqlServerIntegrationTest {
       vsr.setRowCount(3);
       stmt.bind(vsr);
 
-      // XXX: appears to be a leak in the driver
-      // AdbcStatement.UpdateResult result = stmt.executeUpdate();
-      // assertThat(result.getAffectedRows()).isEqualTo(3);
+      AdbcStatement.UpdateResult result = stmt.executeUpdate();
+      assertThat(result.getAffectedRows()).isEqualTo(3);
 
-      // iv.setSafe(0, 100);
-      // biv.setSafe(0, 3);
-      // vsr.setRowCount(1);
+      iv.setSafe(0, 100);
+      biv.setSafe(0, 3);
+      vsr.setRowCount(1);
 
-      // result = stmt.executeUpdate();
-      // assertThat(result.getAffectedRows()).isEqualTo(1);
+      result = stmt.executeUpdate();
+      assertThat(result.getAffectedRows()).isEqualTo(1);
 
-      // stmt.setSqlQuery("SELECT i FROM foobar ORDER BY j ASC");
-      // try (AdbcStatement.QueryResult queryResult = stmt.executeQuery()) {
-      //   var values = ArrowToJava.toIntegers(queryResult.getReader(), "i");
-      //   assertThat(values).containsExactly(1, 42, null, 100);
-      // }
+      stmt.setSqlQuery("SELECT i FROM foobar ORDER BY j ASC");
+      try (AdbcStatement.QueryResult queryResult = stmt.executeQuery()) {
+        var values = ArrowToJava.toIntegers(queryResult.getReader(), "i");
+        assertThat(values).containsExactly(1, 42, null, 100);
+      }
     }
   }
 

Reply via email to