Skip to content

Commit

Permalink
Fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
JAicewizard committed Sep 22, 2024
1 parent 8c94a4e commit bda27a5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/udtf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ func BindTableUDF(namedArgs map[string]any, args ...interface{}) (duckdb.RowTabl
}, nil
}

func (d *tableUDF) Columns() ([]duckdb.ColumnMetaData, error) {
func (d *tableUDF) Columns() []duckdb.ColumnMetaData {
t, _ := duckdb.NewTypeInfo(duckdb.TYPE_BIGINT)
return []duckdb.ColumnMetaData{
{Name: "result", T: duckdb.NewDuckdbType[int64]()},
}, nil
{Name: "result", T: t},
}
}

func (d *tableUDF) Init() {}
Expand Down Expand Up @@ -56,11 +57,11 @@ func main() {
}
defer db.Close()
conn, _ := db.Conn(context.Background())

t, _ := duckdb.NewTypeInfo(duckdb.TYPE_BIGINT)
fun := duckdb.RowTableFunction{
Config: duckdb.TableFunctionConfig{
Arguments: []duckdb.Type{
duckdb.NewDuckdbType[int64](),
},
Arguments: []duckdb.TypeInfo{t},
},
BindArguments: BindTableUDF,
}
Expand Down

0 comments on commit bda27a5

Please sign in to comment.