Impossible to save a column with an empty value #21

JordanP opened this Issue Mar 13, 2010 · 2 comments


None yet
2 participants

JordanP commented Mar 13, 2010

Code Sample :
// Create column without validator
$c = new PandraColumn('aNonExistentCol', 'isempty');
$c->setParent(new PandraColumnFamily('myKeyID', 'Keyspace1', 'Standard1'));

This displays bool(false) whereas is should displays bool(true). As a consequence, the column is not saved.

IMHO the problem is in Column.class.php line 153 (method setValue()) :
if ($this->value == $value) return TRUE;
It should be
if ($this->value === $value) return TRUE;
Because, as I am sure you know, in PHP NULL == '' and cassandra_Column initiate the property 'value' with NULL


mjpearson commented Mar 14, 2010

Hi, thanks

This may be a Thrift issue, I haven't been able to write empty columns using it during testing so figured it wasn't supported. However, testing an empty 'set' in the CLI says this is not the case...

As for using the identity vs equality operator to check if a value has been changed, Cassandra stores column values as StringLiterals, so there isn't a need to make a type distinction. The empty value issue changes this though, so will look further @ Thrift


mjpearson commented Mar 14, 2010

resolved and committed, (empty value issue due to bad test case ;) )

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment