Skip to content

Commit ce359b4

Browse files
chemelnucfintseaver
authored andcommitted
Spanner: add systest returning empty array struct (#4449)
1 parent 330f13e commit ce359b4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/google-cloud-spanner/tests/system/test_system.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,25 @@ def test_execute_sql_returning_array_of_struct(self):
15361536
[[['a', 1], ['b', 2]]],
15371537
])
15381538

1539+
def test_execute_sql_returning_empty_array_of_struct(self):
1540+
SQL = (
1541+
"SELECT ARRAY(SELECT AS STRUCT C1, C2 "
1542+
"FROM (SELECT 2 AS C1) X "
1543+
"JOIN (SELECT 1 AS C2) Y "
1544+
"ON X.C1 = Y.C2 "
1545+
"ORDER BY C1 ASC)"
1546+
)
1547+
self._db.snapshot(multi_use=True)
1548+
1549+
self._check_sql_results(
1550+
self._db,
1551+
sql=SQL,
1552+
params=None,
1553+
param_types=None,
1554+
expected=[
1555+
[[]],
1556+
])
1557+
15391558
def test_invalid_type(self):
15401559
table = 'counters'
15411560
columns = ('name', 'value')

0 commit comments

Comments
 (0)