Skip to content

Commit

Permalink
Remove timebucket from clustering column, #399 (#766)
Browse files Browse the repository at this point in the history
* Remove timebucket from clustering column, #399

* originally there because of the materialized view
* for old table definitions it must be set
* would be difficult to remove it entirely from the table
  because then we would have to maintain two different insert statements
  depending on if the table defined the column or not, meaning that we
  would have to do some fake query when starting up to check if the column
  is defined

* fix CassandraEventUpdateSpec
  • Loading branch information
patriknw authored Apr 7, 2020
1 parent 451d657 commit 7f2ad5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ import akka.stream.alpakka.cassandra.scaladsl.CassandraSession
.setLong("partition_nr", partitionNr)
.setLong("sequence_nr", s.sequenceNr)
.setUuid("timestamp", s.timeUuid)
.setString("timebucket", s.timeBucket.key.toString)
.setInt("ser_id", s.serId)
.setString("ser_manifest", s.serManifest)
.setString("event_manifest", s.eventAdapterManifest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import akka.persistence.cassandra.FutureDone
| meta_ser_manifest text,
| meta blob,
| tags set<text>,
| PRIMARY KEY ((persistence_id, partition_nr), sequence_nr, timestamp, timebucket))
| PRIMARY KEY ((persistence_id, partition_nr), sequence_nr, timestamp))
| WITH gc_grace_seconds =${journalSettings.gcGraceSeconds}
| AND compaction = ${indent(journalSettings.tableCompactionStrategy.asCQL, " ")}
""".stripMargin.trim
Expand Down Expand Up @@ -136,20 +136,7 @@ import akka.persistence.cassandra.FutureDone
persistence_id = ? AND
partition_nr = ? AND
sequence_nr = ? AND
timestamp = ? AND
timebucket = ?
"""

def addTagsToMessagesTable: String =
s"""
UPDATE $tableName
SET tags = tags + ?
WHERE
persistence_id = ? AND
partition_nr = ? AND
sequence_nr = ? AND
timestamp = ? AND
timebucket = ?
timestamp = ?
"""

def writeTags(withMeta: Boolean): String =
Expand Down

0 comments on commit 7f2ad5d

Please sign in to comment.