Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support user specified batch in DSN #59

Merged
merged 5 commits into from
Oct 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add a default batch_size
  • Loading branch information
weiguoz committed Sep 29, 2019
commit 9772f4a90d14e9155ef94c60189c83450c90ba2c
4 changes: 3 additions & 1 deletion driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
hiveserver2 "sqlflow.org/gohive/hiveserver2/gen-go/tcliservice"
)

const DEFAULT_BATCH_SIZE = 10000

type drv struct{}

func (d drv) Open(dsn string) (driver.Conn, error) {
Expand Down Expand Up @@ -64,7 +66,7 @@ func (d drv) Open(dsn string) (driver.Conn, error) {
return nil, err
}

options := hiveOptions{PollIntervalSeconds: 5, BatchSize: 100000}
options := hiveOptions{PollIntervalSeconds: 5, BatchSize: DEFAULT_BATCH_SIZE}
conn := &hiveConnection{
thrift: client,
session: session.SessionHandle,
Expand Down