MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / containsList

Function containsList

plugins/destination/duckdb/client/write.go:34–38  ·  view source on GitHub ↗

At time of writing (March 2023), duckdb does not support updating list columns. As a workaround, we delete the row and insert it again. This makes it non-atomic, unfortunately, but this is unavoidable until support is added to duckdb itself. See https://github.com/duckdb/duckdb/blob/c5d9afb97bbf0be1

(sc *schema.Table)

Source from the content-addressed store, hash-verified

32// but this is unavoidable until support is added to duckdb itself.
33// See https://github.com/duckdb/duckdb/blob/c5d9afb97bbf0be12216f3b89ae3131afbbc3156/src/storage/table/list_column_data.cpp#L243-L251
34func containsList(sc *schema.Table) bool {
35 return slices.ContainsFunc(sc.Columns, func(c schema.Column) bool {
36 return duckDBListColumn(c) && !keyListColumn(c)
37 })
38}
39
40func duckDBListColumn(c schema.Column) bool {
41 // Maps also implement arrow.ListLikeType but map to DuckDB json, not a LIST.

Callers 1

WriteTableBatchMethod · 0.85

Calls 2

duckDBListColumnFunction · 0.85
keyListColumnFunction · 0.85

Tested by

no test coverage detected