forked from marcboeker/go-duckdb
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
When using a RowTableSource, unprojected columns are properly handled by SetRowValue:
Lines 22 to 29 in 2ad3914
| func SetRowValue[T any](row Row, colIdx int, val T) error { | |
| projectedIdx := row.projection[colIdx] | |
| if projectedIdx < 0 || projectedIdx >= len(row.chunk.columns) { | |
| return nil | |
| } | |
| vec := row.chunk.columns[projectedIdx] | |
| return setVectorVal(&vec, row.r, val) | |
| } |
However, DataChunk which is exposed to the FillChunk method on ChunkTableSource does not have any knowledge of which columns are projected. This results in errors like invalid column count: expected 1, got 1 when calling chunk.SetValue for too many columns.
Potential solutions:
- Give
DataChunkinternal knowledge about projected column indices and ignore unprojected columns whenSetValueis called. This would mimic theRowtype.- Cons: this field would not be relevant in all use cases of
DataChunkand could cause confusion
- Cons: this field would not be relevant in all use cases of
- Wrap
DataChunkwith a table UDF specific type that handles this- Pros: Doesn't have the con from above
- Cons: Breaking change to table UDFs
Metadata
Metadata
Assignees
Labels
No labels