If you don't need to use COMPACT STORAGE (and backwards compatibility with Thrift), just create your table as
CREATE TABLE data (
sensor_id int,
collected_at timestamp,
other_field bigint,
volts float,
PRIMARY KEY (sensor_id, collected_at)
)
Cassandra supports sparse columns with basically no overhead, so if you programmatically decide to only populate one of the two fields for any cql row, you will achieve your goal.
Alternatively, you can continue to use COMPACT STORAGE and just switch to blob type. The blob type will do absolutely no interpretation or transformation of the bytes that you insert into it, so accuracy can be guaranteed. I would not recommend using a text type for this.
Data Type | Constants | Description |
ascii | strings | ASCII is a data type that includes ... |
Boolean | booleans | BOOLEAN is used for variables that have ... |
blob | blobs | BLOB is short for “Binary Large Object” ... |
decimal | integers, floats | DECIMAL data types are convenient for ... |