jasonlin45 commented on code in PR #3325:
URL: https://github.com/apache/arrow-adbc/pull/3325#discussion_r2449207458


##########
go/adbc/driver/databricks/cloudfetch_e2e_test.go:
##########
@@ -0,0 +1,494 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package databricks_test
+
+import (
+       "context"
+       "testing"
+       "time"
+
+       "github.com/apache/arrow-adbc/go/adbc/driver/databricks"
+       "github.com/apache/arrow-adbc/go/adbc/validation"
+       "github.com/apache/arrow-go/v18/arrow/memory"
+       "github.com/stretchr/testify/assert"
+       "github.com/stretchr/testify/require"
+)
+
+// TestCloudFetchE2E_BasicConnection tests basic connectivity
+// CloudFetch is handled automatically by the databricks-sql-go driver
+func TestCloudFetchE2E_BasicConnection(t *testing.T) {
+       host, token, httpPath, catalog, schema := getDatabricksConfig(t)
+
+       driver := databricks.NewDriver(memory.DefaultAllocator)
+
+       opts := map[string]string{
+               databricks.OptionServerHostname: host,
+               databricks.OptionHTTPPath:       httpPath,
+               databricks.OptionAccessToken:    token,
+               databricks.OptionCatalog:        catalog,
+               databricks.OptionSchema:         schema,
+       }
+
+       db, err := driver.NewDatabase(opts)
+       require.NoError(t, err)
+       defer validation.CheckedClose(t, db)
+
+       ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
+       defer cancel()
+
+       conn, err := db.Open(ctx)
+       require.NoError(t, err)
+       defer validation.CheckedClose(t, conn)
+
+       // Execute a simple query to verify connection works
+       stmt, err := conn.NewStatement()
+       require.NoError(t, err)
+       defer validation.CheckedClose(t, stmt)
+
+       err = stmt.SetSqlQuery("SELECT 1 as test")
+       require.NoError(t, err)
+
+       reader, _, err := stmt.ExecuteQuery(ctx)
+       require.NoError(t, err)
+       defer reader.Release()
+
+       assert.True(t, reader.Next(), "Expected at least one record")
+       t.Logf("✅ Connection successful (CloudFetch handled automatically by 
driver)")

Review Comment:
   Removed in 
[b59fc7f](https://github.com/apache/arrow-adbc/pull/3325/commits/b59fc7fea23c01bc35d724ec8edb6a0b660003cb)



##########
go/adbc/driver/databricks/cloudfetch_e2e_test.go:
##########
@@ -0,0 +1,494 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package databricks_test
+
+import (
+       "context"
+       "testing"
+       "time"
+
+       "github.com/apache/arrow-adbc/go/adbc/driver/databricks"
+       "github.com/apache/arrow-adbc/go/adbc/validation"
+       "github.com/apache/arrow-go/v18/arrow/memory"
+       "github.com/stretchr/testify/assert"
+       "github.com/stretchr/testify/require"
+)
+
+// TestCloudFetchE2E_BasicConnection tests basic connectivity
+// CloudFetch is handled automatically by the databricks-sql-go driver
+func TestCloudFetchE2E_BasicConnection(t *testing.T) {
+       host, token, httpPath, catalog, schema := getDatabricksConfig(t)
+
+       driver := databricks.NewDriver(memory.DefaultAllocator)
+
+       opts := map[string]string{
+               databricks.OptionServerHostname: host,
+               databricks.OptionHTTPPath:       httpPath,
+               databricks.OptionAccessToken:    token,
+               databricks.OptionCatalog:        catalog,
+               databricks.OptionSchema:         schema,
+       }
+
+       db, err := driver.NewDatabase(opts)
+       require.NoError(t, err)
+       defer validation.CheckedClose(t, db)
+
+       ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
+       defer cancel()
+
+       conn, err := db.Open(ctx)
+       require.NoError(t, err)
+       defer validation.CheckedClose(t, conn)
+
+       // Execute a simple query to verify connection works
+       stmt, err := conn.NewStatement()
+       require.NoError(t, err)
+       defer validation.CheckedClose(t, stmt)
+
+       err = stmt.SetSqlQuery("SELECT 1 as test")
+       require.NoError(t, err)
+
+       reader, _, err := stmt.ExecuteQuery(ctx)
+       require.NoError(t, err)
+       defer reader.Release()
+
+       assert.True(t, reader.Next(), "Expected at least one record")
+       t.Logf("✅ Connection successful (CloudFetch handled automatically by 
driver)")
+}
+
+// TestCloudFetchE2E_SmallQueries tests CloudFetch with small result sets
+func TestCloudFetchE2E_SmallQueries(t *testing.T) {
+       host, token, httpPath, _, _ := getDatabricksConfig(t)
+
+       queries := []struct {
+               name     string
+               query    string
+               rowCount int
+       }{
+               {
+                       name:     "range_100",
+                       query:    "SELECT * FROM range(100)",
+                       rowCount: 100,
+               },
+               {
+                       name:     "range_1000",
+                       query:    "SELECT * FROM range(1000)",
+                       rowCount: 1000,
+               },
+               {
+                       name:     "range_10000",
+                       query:    "SELECT * FROM range(10000)",
+                       rowCount: 10000,
+               },
+       }
+
+       for _, q := range queries {
+               t.Run(q.name, func(t *testing.T) {
+                       driver := databricks.NewDriver(memory.DefaultAllocator)
+
+                       opts := map[string]string{
+                               databricks.OptionServerHostname: host,
+                               databricks.OptionHTTPPath:       httpPath,
+                               databricks.OptionAccessToken:    token,
+                       }
+
+                       db, err := driver.NewDatabase(opts)
+                       require.NoError(t, err)
+                       defer validation.CheckedClose(t, db)
+
+                       ctx, cancel := 
context.WithTimeout(context.Background(), 60*time.Second)
+                       defer cancel()
+
+                       conn, err := db.Open(ctx)
+                       require.NoError(t, err)
+                       defer validation.CheckedClose(t, conn)
+
+                       stmt, err := conn.NewStatement()
+                       require.NoError(t, err)
+                       defer validation.CheckedClose(t, stmt)
+
+                       err = stmt.SetSqlQuery(q.query)
+                       require.NoError(t, err)
+
+                       startTime := time.Now()
+                       reader, _, err := stmt.ExecuteQuery(ctx)
+                       require.NoError(t, err)
+                       defer reader.Release()
+
+                       // Count rows
+                       totalRows := int64(0)
+                       batchCount := 0
+                       for reader.Next() {
+                               record := reader.Record()
+                               totalRows += record.NumRows()
+                               batchCount++
+                       }
+                       duration := time.Since(startTime)
+
+                       // Note: Databricks may apply row limits, so we check 
for at least some rows
+                       // rather than exact counts
+                       assert.Greater(t, totalRows, int64(0), "Expected to 
receive some rows")
+                       t.Logf("Query '%s': %d rows (requested %d) in %d 
batches, duration: %v",

Review Comment:
   Removed in 
[b59fc7f](https://github.com/apache/arrow-adbc/pull/3325/commits/b59fc7fea23c01bc35d724ec8edb6a0b660003cb)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to