Skip to content

Missing static values #894

@woupiestek

Description

@woupiestek

We want to use Cassandra to cache Exchange calendars, so they are available when Exchange is not. The following cql defines a table for storing the results of an availability request. The static last_update column keeps track of the last time our application wrote to the partition, if any.

CREATE TABLE IF NOT EXISTS slots_by_account_and_day
(
    account     text,
    day         text,
    ews_id      text,
    start_time  timestamp,
    end_time    timestamp,
    status      text,
    last_update timestamp STATIC,
    PRIMARY KEY ((account, day), ews_id)
)

After filling the table with testdata, I noticed that PhantomDSL gives me None when I expected Some, using the following code:

table
  .select(_.last_update)
  .where(_.account eqs account)
  .and(_.day eqs day)
  .one

Meanwhile, the following Datastax based solution does give me what I expect using the following code:

session
  .execute(QueryBuilder.select("last_update")
    .from(table.tableName)
    .where(QueryBuilder.eq("account", account))
    .and(QueryBuilder.eq("day", day)))
  .one()
  .getTimestamp("last_update")

This looks like a bug. I assume it is related to the way PhantomDSL handles static columns, because this is the first time I have tried to use this feature of Cassandra.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions