Issue in casting uuid

(Anup Kurup) #1

I have a cassandra table with id column having datatype as uuid. Now i want to select records from the table but it is giving error as uuid is unidentified in jdbc (i am using cassandrajdbc1.1.jar) . So I tried casting id column to varchar but still it not working. My current configuration is as follows:
jdbc {
jdbc_connection_string => ""
jdbc_user => ""
jdbc_password => ""
jdbc_driver_library => "etc/logstash/configs/cassandrajdbc1.1.jar"
jdbc_driver_class => "com.dbschema.CassandraJdbcDriver"
statement => 'select cast(id as varchar(100)) as id, country, "currentStatus", "dateCreated", "dateProcessed", "docCreatedBy", "recordsMatched", "totalRecords" from upload_excel'
schedule => "* * * * *"
type => "uploadexcel"
and the error I m getting is :-
[logstash.inputs.jdbc ] Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::ComDatastaxDriverCoreExceptions::SyntaxError: line 1:15 missing ')' at 'as' (select cast(id [as] varchar...)>}

Thanks for the help in advance