Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tests/integration/standard/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,20 +663,22 @@ def test_can_insert_nested_tuples(self):
s.encoder.mapping[tuple] = s.encoder.cql_encode_tuple

# create a table with multiple sizes of nested tuples
# Note: Scylla limits CQL expression nesting depth to 12, so the
# deepest tuple tested here is 12 levels deep.
# Note: Scylla limits CQL expression nesting depth to 12 (every
# recursive `term` counts, including the innermost scalar value), so a
# nested tuple literal can be at most 11 levels deep before the server
# rejects it with "expression nested too deeply".
s.execute("CREATE TABLE nested_tuples ("
"k int PRIMARY KEY, "
"v_1 frozen<%s>,"
"v_2 frozen<%s>,"
"v_3 frozen<%s>,"
"v_12 frozen<%s>"
"v_11 frozen<%s>"
")" % (self.nested_tuples_schema_helper(1),
self.nested_tuples_schema_helper(2),
self.nested_tuples_schema_helper(3),
self.nested_tuples_schema_helper(12)))
self.nested_tuples_schema_helper(11)))

for i in (1, 2, 3, 12):
for i in (1, 2, 3, 11):
# create tuple
created_tuple = self.nested_tuples_creator_helper(i)

Expand Down
14 changes: 12 additions & 2 deletions tests/integration/standard/test_udts.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,12 @@ def test_can_insert_nested_registered_udts(self):
with self._cluster_default_dict_factory() as c:
s = c.connect(self.keyspace_name, wait_for_all_pools=True)

max_nesting_depth = 12
# Scylla caps CQL expression nesting depth at 12 (every recursive
# `term` counts). A UDT literal `{value: ...}` adds two term levels
# per nesting, so a UDT literal inserted via a simple statement can
# be at most 10 levels deep before the server rejects it with
# "expression nested too deeply".
max_nesting_depth = 10

# create the schema
self.nested_udt_schema_helper(s, max_nesting_depth)
Expand Down Expand Up @@ -454,7 +459,12 @@ def test_can_insert_nested_registered_udts_with_different_namedtuples(self):
with self._cluster_default_dict_factory() as c:
s = c.connect(self.keyspace_name, wait_for_all_pools=True)

max_nesting_depth = 12
# Scylla caps CQL expression nesting depth at 12 (every recursive
# `term` counts). A UDT literal `{value: ...}` adds two term levels
# per nesting, so a UDT literal inserted via a simple statement can
# be at most 10 levels deep before the server rejects it with
# "expression nested too deeply".
max_nesting_depth = 10

# create the schema
self.nested_udt_schema_helper(s, max_nesting_depth)
Expand Down
Loading