looking for a query to filter out all records where the opened_date is null. getting a Unable to coerce '' to a formatted date (long) error i tried.
select * from schema.table_name_account where opened_date = '' ;
select * from schema.table_name_account where opened_date = ' ' ;
select * from schema.table_name_account where opened_date in ('') ;
thanks for the help ( i know null isnt supported in cassandra )
As you already stated, it is not possible to filter on a
nullvalue.The reason for this is that Cassandra storage is sparse -- columns which do not have a value assigned are not stored in the database.
To illustrate, I'll use this example table of users:
In a traditional relational database, the record for Alice will have phone stored with a
nullvalue.But in Cassandra, only the columns with a value are stored. On disk, it looks something like this:
Notice that neither the
phonenoraddressfields are stored so they don't occupy any disk space, hence the term "sparse".Since those columns are not stored on disk, Cassandra cannot search for them. Additionally, Cassandra is optimised for retrieving a single partition by primary key. In the case where you're retrieving records where a column is empty, it is no longer OLTP but an analytics workload so you'll need to use software like Spark or Solr to achieve it. Cheers!