@@ -51,12 +51,12 @@ def test_sea_async_query_with_cloud_fetch():
51
51
f"Successfully opened SEA session with ID: { connection .get_session_id_hex ()} "
52
52
)
53
53
54
- # Execute a simple query asynchronously
54
+ # Execute a query that returns 100 rows asynchronously
55
55
cursor = connection .cursor ()
56
- logger .info (
57
- "Executing asynchronous query with cloud fetch: SELECT 1 as test_value"
56
+ logger .info ("Executing asynchronous query with cloud fetch: SELECT 100 rows" )
57
+ cursor .execute_async (
58
+ "SELECT id, 'test_value_' || CAST(id as STRING) as test_value FROM range(1, 101)"
58
59
)
59
- cursor .execute_async ("SELECT 1 as test_value" )
60
60
logger .info (
61
61
"Asynchronous query submitted successfully with cloud fetch enabled"
62
62
)
@@ -69,6 +69,8 @@ def test_sea_async_query_with_cloud_fetch():
69
69
70
70
logger .info ("Query is no longer pending, getting results..." )
71
71
cursor .get_async_execution_result ()
72
+ rows = cursor .fetchall ()
73
+ logger .info (f"Retrieved rows: { rows } " )
72
74
logger .info (
73
75
"Successfully retrieved asynchronous query results with cloud fetch enabled"
74
76
)
@@ -130,12 +132,12 @@ def test_sea_async_query_without_cloud_fetch():
130
132
f"Successfully opened SEA session with ID: { connection .get_session_id_hex ()} "
131
133
)
132
134
133
- # Execute a simple query asynchronously
135
+ # Execute a query that returns 100 rows asynchronously
134
136
cursor = connection .cursor ()
135
- logger .info (
136
- "Executing asynchronous query without cloud fetch: SELECT 1 as test_value"
137
+ logger .info ("Executing asynchronous query without cloud fetch: SELECT 100 rows" )
138
+ cursor .execute_async (
139
+ "SELECT id, 'test_value_' || CAST(id as STRING) as test_value FROM range(1, 101)"
137
140
)
138
- cursor .execute_async ("SELECT 1 as test_value" )
139
141
logger .info (
140
142
"Asynchronous query submitted successfully with cloud fetch disabled"
141
143
)
@@ -148,6 +150,8 @@ def test_sea_async_query_without_cloud_fetch():
148
150
149
151
logger .info ("Query is no longer pending, getting results..." )
150
152
cursor .get_async_execution_result ()
153
+ rows = cursor .fetchall ()
154
+ logger .info (f"Retrieved rows: { rows } " )
151
155
logger .info (
152
156
"Successfully retrieved asynchronous query results with cloud fetch disabled"
153
157
)
0 commit comments