Skip to content

Commit

Permalink
SNOW-726742 Remove queryID from snowflakeConn
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pfus committed Aug 23, 2023
1 parent cd116cf commit 25beaf4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
7 changes: 2 additions & 5 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +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 +157,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 +279,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 +350,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

0 comments on commit 25beaf4

Please sign in to comment.