Skip to content

Commit da555af

Browse files
committed
Deprecate EnableArrow flag — Arrow always enabled except on AIX/IBM Power
EnableArrow=0 is now ignored on non-AIX platforms. Arrow serialization is always enabled. A deprecation warning is logged when EnableArrow=0 is explicitly set. For JSON inline results with SEA, use EnableQueryResultDownload=0 instead. On AIX (os.name=AIX) or IBM Power (os.arch contains ppc), the flag is still honoured due to Arrow native library issues. Removed the client-type check that forced Thrift when Arrow was disabled — no longer needed since Arrow is always on. Co-authored-by: Isaac Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
1 parent 722d80a commit da555af

4 files changed

Lines changed: 32 additions & 9 deletions

File tree

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
4. **Native geospatial type support (`GEOMETRY` and `GEOGRAPHY`) is now enabled by default.** `getObject()` now returns `IGeometry`/`IGeography` instances instead of EWKT strings. Set `EnableGeoSpatialSupport=0` to restore the previous behavior.
1414

15+
5. **`EnableArrow` connection property is deprecated and ignored.** Arrow serialization is now always enabled. Setting `EnableArrow=0` previously disabled Arrow and forced columnar/JSON inline results; this value is now ignored and a deprecation warning is logged. For JSON inline results with SEA, disable CloudFetch via `EnableQueryResultDownload=0`. The only exception is AIX platforms, where `EnableArrow` is still honoured due to known Arrow native library compatibility issues.
16+
1517
### Added
1618

1719
### Updated

src/main/java/com/databricks/jdbc/api/impl/DatabricksConnectionContext.java

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,6 @@ public DatabricksClientType getClientTypeFromContext() {
505505
remainingMs);
506506
return DatabricksClientType.THRIFT;
507507
}
508-
// Check if Arrow is disabled - Thrift is required for inline mode
509-
if (!Objects.equals(getParameter(DatabricksJdbcUrlParams.ENABLE_ARROW), "1")) {
510-
return DatabricksClientType.THRIFT;
511-
}
512508
// Check if CloudFetch is disabled - Thrift is required for inline mode
513509
if (!isCloudFetchEnabled()) {
514510
return DatabricksClientType.THRIFT;
@@ -669,7 +665,26 @@ public ProxyConfig.ProxyAuthType getCloudFetchProxyAuthType() {
669665

670666
@Override
671667
public Boolean shouldEnableArrow() {
672-
return Objects.equals(getParameter(DatabricksJdbcUrlParams.ENABLE_ARROW), "1");
668+
// Arrow is always enabled unless running on AIX or IBM Power (which have known
669+
// issues with the Arrow native library). The EnableArrow connection property is
670+
// deprecated and its value is ignored on non-AIX/IBM platforms.
671+
String osName = System.getProperty("os.name", "").toLowerCase();
672+
String osArch = System.getProperty("os.arch", "").toLowerCase();
673+
if (osName.contains("aix") || osArch.contains("ppc")) {
674+
// On AIX/IBM Power, honour the user's explicit setting (default is "1" = enabled)
675+
return Objects.equals(getParameter(DatabricksJdbcUrlParams.ENABLE_ARROW), "1");
676+
}
677+
678+
// Log deprecation warning if user explicitly set EnableArrow=0 (ignored)
679+
String explicitValue = getParameterIgnoreDefault(DatabricksJdbcUrlParams.ENABLE_ARROW);
680+
if (explicitValue != null && explicitValue.equals("0")) {
681+
LOGGER.warn(
682+
"EnableArrow=0 is deprecated and ignored. Arrow serialization is always enabled. "
683+
+ "To use JSON inline results with SEA, disable CloudFetch via "
684+
+ "EnableQueryResultDownload=0.");
685+
}
686+
687+
return true;
673688
}
674689

675690
@Override

src/main/java/com/databricks/jdbc/common/DatabricksJdbcUrlParams.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ public enum DatabricksJdbcUrlParams {
5555
DISCOVERY_URL("OAuthDiscoveryURL", "OAuth discovery URL"), // Same as OIDC_DISCOVERY_ENDPOINT
5656
IDENTITY_FEDERATION_CLIENT_ID(
5757
"Identity_Federation_Client_Id", "OAuth Client ID for Token Federation"),
58-
ENABLE_ARROW("EnableArrow", "Enable Arrow", "1"),
58+
ENABLE_ARROW(
59+
"EnableArrow",
60+
"Deprecated: Arrow is always enabled. Value ignored except on AIX. "
61+
+ "Use EnableQueryResultDownload=0 for JSON inline results with SEA.",
62+
"1"),
5963
DIRECT_RESULT("EnableDirectResults", "Enable direct results", "1"),
6064
LZ4_COMPRESSION_FLAG(
6165
"EnableQueryResultLZ4Compression", "Enable LZ4 compression"), // Backward compatibility

src/test/java/com/databricks/jdbc/api/impl/DatabricksConnectionContextTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,11 @@ public void testEnableCloudFetch() throws DatabricksSQLException {
351351
(DatabricksConnectionContext)
352352
DatabricksConnectionContext.parse(TestConstants.VALID_URL_5, properties);
353353
assertTrue(connectionContext.shouldEnableArrow());
354+
// EnableArrow=0 is deprecated and ignored on non-AIX platforms — always returns true
354355
connectionContext =
355356
(DatabricksConnectionContext)
356357
DatabricksConnectionContext.parse(TestConstants.VALID_URL_7, properties);
357-
assertFalse(connectionContext.shouldEnableArrow());
358+
assertTrue(connectionContext.shouldEnableArrow());
358359
}
359360

360361
@Test
@@ -1104,11 +1105,12 @@ public void testClientTypeWhenFeatureFlagNotFound() throws DatabricksSQLExceptio
11041105
"false, 1, 1, 1, true, THRIFT", // Explicit useThriftClient=1 returns THRIFT
11051106
"false, 0, 1, 1, true, SEA", // Explicit useThriftClient=0 returns SEA
11061107
"false, 0, 1, 1, false, SEA", // Explicit useThriftClient=0 returns SEA (ignores flag)
1107-
"false, null, 0, 1, true, THRIFT", // Arrow disabled returns THRIFT
1108+
"false, null, 0, 1, true, SEA", // Arrow param ignored (deprecated) + CloudFetch enabled +
1109+
// flag=true → SEA
11081110
"false, null, 1, 0, true, THRIFT", // CloudFetch disabled returns THRIFT
11091111
"false, null, 1, 1, true, SEA", // All enabled + flag=true returns SEA
11101112
"false, null, 1, 1, false, THRIFT", // All enabled + flag=false returns THRIFT
1111-
"false, null, 0, 0, true, THRIFT", // Both Arrow and CloudFetch disabled returns THRIFT
1113+
"false, null, 0, 0, true, THRIFT", // CloudFetch disabled returns THRIFT (Arrow param ignored)
11121114
})
11131115
public void testClientTypeDecisionMatrix(
11141116
boolean isCluster,

0 commit comments

Comments
 (0)