diff --git a/flow/e2e/bigquery/peer_flow_bq_test.go b/flow/e2e/bigquery/peer_flow_bq_test.go index 17cd3ecbea..e180e215eb 100644 --- a/flow/e2e/bigquery/peer_flow_bq_test.go +++ b/flow/e2e/bigquery/peer_flow_bq_test.go @@ -81,6 +81,10 @@ func (s PeerFlowE2ETestSuiteBQ) checkJSONValue(tableName, colName, fieldName, va return fmt.Errorf("json value check failed: %v", err) } + if len(res.Records) == 0 { + return fmt.Errorf("bad json: empty result set from %s", tableName) + } + jsonVal := res.Records[0][0].Value if jsonVal != value { return fmt.Errorf("bad json value in field %s of column %s: %v. expected: %v", fieldName, colName, jsonVal, value) diff --git a/flow/e2e/snowflake/qrep_flow_sf_test.go b/flow/e2e/snowflake/qrep_flow_sf_test.go index ad47232b1e..9541d61c86 100644 --- a/flow/e2e/snowflake/qrep_flow_sf_test.go +++ b/flow/e2e/snowflake/qrep_flow_sf_test.go @@ -19,13 +19,15 @@ func (s PeerFlowE2ETestSuiteSF) setupSourceTable(tableName string, numRows int) } func (s PeerFlowE2ETestSuiteSF) checkJSONValue(tableName, colName, fieldName, value string) error { - res, err := s.sfHelper.ExecuteAndProcessQuery(fmt.Sprintf( - "SELECT %s:%s FROM %s;", - colName, fieldName, tableName)) + res, err := s.sfHelper.ExecuteAndProcessQuery(fmt.Sprintf("SELECT %s:%s FROM %s", colName, fieldName, tableName)) if err != nil { return fmt.Errorf("json value check failed: %v", err) } + if len(res.Records) == 0 { + return fmt.Errorf("bad json: empty result set from %s", tableName) + } + jsonVal := res.Records[0][0].Value if jsonVal != value { return fmt.Errorf("bad json value in field %s of column %s: %v. expected: %v", fieldName, colName, jsonVal, value)