[ 
https://issues.apache.org/jira/browse/CASSANDRA-19566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17838665#comment-17838665
 ] 

Stefan Miklosovic edited comment on CASSANDRA-19566 at 4/18/24 1:58 PM:
------------------------------------------------------------------------

Ah, so there are some problems in the end. I haven't looked into that yet.

[CASSANDRA-19566-5.0|https://github.com/instaclustr/cassandra/tree/CASSANDRA-19566-5.0]
{noformat}
java17_pre-commit_tests                         
  ✓ j17_build                                        4m 36s
  ✓ j17_cqlsh_dtests_py311                           5m 49s
  ✓ j17_cqlsh_dtests_py311_vnode                     6m 39s
  ✓ j17_cqlsh_dtests_py38_vnode                      6m 34s
  ✓ j17_cqlshlib_cython_tests                        7m 13s
  ✓ j17_cqlshlib_tests                               8m 21s
  ✓ j17_dtests                                      32m 51s
  ✓ j17_dtests_latest                               33m 11s
  ✓ j17_dtests_vnode                                33m 29s
  ✓ j17_jvm_dtests_latest_vnode                     16m 56s
    j17_jvm_dtests                                  22m 16s
    j17_unit_tests                                   3m 26s
    j17_cqlsh_dtests_py38                           pending
    j17_utests_latest                               pending
  ✕ j17_utests_oa                                   15m 49s
      org.apache.cassandra.db.marshal.AbstractTypeTest serdeFromCQLLiteral
      org.apache.cassandra.db.marshal.AbstractTypeTest serdeFromString
      org.apache.cassandra.utils.bytecomparable.ByteSourceComparisonTest 
testDateType
      org.apache.cassandra.utils.bytecomparable.ByteSourceComparisonTest 
testTimestampType
      org.apache.cassandra.utils.bytecomparable.ByteSourceConversionTest 
testDateType
      org.apache.cassandra.utils.bytecomparable.ByteSourceConversionTest 
testTimestampType
      org.apache.cassandra.cql3.functions.CastFctsTest 
testTimeCastsInSelectionClause
      org.apache.cassandra.net.ConnectionTest testTimeout
      org.apache.cassandra.db.marshal.TimestampTypeTest stringProperty
java17_separate_tests                            
java11_pre-commit_tests                         
java11_separate_tests                            
{noformat}
[java17_pre-commit_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/4191/workflows/ed068a94-b146-4b8c-87fb-851be5735922]


was (Author: smiklosovic):
Ah, so there are some problems in the end. I haven't looked in that yet.

[CASSANDRA-19566-5.0|https://github.com/instaclustr/cassandra/tree/CASSANDRA-19566-5.0]
{noformat}
java17_pre-commit_tests                         
  ✓ j17_build                                        4m 36s
  ✓ j17_cqlsh_dtests_py311                           5m 49s
  ✓ j17_cqlsh_dtests_py311_vnode                     6m 39s
  ✓ j17_cqlsh_dtests_py38_vnode                      6m 34s
  ✓ j17_cqlshlib_cython_tests                        7m 13s
  ✓ j17_cqlshlib_tests                               8m 21s
  ✓ j17_dtests                                      32m 51s
  ✓ j17_dtests_latest                               33m 11s
  ✓ j17_dtests_vnode                                33m 29s
  ✓ j17_jvm_dtests_latest_vnode                     16m 56s
    j17_jvm_dtests                                  22m 16s
    j17_unit_tests                                   3m 26s
    j17_cqlsh_dtests_py38                           pending
    j17_utests_latest                               pending
  ✕ j17_utests_oa                                   15m 49s
      org.apache.cassandra.db.marshal.AbstractTypeTest serdeFromCQLLiteral
      org.apache.cassandra.db.marshal.AbstractTypeTest serdeFromString
      org.apache.cassandra.utils.bytecomparable.ByteSourceComparisonTest 
testDateType
      org.apache.cassandra.utils.bytecomparable.ByteSourceComparisonTest 
testTimestampType
      org.apache.cassandra.utils.bytecomparable.ByteSourceConversionTest 
testDateType
      org.apache.cassandra.utils.bytecomparable.ByteSourceConversionTest 
testTimestampType
      org.apache.cassandra.cql3.functions.CastFctsTest 
testTimeCastsInSelectionClause
      org.apache.cassandra.net.ConnectionTest testTimeout
      org.apache.cassandra.db.marshal.TimestampTypeTest stringProperty
java17_separate_tests                            
java11_pre-commit_tests                         
java11_separate_tests                            
{noformat}

[java17_pre-commit_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/4191/workflows/ed068a94-b146-4b8c-87fb-851be5735922]


> JSON encoded timestamp value does not always match non-JSON encoded value
> -------------------------------------------------------------------------
>
>                 Key: CASSANDRA-19566
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19566
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Core, Legacy/CQL
>            Reporter: Bowen Song
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 5.0.x, 5.x
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Description:
> "SELECT JSON ..." and "toJson(...)" on Cassandra 4.1.4 produces different 
> date than "SELECT ..."  for some timestamp type values.
>  
> Steps to reproduce:
> {code:java}
> $ sudo docker pull cassandra:4.1.4
> $ sudo docker create --name cass cassandra:4.1.4
> $ sudo docker start cass
> $ # wait for the Cassandra instance becomes ready
> $ sudo docker exec -ti cass cqlsh
> Connected to Test Cluster at 127.0.0.1:9042
> [cqlsh 6.1.0 | Cassandra 4.1.4 | CQL spec 3.4.6 | Native protocol v5]
> Use HELP for help.
> cqlsh> create keyspace test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': 1};
> cqlsh> use test;
> cqlsh:test> create table tbl (id int, ts timestamp, primary key (id));
> cqlsh:test> insert into tbl (id, ts) values (1, -13767019200000);
> cqlsh:test> select tounixtimestamp(ts), ts, tojson(ts) from tbl where id=1;
>  system.tounixtimestamp(ts) | ts                              | 
> system.tojson(ts)
> ----------------------------+---------------------------------+----------------------------
>             -13767019200000 | 1533-09-28 12:00:00.000000+0000 | "1533-09-18 
> 12:00:00.000Z"
> (1 rows)
> cqlsh:test> select json * from tbl where id=1;
>  [json]
> ---------------------------------------------
>  {"id": 1, "ts": "1533-09-18 12:00:00.000Z"}
> (1 rows)
> {code}
>  
> Expected behaviour:
> The "select ts", "select tojson(ts)" and "select json *" should all produce 
> the same date.
>  
> Actual behaviour:
> The "select ts" produced the "1533-09-28" date but the "select tojson(ts)" 
> and "select json *" produced the "1533-09-18" date.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to