Last active
September 13, 2023 05:45
-
-
Save a-agmon/72ab00e41427bc59a771a5daa23f1cb1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type DAO struct { | |
driver DataDriver | |
} | |
// the data we want to load | |
QUsersTable := "CREATE TABLE users AS SELECT name, last_name, cast(age as integer)" | |
+ "FROM read_parquet('%s') " | |
// the parquet files location | |
parquetTablePath := "s3://bucket/prefix/data/" | |
// loading the data to users table in the init | |
func NewStore(driver DataDriver) *DAO { | |
initQuery := fmt.Sprintf(QUsersTable, parquetTablePath) | |
err := driver.Execute(initQuery) | |
if err != nil { | |
panic(err) | |
} | |
return &DAO{driver: driver} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment