Skip to content

Instantly share code, notes, and snippets.

@a-agmon
Last active September 13, 2023 05:45
Show Gist options
  • Save a-agmon/72ab00e41427bc59a771a5daa23f1cb1 to your computer and use it in GitHub Desktop.
Save a-agmon/72ab00e41427bc59a771a5daa23f1cb1 to your computer and use it in GitHub Desktop.
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