Querying duration related data from the cqlsh prompt results in an error.
Consider the following create table and insert statement.
On executing a select query on col20 in cqlsh I get an error "Failed to format value '"\x00\xfe\x02GS\xfc\xa5\xc0\x00' : 'ascii' codec can't decode byte 0xfe in position 2: ordinal not in range(128)"
On investigating this further I found that the current python Cassandra driver used found in lib/cassandra-driver-internal-only-3.7.0.post0-2481531.zip does not seem to support duration data type. This was added in Jan this year https://github.com/datastax/python-driver/pull/689.
So I downloaded the latest driver release https://github.com/datastax/python-driver/releases/tag/3.9.0. I embedded the latest driver into cassandra-driver-internal-only-3.7.0.post0-2481531.zip. This fixed the driver related issue but there was still a formatting issue.
I then went on to modify the format_value_duration methos in the pylib/cqlshlib/formatting.py. Diff posted below
This resulted in fixing the issue and duration types are now correctly displayed.
Happy to fix the issue if I can get some guidance on:
- If this is a valid issue. Tried searching JIRA but did not find anything reported.
- If my assumptions are correct i.e. this is actually a bug
- how to package the new driver into the source code.