22import math
33import time
44
5+ import pytest
6+
57log = logging .getLogger (__name__ )
68
79
@@ -42,7 +44,14 @@ def fetch_rows(self, cursor, row_count, fetchmany_size):
4244 + "assuming 10K fetch size."
4345 )
4446
45- def test_query_with_large_wide_result_set (self ):
47+ @pytest .mark .parametrize (
48+ "extra_params" ,
49+ [
50+ {},
51+ {"use_sea" : True },
52+ ],
53+ )
54+ def test_query_with_large_wide_result_set (self , extra_params ):
4655 resultSize = 300 * 1000 * 1000 # 300 MB
4756 width = 8192 # B
4857 rows = resultSize // width
@@ -52,7 +61,7 @@ def test_query_with_large_wide_result_set(self):
5261 fetchmany_size = 10 * 1024 * 1024 // width
5362 # This is used by PyHive tests to determine the buffer size
5463 self .arraysize = 1000
55- with self .cursor () as cursor :
64+ with self .cursor (extra_params ) as cursor :
5665 for lz4_compression in [False , True ]:
5766 cursor .connection .lz4_compression = lz4_compression
5867 uuids = ", " .join (["uuid() uuid{}" .format (i ) for i in range (cols )])
@@ -68,7 +77,14 @@ def test_query_with_large_wide_result_set(self):
6877 assert row [0 ] == row_id # Verify no rows are dropped in the middle.
6978 assert len (row [1 ]) == 36
7079
71- def test_query_with_large_narrow_result_set (self ):
80+ @pytest .mark .parametrize (
81+ "extra_params" ,
82+ [
83+ {},
84+ {"use_sea" : True },
85+ ],
86+ )
87+ def test_query_with_large_narrow_result_set (self , extra_params ):
7288 resultSize = 300 * 1000 * 1000 # 300 MB
7389 width = 8 # sizeof(long)
7490 rows = resultSize / width
@@ -77,12 +93,19 @@ def test_query_with_large_narrow_result_set(self):
7793 fetchmany_size = 10 * 1024 * 1024 // width
7894 # This is used by PyHive tests to determine the buffer size
7995 self .arraysize = 10000000
80- with self .cursor () as cursor :
96+ with self .cursor (extra_params ) as cursor :
8197 cursor .execute ("SELECT * FROM RANGE({rows})" .format (rows = rows ))
8298 for row_id , row in enumerate (self .fetch_rows (cursor , rows , fetchmany_size )):
8399 assert row [0 ] == row_id
84100
85- def test_long_running_query (self ):
101+ @pytest .mark .parametrize (
102+ "extra_params" ,
103+ [
104+ {},
105+ {"use_sea" : True },
106+ ],
107+ )
108+ def test_long_running_query (self , extra_params ):
86109 """Incrementally increase query size until it takes at least 3 minutes,
87110 and asserts that the query completes successfully.
88111 """
@@ -92,7 +115,7 @@ def test_long_running_query(self):
92115 duration = - 1
93116 scale0 = 10000
94117 scale_factor = 1
95- with self .cursor () as cursor :
118+ with self .cursor (extra_params ) as cursor :
96119 while duration < min_duration :
97120 assert scale_factor < 1024 , "Detected infinite loop"
98121 start = time .time ()
0 commit comments