You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "dcapwell (via GitHub)" <gi...@apache.org> on 2025/02/03 19:18:04 UTC
[PR] CASSANDRA-20283: When generating AbstractTypeGenerators.safeTypeGen() for tests composite types limit depth but collections didnt [cassandra]
dcapwell opened a new pull request, #3863:
URL: https://github.com/apache/cassandra/pull/3863
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-20283: When generating AbstractTypeGenerators.safeTypeGen() for tests composite types limit depth but collections didnt [cassandra]
Posted by "dcapwell (via GitHub)" <gi...@apache.org>.
dcapwell commented on PR #3863:
URL: https://github.com/apache/cassandra/pull/3863#issuecomment-2632221631
merged https://github.com/apache/cassandra/commit/1460f05af2c827890d5ea156e53f2359685f7a85
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-20283: When generating AbstractTypeGenerators.safeTypeGen() for tests composite types limit depth but collections didnt [cassandra]
Posted by "dcapwell (via GitHub)" <gi...@apache.org>.
dcapwell commented on code in PR #3863:
URL: https://github.com/apache/cassandra/pull/3863#discussion_r1939908469
##########
test/unit/org/apache/cassandra/utils/AbstractTypeGenerators.java:
##########
@@ -550,10 +550,11 @@ public static Gen<AbstractType<?>> safeTypeGen()
.withoutTypeKinds(COUNTER)
.withoutPrimitive(DecimalType.instance)
// its ordering is special...
- .withoutPrimitive(DurationType.instance);
- // composite requires all elements fit into Short.MAX_VALUE bytes
- // so try to limit the possible expansion of types
- return baseline.withCompositeElementGen(new TypeGenBuilder(baseline).withDefaultSizeGen(1).withMaxDepth(1).build())
+ .withoutPrimitive(DurationType.instance)
+ // To make sure all elements fit within Short.MAX_VALUE bytes,
+ // need to limit the possible expansion of types
+ .withDefaultSizeGen(1).withMaxDepth(1);
Review Comment:
this method is also only used for `partitioners` when figuring out the type for `LocalPartitioner`. Given its isolation this change only impacts `LocalPartitioner` type and not tables
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-20283: When generating AbstractTypeGenerators.safeTypeGen() for tests composite types limit depth but collections didnt [cassandra]
Posted by "dcapwell (via GitHub)" <gi...@apache.org>.
dcapwell commented on code in PR #3863:
URL: https://github.com/apache/cassandra/pull/3863#discussion_r1939906094
##########
test/unit/org/apache/cassandra/utils/CassandraGenerators.java:
##########
@@ -1162,24 +1161,6 @@ public static Gen<IPartitioner> nonLocalPartitioners()
.flatMap(SupportedPartitioners::partitioner);
}
- /**
- * For {@link LocalPartitioner} it can have a very complex type which can lead to generating data larger than
- * allowed in a primary key. If a test needs to filter out those cases, can just
- * {@code .map(CassandraGenerators::simplify)} to resolve.
- */
- public static IPartitioner simplify(IPartitioner partitioner)
Review Comment:
this hack is no longer needed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-20283: When generating AbstractTypeGenerators.safeTypeGen() for tests composite types limit depth but collections didnt [cassandra]
Posted by "dcapwell (via GitHub)" <gi...@apache.org>.
dcapwell closed pull request #3863: CASSANDRA-20283: When generating AbstractTypeGenerators.safeTypeGen() for tests composite types limit depth but collections didnt
URL: https://github.com/apache/cassandra/pull/3863
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-20283: When generating AbstractTypeGenerators.safeTypeGen() for tests composite types limit depth but collections didnt [cassandra]
Posted by "dcapwell (via GitHub)" <gi...@apache.org>.
dcapwell commented on code in PR #3863:
URL: https://github.com/apache/cassandra/pull/3863#discussion_r1939907576
##########
test/unit/org/apache/cassandra/utils/AbstractTypeGenerators.java:
##########
@@ -550,10 +550,11 @@ public static Gen<AbstractType<?>> safeTypeGen()
.withoutTypeKinds(COUNTER)
.withoutPrimitive(DecimalType.instance)
// its ordering is special...
- .withoutPrimitive(DurationType.instance);
- // composite requires all elements fit into Short.MAX_VALUE bytes
- // so try to limit the possible expansion of types
- return baseline.withCompositeElementGen(new TypeGenBuilder(baseline).withDefaultSizeGen(1).withMaxDepth(1).build())
+ .withoutPrimitive(DurationType.instance)
+ // To make sure all elements fit within Short.MAX_VALUE bytes,
+ // need to limit the possible expansion of types
+ .withDefaultSizeGen(1).withMaxDepth(1);
Review Comment:
this makes sure collections/udt/tuple/vector/etc. are also bound.
The top level can be any type, but `list<list<int>>` is no longer possible; only `list<int>`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org