From ef8182949c9b2f9bbe3bb2aab928471a07965d04 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Fri, 1 Aug 2025 13:17:38 +0530 Subject: [PATCH 1/4] feat: enable native Arrow decimal type support in ScanRow Remove blocking condition for decimal types in ScanRow method. The decimal128Container infrastructure is complete and functional, so native decimal scanning now works properly. Only interval types remain unsupported and continue to be blocked. Signed-off-by: Nikhil --- internal/rows/arrowbased/arrowRows.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/rows/arrowbased/arrowRows.go b/internal/rows/arrowbased/arrowRows.go index 4e2cf802..90f00363 100644 --- a/internal/rows/arrowbased/arrowRows.go +++ b/internal/rows/arrowbased/arrowRows.go @@ -216,12 +216,18 @@ func (ars *arrowRowScanner) ScanRow( col := ars.colInfo[i] dbType := col.dbType - if (dbType == cli_service.TTypeId_DECIMAL_TYPE && ars.UseArrowNativeDecimal) || - (isIntervalType(dbType) && ars.UseArrowNativeIntervalTypes) { - // not yet fully supported + // Only block interval types, allow decimals to proceed + if isIntervalType(dbType) && ars.UseArrowNativeIntervalTypes { + // interval types are not yet fully supported ars.Error().Msgf(errArrowRowsUnsupportedNativeType(dbType.String())) return dbsqlerrint.NewDriverError(ars.ctx, errArrowRowsUnsupportedNativeType(dbType.String()), nil) } + // if (dbType == cli_service.TTypeId_DECIMAL_TYPE && ars.UseArrowNativeDecimal) || + // (isIntervalType(dbType) && ars.UseArrowNativeIntervalTypes) { + // // not yet fully supported + // ars.Error().Msgf(errArrowRowsUnsupportedNativeType(dbType.String())) + // return dbsqlerrint.NewDriverError(ars.ctx, errArrowRowsUnsupportedNativeType(dbType.String()), nil) + // } // get the value from the column values holder var err1 error From 2206e58a55035ac58927fbcacb5fd9c6d843a348 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Fri, 1 Aug 2025 13:18:34 +0530 Subject: [PATCH 2/4] test: update test expectations for native decimal support Update 'Error on retrieving not implemented native arrow types' test to expect success for decimal columns (index < 4 instead of < 3). Decimal types now work, only interval types should still error. Signed-off-by: Nikhil --- internal/rows/arrowbased/arrowRows_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/rows/arrowbased/arrowRows_test.go b/internal/rows/arrowbased/arrowRows_test.go index 336186d4..4d41f77a 100644 --- a/internal/rows/arrowbased/arrowRows_test.go +++ b/internal/rows/arrowbased/arrowRows_test.go @@ -886,7 +886,7 @@ func TestArrowRowScanner(t *testing.T) { err := ars.ScanRow(dest, 0) - if i < 3 { + if i < 4 { assert.Nil(t, err) } else { assert.NotNil(t, err) From c936cea88aa02666485d72e39899eb0d4572ef45 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Fri, 1 Aug 2025 14:04:55 +0530 Subject: [PATCH 3/4] cleanup: remove commented code Signed-off-by: Nikhil --- internal/rows/arrowbased/arrowRows.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/rows/arrowbased/arrowRows.go b/internal/rows/arrowbased/arrowRows.go index 90f00363..d39eeaac 100644 --- a/internal/rows/arrowbased/arrowRows.go +++ b/internal/rows/arrowbased/arrowRows.go @@ -222,12 +222,6 @@ func (ars *arrowRowScanner) ScanRow( ars.Error().Msgf(errArrowRowsUnsupportedNativeType(dbType.String())) return dbsqlerrint.NewDriverError(ars.ctx, errArrowRowsUnsupportedNativeType(dbType.String()), nil) } - // if (dbType == cli_service.TTypeId_DECIMAL_TYPE && ars.UseArrowNativeDecimal) || - // (isIntervalType(dbType) && ars.UseArrowNativeIntervalTypes) { - // // not yet fully supported - // ars.Error().Msgf(errArrowRowsUnsupportedNativeType(dbType.String())) - // return dbsqlerrint.NewDriverError(ars.ctx, errArrowRowsUnsupportedNativeType(dbType.String()), nil) - // } // get the value from the column values holder var err1 error From ef93826b720246ace689130ccbdd19449fce4b14 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Fri, 1 Aug 2025 14:45:16 +0530 Subject: [PATCH 4/4] enabled UseArrowNativeDecimal by default Signed-off-by: Nikhil --- internal/config/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/config/config.go b/internal/config/config.go index 09946c91..6db6aaf1 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -448,6 +448,7 @@ func (ucfg ArrowConfig) WithDefaults() ArrowConfig { ucfg.UseArrowBatches = true ucfg.UseArrowNativeTimestamp = true ucfg.UseArrowNativeComplexTypes = true + ucfg.UseArrowNativeDecimal = true return ucfg }