Skip to content

Commit 51aa9be

Browse files
add sea tag on large queries
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent b12a8b0 commit 51aa9be

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

tests/e2e/common/large_queries_mixin.py

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import math
33
import time
44

5+
import pytest
6+
57
log = logging.getLogger(__name__)
68

79

@@ -42,7 +44,16 @@ 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+
{
52+
"use_sea": True,
53+
},
54+
],
55+
)
56+
def test_query_with_large_wide_result_set(self, extra_params):
4657
resultSize = 300 * 1000 * 1000 # 300 MB
4758
width = 8192 # B
4859
rows = resultSize // width
@@ -52,7 +63,7 @@ def test_query_with_large_wide_result_set(self):
5263
fetchmany_size = 10 * 1024 * 1024 // width
5364
# This is used by PyHive tests to determine the buffer size
5465
self.arraysize = 1000
55-
with self.cursor() as cursor:
66+
with self.cursor(extra_params) as cursor:
5667
for lz4_compression in [False, True]:
5768
cursor.connection.lz4_compression = lz4_compression
5869
uuids = ", ".join(["uuid() uuid{}".format(i) for i in range(cols)])
@@ -68,7 +79,16 @@ def test_query_with_large_wide_result_set(self):
6879
assert row[0] == row_id # Verify no rows are dropped in the middle.
6980
assert len(row[1]) == 36
7081

71-
def test_query_with_large_narrow_result_set(self):
82+
@pytest.mark.parametrize(
83+
"extra_params",
84+
[
85+
{},
86+
{
87+
"use_sea": True,
88+
},
89+
],
90+
)
91+
def test_query_with_large_narrow_result_set(self, extra_params):
7292
resultSize = 300 * 1000 * 1000 # 300 MB
7393
width = 8 # sizeof(long)
7494
rows = resultSize / width
@@ -77,12 +97,21 @@ def test_query_with_large_narrow_result_set(self):
7797
fetchmany_size = 10 * 1024 * 1024 // width
7898
# This is used by PyHive tests to determine the buffer size
7999
self.arraysize = 10000000
80-
with self.cursor() as cursor:
100+
with self.cursor(extra_params) as cursor:
81101
cursor.execute("SELECT * FROM RANGE({rows})".format(rows=rows))
82102
for row_id, row in enumerate(self.fetch_rows(cursor, rows, fetchmany_size)):
83103
assert row[0] == row_id
84104

85-
def test_long_running_query(self):
105+
@pytest.mark.parametrize(
106+
"extra_params",
107+
[
108+
{},
109+
{
110+
"use_sea": True,
111+
},
112+
],
113+
)
114+
def test_long_running_query(self, extra_params):
86115
"""Incrementally increase query size until it takes at least 3 minutes,
87116
and asserts that the query completes successfully.
88117
"""
@@ -92,7 +121,7 @@ def test_long_running_query(self):
92121
duration = -1
93122
scale0 = 10000
94123
scale_factor = 1
95-
with self.cursor() as cursor:
124+
with self.cursor(extra_params) as cursor:
96125
while duration < min_duration:
97126
assert scale_factor < 1024, "Detected infinite loop"
98127
start = time.time()

0 commit comments

Comments
 (0)