Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func (c *conn) executeStatement(ctx context.Context, query string, args []driver
TimestampAsArrow: &c.cfg.UseArrowNativeTimestamp,
ComplexTypesAsArrow: &c.cfg.UseArrowNativeComplexTypes,
IntervalTypesAsArrow: &c.cfg.UseArrowNativeIntervalTypes,
GeospatialAsArrow: &c.cfg.UseArrowNativeGeospatial,
}
}

Expand Down
9 changes: 9 additions & 0 deletions connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,15 @@ func WithCloudFetch(useCloudFetch bool) ConnOption {
}
}

// WithArrowNativeGeospatial enables Arrow-native geospatial serialization.
// When true, geometry/geography columns are returned as Struct<srid: Int32, wkb: Binary>
// instead of EWKT strings. Requires Databricks Runtime with SPARK-54232 support.
func WithArrowNativeGeospatial(enable bool) ConnOption {
return func(c *config.Config) {
c.UseArrowNativeGeospatial = enable
}
}

// WithMaxDownloadThreads sets up maximum download threads for cloud fetch. Default is 10.
func WithMaxDownloadThreads(numThreads int) ConnOption {
return func(c *config.Config) {
Expand Down
44 changes: 44 additions & 0 deletions internal/cli_service/cli_service.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@ type ArrowConfig struct {
// the following are currently not supported
UseArrowNativeComplexTypes bool
UseArrowNativeIntervalTypes bool

// UseArrowNativeGeospatial enables Arrow-native geospatial serialization.
// When true, the server returns geometry/geography columns as
// Struct<srid: Int32, wkb: Binary> instead of EWKT strings.
// Requires Databricks Runtime with SPARK-54232 support.
UseArrowNativeGeospatial bool
}

func (ucfg ArrowConfig) WithDefaults() ArrowConfig {
Expand All @@ -465,11 +471,12 @@ func (ucfg ArrowConfig) WithDefaults() ArrowConfig {
// DeepCopy returns a true deep copy of UserConfig
func (arrowConfig ArrowConfig) DeepCopy() ArrowConfig {
return ArrowConfig{
UseArrowBatches: arrowConfig.UseArrowBatches,
UseArrowNativeDecimal: arrowConfig.UseArrowNativeDecimal,
UseArrowNativeTimestamp: arrowConfig.UseArrowNativeTimestamp,
UseArrowNativeComplexTypes: arrowConfig.UseArrowNativeComplexTypes,
UseArrowNativeIntervalTypes: arrowConfig.UseArrowNativeIntervalTypes,
UseArrowBatches: arrowConfig.UseArrowBatches,
UseArrowNativeDecimal: arrowConfig.UseArrowNativeDecimal,
UseArrowNativeTimestamp: arrowConfig.UseArrowNativeTimestamp,
UseArrowNativeComplexTypes: arrowConfig.UseArrowNativeComplexTypes,
UseArrowNativeIntervalTypes: arrowConfig.UseArrowNativeIntervalTypes,
UseArrowNativeGeospatial: arrowConfig.UseArrowNativeGeospatial,
}
}

Expand Down