Comments (2)
Have you tried running INSTALL parquet; LOAD parquet
beforehand like in https://github.com/marcboeker/go-duckdb/blob/master/duckdb_test.go#L910-L912?
from go-duckdb.
Thanks for the pointer. I am able to follow along the example from the JSON extension and use it for parquet.
import (
"context"
"database/sql"
"database/sql/driver"
"fmt"
"log"
"github.com/marcboeker/go-duckdb"
)
var db *sql.DB
func check(args ...interface{}) {
err := args[len(args)-1]
if err != nil {
panic(err)
}
}
func loadParquet(execer driver.ExecerContext) error {
bootQueries := []string{
"INSTALL 'parquet'",
"LOAD 'parquet'",
}
for _, qry := range bootQueries {
_, err := execer.ExecContext(context.TODO(), qry, nil)
if err != nil {
return err
}
}
return nil
}
type data struct {
c int64
}
func main() {
connector, err := duckdb.NewConnector("", loadParquet)
if err != nil {
fmt.Println("Failed to load Parquet")
log.Fatal(err)
}
db := sql.OpenDB(connector)
if err != nil {
log.Fatal(err)
}
defer db.Close()
check(db.Ping())
rows, err := db.Query(`select count(*) as c from read_parquet('my.parquet');`)
check(err)
defer rows.Close()
for rows.Next() {
c := new(data)
err := rows.Scan(&c.c)
if err != nil {
log.Fatal(err)
}
log.Printf("Count = %d", c.c)
fmt.Println(c.c)
}
}
from go-duckdb.
Related Issues (20)
- Exposing filesystem interface HOT 1
- Make Apache Arrow Optional HOT 2
- Add support for the DATE type in the appender
- Does `go-duckdb` has a glibc version dependency? HOT 4
- Silent primary key violation in the appender HOT 2
- Appending a NULL in UUID[] column panics HOT 1
- found architecture 'arm64', required architecture 'x86_64' on mac os HOT 3
- libduckdb.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64 HOT 2
- Info: Deploying go-duckdb In A Distroless Docker Container
- DuckDB version mismatch in v1.6.5 release HOT 1
- Auto-load / auto-install in go-duckdb? And packaging JSON? HOT 1
- Cannot run duckdb v1.6.6 . Apache arrow lib broken HOT 1
- macos `go run` works but unable to execute the output of `go build` HOT 3
- Proposal: Support better error messages HOT 2
- How to cross-compile an application which uses DuckDB? HOT 2
- how to use duckdb_vss? HOT 2
- Appender performance hangs (> 10 minutes) when flushing HOT 4
- Upgrade arrow from v14 to v15?
- How to solve concurrent read and write without affecting each other,This is a big problem for me, please help me HOT 2
- Appender Not working. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-duckdb.