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

SNOW-726742 Remove queryID from snowflakeConn #892

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 2 additions & 6 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ type snowflakeConn struct {
cfg *Config
rest *snowflakeRestful
SequenceCounter uint64
QueryID string
SQLState string
telemetry *snowflakeTelemetry
internal InternalClient
}
Expand Down Expand Up @@ -158,8 +156,6 @@ func (sc *snowflakeConn) exec(
sc.cfg.Schema = data.Data.FinalSchemaName
sc.cfg.Role = data.Data.FinalRoleName
sc.cfg.Warehouse = data.Data.FinalWarehouseName
sc.QueryID = data.Data.QueryID
sc.SQLState = data.Data.SQLState
sc.populateSessionParameters(data.Data.Parameters)
return data, err
}
Expand Down Expand Up @@ -282,7 +278,7 @@ func (sc *snowflakeConn) ExecContext(
return &snowflakeResult{
affectedRows: updatedRows,
insertID: -1,
queryID: sc.QueryID,
queryID: data.Data.QueryID,
}, nil // last insert id is not supported by Snowflake
} else if isMultiStmt(&data.Data) {
return sc.handleMultiExec(ctx, data.Data)
Expand Down Expand Up @@ -353,7 +349,7 @@ func (sc *snowflakeConn) queryContextInternal(

rows := new(snowflakeRows)
rows.sc = sc
rows.queryID = sc.QueryID
rows.queryID = data.Data.QueryID

if isMultiStmt(&data.Data) {
// handleMultiQuery is responsible to fill rows with childResults
Expand Down
2 changes: 1 addition & 1 deletion multistatement.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (sc *snowflakeConn) handleMultiExec(
return &snowflakeResult{
affectedRows: updatedRows,
insertID: -1,
queryID: sc.QueryID,
queryID: data.QueryID,
}, nil
}

Expand Down
7 changes: 1 addition & 6 deletions rows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ func TestWithArrowBatchesNotImplementedForResult(t *testing.T) {
if err != nil {
t.Error(err)
}
defer sc.Close()
if err = authenticateWithConfig(sc); err != nil {
t.Error(err)
}
Expand All @@ -474,12 +475,6 @@ func TestWithArrowBatchesNotImplementedForResult(t *testing.T) {
t.Error(err)
}

result.(*snowflakeResult).GetStatus()
queryID := result.(*snowflakeResult).GetQueryID()
if queryID != sc.QueryID {
t.Fatalf("failed to get query ID")
}

_, err = result.(*snowflakeResult).GetArrowBatches()
if err == nil {
t.Fatal("should have raised an error")
Expand Down
Loading