You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Brandon Williams (Jira)" <ji...@apache.org> on 2021/11/03 14:15:00 UTC

[jira] [Updated] (CASSANDRA-17117) CQLSSTableWriter backwards compatibility fix for Date fields

     [ https://issues.apache.org/jira/browse/CASSANDRA-17117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brandon Williams updated CASSANDRA-17117:
-----------------------------------------
     Bug Category: Parent values: Code(13163)
       Complexity: Normal
    Discovered By: User Report
         Severity: Low
           Status: Open  (was: Triage Needed)

> CQLSSTableWriter backwards compatibility fix for Date fields
> ------------------------------------------------------------
>
>                 Key: CASSANDRA-17117
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17117
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local/SSTable
>            Reporter: Doug Rohrer
>            Priority: Normal
>
> {{cassandra-all}} library consumers of the CQLSSTableWriter class cannot easily create an appropriate instance of the {{LocalDate}} class in order to write SSTables including dates, and the current implementation no longer accepts a {{int}} value as a valid input as previous versions of the class would - we used to use {{((AbstractType)columnSpecification.type).decompose(value);}} in order to serialize the value, but now we use the type codec's .serialize method. Unfortunately, this doesn't work when the consumer can't easily create the type needed (serialize, in the case of dates, takes a {{LocalDate}} instance which is not easy to construct outside of Cassandra internal code).
> This can be worked around by catching the resulting {{ClassCastException}} thrown from the {{serialize}} call and falling back to the older {{decompose}} implementation, which would maintain backwards-compatibility with other users of the CQLSSTableWriter in cases where they are passing integers for date fields, which used to work.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org