You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jawahar Prasad JP (Created) (JIRA)" <ji...@apache.org> on 2012/01/23 10:12:38 UTC

[jira] [Created] (CASSANDRA-3770) Timestamp datatype in CQL gets weird value?

Timestamp datatype in CQL gets weird value?
-------------------------------------------

                 Key: CASSANDRA-3770
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3770
             Project: Cassandra
          Issue Type: Bug
         Environment: MacOS, Java
            Reporter: Jawahar Prasad JP


Hi..
I have created a columnfamily through CQL, having datatype as timestamp,

I generate timestamp like this in Java:
System.currentTimeMillis()
(or)
System.currentTimeMillis()*1000

When I see the output through CQL, I get the data like below:
1.32725062505e+12

Also, I am not able to use any operators against this (like > '01 January 2012' etc.,), I get the below error:

No indexed columns present in by-columns clause with "equals" operator

But, I have created an index for the timestamp column.

Any help ?


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-3770) Timestamp datatype in CQL gets weird value?

Posted by "Jonathan Ellis (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis resolved CASSANDRA-3770.
---------------------------------------

       Resolution: Cannot Reproduce
    Fix Version/s:     (was: 1.2)
    
> Timestamp datatype in CQL gets weird value?
> -------------------------------------------
>
>                 Key: CASSANDRA-3770
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3770
>             Project: Cassandra
>          Issue Type: New Feature
>         Environment: MacOS, Java
>            Reporter: Jawahar Prasad JP
>            Priority: Minor
>              Labels: cql, java
>
> Hi..
> I have created a columnfamily through CQL, having datatype as timestamp,
> I generate timestamp like this in Java:
> System.currentTimeMillis()
> (or)
> System.currentTimeMillis()*1000
> When I see the output through CQL, I get the data like below:
> 1.32725062505e+12
> Also, I am not able to use any operators against this (like > '01 January 2012' etc.,), I get the below error:
> No indexed columns present in by-columns clause with "equals" operator
> But, I have created an index for the timestamp column.
> Any help ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3770) Timestamp datatype in CQL gets weird value?

Posted by "Rick Shaw (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13191504#comment-13191504 ] 

Rick Shaw commented on CASSANDRA-3770:
--------------------------------------

As this is a data tpye for Java {{Date}} please pass in a {{Date}} and not a {{long}}. It actually encodes it like a {{long}} but it's decompose method expecta a Java {{Date}} and its compose method produces a {{Date}}. You can, of course, use a {{long}} daatatype if you want to produce the long as in your explanation.

                
> Timestamp datatype in CQL gets weird value?
> -------------------------------------------
>
>                 Key: CASSANDRA-3770
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3770
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: MacOS, Java
>            Reporter: Jawahar Prasad JP
>              Labels: cql, java
>
> Hi..
> I have created a columnfamily through CQL, having datatype as timestamp,
> I generate timestamp like this in Java:
> System.currentTimeMillis()
> (or)
> System.currentTimeMillis()*1000
> When I see the output through CQL, I get the data like below:
> 1.32725062505e+12
> Also, I am not able to use any operators against this (like > '01 January 2012' etc.,), I get the below error:
> No indexed columns present in by-columns clause with "equals" operator
> But, I have created an index for the timestamp column.
> Any help ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3770) Timestamp datatype in CQL gets weird value?

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3770:
--------------------------------------

         Priority: Minor  (was: Major)
    Fix Version/s: 1.2

But the part about being able to interpret dates as strings is something we don't do yet, right?
                
> Timestamp datatype in CQL gets weird value?
> -------------------------------------------
>
>                 Key: CASSANDRA-3770
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3770
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: MacOS, Java
>            Reporter: Jawahar Prasad JP
>            Priority: Minor
>              Labels: cql, java
>             Fix For: 1.2
>
>
> Hi..
> I have created a columnfamily through CQL, having datatype as timestamp,
> I generate timestamp like this in Java:
> System.currentTimeMillis()
> (or)
> System.currentTimeMillis()*1000
> When I see the output through CQL, I get the data like below:
> 1.32725062505e+12
> Also, I am not able to use any operators against this (like > '01 January 2012' etc.,), I get the below error:
> No indexed columns present in by-columns clause with "equals" operator
> But, I have created an index for the timestamp column.
> Any help ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3770) Timestamp datatype in CQL gets weird value?

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3770:
--------------------------------------

    Issue Type: New Feature  (was: Bug)
    
> Timestamp datatype in CQL gets weird value?
> -------------------------------------------
>
>                 Key: CASSANDRA-3770
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3770
>             Project: Cassandra
>          Issue Type: New Feature
>         Environment: MacOS, Java
>            Reporter: Jawahar Prasad JP
>            Priority: Minor
>              Labels: cql, java
>             Fix For: 1.2
>
>
> Hi..
> I have created a columnfamily through CQL, having datatype as timestamp,
> I generate timestamp like this in Java:
> System.currentTimeMillis()
> (or)
> System.currentTimeMillis()*1000
> When I see the output through CQL, I get the data like below:
> 1.32725062505e+12
> Also, I am not able to use any operators against this (like > '01 January 2012' etc.,), I get the below error:
> No indexed columns present in by-columns clause with "equals" operator
> But, I have created an index for the timestamp column.
> Any help ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3770) Timestamp datatype in CQL gets weird value?

