@@ -5,10 +5,9 @@ import (
55 "database/sql"
66 "fmt"
77 dbsql "github.com/databricks/databricks-sql-go"
8- "github.com/stretchr/testify/assert "
8+ "log "
99 "os"
1010 "strconv"
11- "testing"
1211 "time"
1312)
1413
@@ -78,20 +77,24 @@ func runTest(withCloudFetch bool, query string) ([]row, error) {
7877 return res , nil
7978}
8079
81- func TestCloudFetch (t * testing.T ) {
82- t .Run ("Compare local batch to cloud fetch" , func (t * testing.T ) {
83- query := "select * from stock_data where date is not null and volume is not null order by date, symbol limit 10000000"
80+ func main () {
81+ query := "select * from stock_data where date is not null and volume is not null order by date, symbol limit 10000000"
8482
85- // Local arrow batch
86- abRes , err := runTest (false , query )
87- assert .NoError (t , err )
83+ // Local arrow batch
84+ abRes , err := runTest (false , query )
85+ if err != nil {
86+ log .Fatal (err )
87+ }
8888
89- // Cloud fetch batch
90- cfRes , err := runTest (true , query )
91- assert .NoError (t , err )
89+ // Cloud fetch batch
90+ cfRes , err := runTest (true , query )
91+ if err != nil {
92+ log .Fatal (err )
93+ }
9294
93- for i := 0 ; i < len (abRes ); i ++ {
94- assert .Equal (t , abRes [i ], cfRes [i ], fmt .Sprintf ("not equal for row: %d" , i ))
95+ for i := 0 ; i < len (abRes ); i ++ {
96+ if abRes [i ] != cfRes [i ] {
97+ log .Fatal (fmt .Sprintf ("not equal for row: %d" , i ))
9598 }
96- })
99+ }
97100}
0 commit comments