apache / apache/arrow-adbc

Add additional statement options for Snowflake ADBC Driver

Open
#2,630 6 comments 0 reactions 0 assignees View on GitHub
Type: enhancement
Dominant language
C#
Stars
627
Forks
217
Avg merge
17h
Merged PRs (30d)
57

Description

### What feature or improvement would you like to see?

Can we add INGEST_COLUMNS and INGEST_SELECT_COLUMNS as snowflake options? Both of these would be list types if possible which I think is possible if these are not passed through to the Go connector.

This would modify the Snowflake copy into command to allow for a subset of columns and custom select transformations..

The current use-case I have is that our target Snowflake tables have DEFAULTs applied to some columns which would only kick in if the columns are not included in the the COPY INTO column list.

https://docs.snowflake.com/en/sql-reference/sql/copy-into-table

Columns cannot be repeated in this listing. Any columns excluded from this column list are populated by their default value (NULL, if not specified). However, excluded columns cannot have a sequence as their default value.

```
/* Data load with transformation */
COPY INTO [.] [ ( [ , ... ] ) ]
FROM ( SELECT [.]$[.] [ , [.]$[.] ... ]
FROM { internalStage | externalStage } )
```
Right now we just have a constant for copyQuery..
```
copyQuery = "COPY INTO IDENTIFIER(?) FROM @" + bindStageName + " MATCH_BY_COLUMN_NAME = CASE_INSENSITIVE"
```
https://github.com/apache/arrow-adbc/blob/main/go/adbc/driver/snowflake/bulk_ingestion.go

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.