Posted by "paul cannon (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13220358#comment-13220358 ] 

paul cannon commented on CASSANDRA-3770:
----------------------------------------

For the supported timestamp/date formats, see http://www.datastax.com/docs/1.0/references/cql/index#working-with-dates-and-times .
                
> Timestamp datatype in CQL gets weird value?
> -------------------------------------------
>
>                 Key: CASSANDRA-3770
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3770
>             Project: Cassandra
>          Issue Type: New Feature
>         Environment: MacOS, Java
>            Reporter: Jawahar Prasad JP
>            Priority: Minor
>              Labels: cql, java
>             Fix For: 1.2
>
>
> Hi..
> I have created a columnfamily through CQL, having datatype as timestamp,
> I generate timestamp like this in Java:
> System.currentTimeMillis()
> (or)
> System.currentTimeMillis()*1000
> When I see the output through CQL, I get the data like below:
> 1.32725062505e+12
> Also, I am not able to use any operators against this (like > '01 January 2012' etc.,), I get the below error:
> No indexed columns present in by-columns clause with "equals" operator
> But, I have created an index for the timestamp column.
> Any help ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3770) Timestamp datatype in CQL gets weird value?

Posted by "Rick Shaw (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192358#comment-13192358 ] 

Rick Shaw commented on CASSANDRA-3770:
--------------------------------------

A STRING_LITERAL _can_ be coerced to a {{timestamp}} if it is one of the acceptable supported formats.
                
> Timestamp datatype in CQL gets weird value?
> -------------------------------------------
>
>                 Key: CASSANDRA-3770
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3770
>             Project: Cassandra
>          Issue Type: New Feature
>         Environment: MacOS, Java
>            Reporter: Jawahar Prasad JP
>            Priority: Minor
>              Labels: cql, java
>             Fix For: 1.2
>
>
> Hi..
> I have created a columnfamily through CQL, having datatype as timestamp,
> I generate timestamp like this in Java:
> System.currentTimeMillis()
> (or)
> System.currentTimeMillis()*1000
> When I see the output through CQL, I get the data like below:
> 1.32725062505e+12
> Also, I am not able to use any operators against this (like > '01 January 2012' etc.,), I get the below error:
> No indexed columns present in by-columns clause with "equals" operator
> But, I have created an index for the timestamp column.
> Any help ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3770) Timestamp datatype in CQL gets weird value?

Posted by "Rick Shaw (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13191504#comment-13191504 ] 

Rick Shaw edited comment on CASSANDRA-3770 at 1/23/12 9:47 PM:
---------------------------------------------------------------

As this is a data type for Java {{Date}}, please pass in a {{Date}} and not a {{long}}. It actually encodes it like a {{long}} but it's decompose method expecta a Java {{Date}} and its compose method produces a {{Date}}. You can, of course, use a {{long}} daatatype if you want to produce the long as in your explanation.

                
      was (Author: ardot):
    As this is a data tpye for Java {{Date}} please pass in a {{Date}} and not a {{long}}. It actually encodes it like a {{long}} but it's decompose method expecta a Java {{Date}} and its compose method produces a {{Date}}. You can, of course, use a {{long}} daatatype if you want to produce the long as in your explanation.

                  
> Timestamp datatype in CQL gets weird value?
> -------------------------------------------
>
>                 Key: CASSANDRA-3770
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3770
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: MacOS, Java
>            Reporter: Jawahar Prasad JP
>              Labels: cql, java
>
> Hi..
> I have created a columnfamily through CQL, having datatype as timestamp,
> I generate timestamp like this in Java:
> System.currentTimeMillis()
> (or)
> System.currentTimeMillis()*1000
> When I see the output through CQL, I get the data like below:
> 1.32725062505e+12
> Also, I am not able to use any operators against this (like > '01 January 2012' etc.,), I get the below error:
> No indexed columns present in by-columns clause with "equals" operator
> But, I have created an index for the timestamp column.
> Any help ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3770) Timestamp datatype in CQL gets weird value?

Posted by "Rick Shaw (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192364#comment-13192364 ] 

Rick Shaw commented on CASSANDRA-3770:
--------------------------------------

Jawahar, if these answers are insufficient, please provide a sample of the exact code that is failing which covers any relavant declarations, and the Exception log entry that results from the failure.
                
> Timestamp datatype in CQL gets weird value?
> -------------------------------------------
>
>                 Key: CASSANDRA-3770
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3770
>             Project: Cassandra
>          Issue Type: New Feature
>         Environment: MacOS, Java
>            Reporter: Jawahar Prasad JP
>            Priority: Minor
>              Labels: cql, java
>             Fix For: 1.2
>
>
> Hi..
> I have created a columnfamily through CQL, having datatype as timestamp,
> I generate timestamp like this in Java:
> System.currentTimeMillis()
> (or)
> System.currentTimeMillis()*1000
> When I see the output through CQL, I get the data like below:
> 1.32725062505e+12
> Also, I am not able to use any operators against this (like > '01 January 2012' etc.,), I get the below error:
> No indexed columns present in by-columns clause with "equals" operator
> But, I have created an index for the timestamp column.
> Any help ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira