Skip to content

Cassandra Genes Extension - #1730

Open
gonzalotguerrero wants to merge 7 commits into
feature/cassandra-actionsfrom
feature/cassandra-genes-extension
Open

gonzalotguerrero wants to merge 7 commits into
feature/cassandra-actionsfrom
feature/cassandra-genes-extension

Conversation

@gonzalotguerrero

Copy link
Copy Markdown
Collaborator

Added Genes for CQL types inet, list, set, and map

@@ -41,6 +56,11 @@ object CassandraColumnGeneBuilder {
"double" to { name -> DoubleGene(name) },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace string with constants

* The [kind] is kept explicitly because the CQL literals of a list and of a set are built from the
* same kind of gene but written with different delimiters, and so could not be told apart otherwise.
*/
class CqlCollectionGene(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using a CollectionGene instead?

* A Cassandra collection type, with how many CQL types parameterize it and how its literal is
* delimited, eg a list is written "[1, 2]" whereas a set is written "{1, 2}".
*/
enum class CqlCollectionKind(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not convinced this class is needed at all

private fun setValueWithDecimal(bd: BigDecimal, precision: Int?, scale: Int?){

val ensureRoundedValueIsInRange = (getMinimum () < bd && bd < getMaximum())
val ensureRoundedValueIsInRange = (getMinimum () <= bd && bd <= getMaximum())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a bug? If so, it should be in a separate branch with a test case showing the incorrect behaviour. Take into account that BigDecimalGene has fields minInclusive and maxInclusive

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi JP! I restored the range for now, it works again because I deleted CqlCollectionGene, but I believe its addition was what caused a test failure in GeneRandomizedTest. I think the presence of this new gene altered the sampling for some of the seeds

@jgaleotti
jgaleotti requested a review from arcuri82 September 16, 2026 13:30
@gonzalotguerrero
gonzalotguerrero added this pull request to stack #1768 September 16, 2026 19:47
@gonzalotguerrero
gonzalotguerrero removed this pull request from stack #1768 September 17, 2026 21:05
@gonzalotguerrero
gonzalotguerrero added this pull request to stack #1776 September 17, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants