Pass a TEXT data to FLOAT in CQL

1

I have in Cassandra a column that has the format TEXT , although in truth what it stores are numbers (for example 12.23 ) and I need to do a SELECT in CQL to compare if it is greater than a certain number.

For example:

SELECT temperatura from db.estaciones WHERE temperatura > 23.31

The problem is that I do not know how to make you compare a TEXT with a FLOAT .

    
asked by J. Salguero 27.11.2016 в 18:44
source

1 answer

1

Hello with Cassandra, you can do this:

    SELECT Cast(temperatura as float)
    FROM   db.estaciones
    WHERE  Cast(temperatura as float) > 23.31

I hope it serves you Regards.

    
answered by 07.02.2017 в 14:51