Cassandra cqlsh - how to show microseconds/milliseconds for timestamp columns?

前端 未结 5 1694
名媛妹妹
名媛妹妹 2020-12-02 17:28

I\'m inserting into a Cassandra table with timestamp columns. The data I have comes with microsecond precision, so the time data string looks like this:

2015

5条回答
  •  情话喂你
    2020-12-02 17:58

    You can configure the output format of datetime objects in the .cassandra/cqlshrc file, using python's 'strftime' syntax.

    Unfortunately, the %f directive for microseconds (there does not seem to be a directive for milliseconds) does not work for older python versions, which means you have to fall back to the blobAsBigint(timestampAsBlob(date)) solution.

提交回复
热议问题