Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6ce9a2

Browse files
committed
Cloud Fetch e2e tests
Signed-off-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
1 parent5379803 commitf6ce9a2

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

‎tests/e2e/driver_tests.py‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
importitertools
12
fromcontextlibimportcontextmanager
23
fromcollectionsimportOrderedDict
34
importdatetime
@@ -47,6 +48,7 @@ def __init__(self, method_name):
4748
# If running in local mode, just use environment variables for params.
4849
self.arguments=os.environifget_args_from_envelse {}
4950
self.arraysize=1000
51+
self.buffer_size_bytes=10485760
5052

5153
defconnection_params(self,arguments):
5254
params= {
@@ -79,7 +81,7 @@ def connection(self, extra_params=()):
7981
@contextmanager
8082
defcursor(self,extra_params=()):
8183
withself.connection(extra_params)asconn:
82-
cursor=conn.cursor(arraysize=self.arraysize)
84+
cursor=conn.cursor(arraysize=self.arraysize,buffer_size_bytes=self.buffer_size_bytes)
8385
try:
8486
yieldcursor
8587
finally:
@@ -610,7 +612,27 @@ def test_close_connection_closes_cursors(self):
610612
ifhasattr(cm,"exception"):
611613
assert"RESOURCE_DOES_NOT_EXIST"incm.exception.message
612614

613-
615+
@skipUnless(pysql_supports_arrow(),'needs arrow support')
616+
deftest_cloud_fetch(self):
617+
# This test can take several minutes to run
618+
limits= [100000,600000]
619+
threads= [10,25]
620+
self.buffer_size_bytes=104857600
621+
self.arraysize=100000
622+
base_query="SELECT * FROM store_sales "
623+
fornum_limit,num_threads,lz4_compressioninitertools.product(limits,threads, [True,False]):
624+
withself.subTest(num_limit=num_limit,num_threads=num_threads,lz4_compression=lz4_compression):
625+
cf_result,noop_result=None,None
626+
query=base_query+"LIMIT "+str(num_limit)
627+
withself.cursor({"use_cloud_fetch":True,"max_download_threads":num_threads})ascursor:
628+
cursor.execute(query)
629+
cf_result=cursor.fetchall()
630+
withself.cursor({})ascursor:
631+
cursor.execute(query)
632+
noop_result=cursor.fetchall()
633+
assertlen(cf_result)==len(noop_result)
634+
foriinrange(len(cf_result)):
635+
assertcf_result[i]==noop_result[i]
614636

615637

616638
# use a RetrySuite to encapsulate these tests which we'll typically want to run together; however keep

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp