Skip to content

Cassandra Genes Extension - #1730

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

Cassandra Genes Extension#1730
gonzalotguerrero wants to merge 3 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

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