You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Gosar M <ko...@yahoo.com.INVALID> on 2018/08/22 21:22:19 UTC

duplicate rows for partition

Hello,
Have a table with following partition and clustering keys
partition key - ("userid", "secondaryid"), 
clustering key - "tDate", "tid3", "sid4", "pid5"
Data is inserted based on above partition and clustering key. For 1 record seeing 2 rows returned when queried by both partition and clustering key.

  userid      | secondaryid      | tdate               | tid3      | sid4 | pid5        | associate_degree
 ------------------------------------------+-----------------------------------------------------------------+ 
  090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34 | l34_listing |   123145979615694 
  090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34 | l34_listing |   123145979615694989

We did not had any node which was down longer than gc_grace_period. 


Thank you. 

Re: duplicate rows for partition

Posted by Marcus Olsson <ma...@ericsson.com>.
Hi,

I believe the "tDate" is stored with milliseconds precision which could explain why these duplicate dates are shown.

Could you try running the following query:
"SELECT userid, secondaryid, blobAsBigint(timestampAsBlob("tDate")), tid3, sid4, pid5, associate_degree FROM user_data;"

The "tDate" column should be shown with different values at that point.

Best Regards
Marcus Olsson

On ons, 2018-08-22 at 19:20 -0400, James Shaw wrote:
can you run this:
select associate_degree, writetime( associate_degree ) from user_data where ....

Thanks,

James

On Wed, Aug 22, 2018 at 7:13 PM, James Shaw <jx...@gmail.com>> wrote:
can you run this:
select writetime( associate_degree ) from user_data where ....
see what are writetime

On Wed, Aug 22, 2018 at 7:03 PM, James Shaw <jx...@gmail.com>> wrote:
interesting. what are insert statement and select statement ?

Thanks,

James

On Wed, Aug 22, 2018 at 6:55 PM, Gosar M <ko...@yahoo.com.invalid>> wrote:
CREATE TABLE user_data (
    "userid" text,
    "secondaryid" text,
    "tDate" timestamp,
    "tid3" text,
    "sid4" text,
    "pid5" text,
    associate_degree text
  PRIMARY KEY (("userid", "secondaryid"),"tDate", "tid3", "sid4", "pid5")
  WITH CLUSTERING ORDER BY ("tDate" ASC, "tid3" ASC, "sid4" ASC, "pid5" ASC)



On Wednesday, 22 August 2018, 15:08:03 GMT-7, dinesh.joshi@yahoo.com.INVALID <di...@yahoo.com>.INVALID> wrote:


What is the schema of the table? Could your include the output of DESCRIBE?

Dinesh


On Wednesday, August 22, 2018, 2:22:31 PM PDT, Gosar M <ko...@yahoo.com.INVALID> wrote:


Hello,

Have a table with following partition and clustering keys

partition key - ("userid", "secondaryid"),
clustering key - "tDate", "tid3", "sid4", "pid5"

Data is inserted based on above partition and clustering key. For 1 record seeing 2 rows returned when queried by both partition and clustering key.


 userid      | secondaryid      | tdate               | tid3      | sid4 | pid5        | associate_degree
 ------------------------------------------+-----------------------------------------------------------------+
  090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34 | l34_listing |   123145979615694
  090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34 | l34_listing |   123145979615694989


We did not had any node which was down longer than gc_grace_period.


Thank you.







Re: duplicate rows for partition

Posted by James Shaw <jx...@gmail.com>.
 can you run this:
select associate_degree, writetime( associate_degree ) from user_data where
....

Thanks,

James

On Wed, Aug 22, 2018 at 7:13 PM, James Shaw <jx...@gmail.com> wrote:

> can you run this:
> select writetime( associate_degree ) from user_data where ....
> see what are writetime
>
> On Wed, Aug 22, 2018 at 7:03 PM, James Shaw <jx...@gmail.com> wrote:
>
>> interesting. what are insert statement and select statement ?
>>
>> Thanks,
>>
>> James
>>
>> On Wed, Aug 22, 2018 at 6:55 PM, Gosar M <ko...@yahoo.com.invalid>
>> wrote:
>>
>>> CREATE TABLE user_data (
>>>     "userid" text,
>>>     "secondaryid" text,
>>>     "tDate" timestamp,
>>>     "tid3" text,
>>>     "sid4" text,
>>>     "pid5" text,
>>>     associate_degree text
>>>   PRIMARY KEY (("userid", "secondaryid"),"tDate", "tid3", "sid4",
>>> "pid5")
>>>   WITH CLUSTERING ORDER BY ("tDate" ASC, "tid3" ASC, "sid4" ASC, "pid5"
>>> ASC)
>>>
>>>
>>>
>>> On Wednesday, 22 August 2018, 15:08:03 GMT-7,
>>> dinesh.joshi@yahoo.com.INVALID <di...@yahoo.com.INVALID> wrote:
>>>
>>>
>>> What is the schema of the table? Could your include the output of
>>> DESCRIBE?
>>>
>>> Dinesh
>>>
>>>
>>> On Wednesday, August 22, 2018, 2:22:31 PM PDT, Gosar M
>>> <ko...@yahoo.com.INVALID> wrote:
>>>
>>>
>>> Hello,
>>>
>>> Have a table with following partition and clustering keys
>>>
>>> partition key - ("userid", "secondaryid"),
>>> clustering key - "tDate", "tid3", "sid4", "pid5"
>>>
>>> Data is inserted based on above partition and clustering key. For 1
>>> record seeing 2 rows returned when queried by both partition and clustering
>>> key.
>>>
>>>
>>>  userid      | secondaryid      | tdate               | tid3      | sid4
>>> | pid5        | associate_degree
>>>  ------------------------------------------+----------------
>>> -------------------------------------------------+
>>>   090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34
>>> | l34_listing |   123145979615694
>>>   090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34
>>> | l34_listing |   123145979615694989
>>>
>>>
>>> We did not had any node which was down longer than gc_grace_period.
>>>
>>>
>>> Thank you.
>>>
>>
>>
>

Re: duplicate rows for partition

Posted by James Shaw <jx...@gmail.com>.
can you run this:
select writetime( associate_degree ) from user_data where ....
see what are writetime

On Wed, Aug 22, 2018 at 7:03 PM, James Shaw <jx...@gmail.com> wrote:

> interesting. what are insert statement and select statement ?
>
> Thanks,
>
> James
>
> On Wed, Aug 22, 2018 at 6:55 PM, Gosar M <ko...@yahoo.com.invalid>
> wrote:
>
>> CREATE TABLE user_data (
>>     "userid" text,
>>     "secondaryid" text,
>>     "tDate" timestamp,
>>     "tid3" text,
>>     "sid4" text,
>>     "pid5" text,
>>     associate_degree text
>>   PRIMARY KEY (("userid", "secondaryid"),"tDate", "tid3", "sid4", "pid5")
>>   WITH CLUSTERING ORDER BY ("tDate" ASC, "tid3" ASC, "sid4" ASC, "pid5"
>> ASC)
>>
>>
>>
>> On Wednesday, 22 August 2018, 15:08:03 GMT-7,
>> dinesh.joshi@yahoo.com.INVALID <di...@yahoo.com.INVALID> wrote:
>>
>>
>> What is the schema of the table? Could your include the output of
>> DESCRIBE?
>>
>> Dinesh
>>
>>
>> On Wednesday, August 22, 2018, 2:22:31 PM PDT, Gosar M
>> <ko...@yahoo.com.INVALID> wrote:
>>
>>
>> Hello,
>>
>> Have a table with following partition and clustering keys
>>
>> partition key - ("userid", "secondaryid"),
>> clustering key - "tDate", "tid3", "sid4", "pid5"
>>
>> Data is inserted based on above partition and clustering key. For 1
>> record seeing 2 rows returned when queried by both partition and clustering
>> key.
>>
>>
>>  userid      | secondaryid      | tdate               | tid3      | sid4
>> | pid5        | associate_degree
>>  ------------------------------------------+----------------
>> -------------------------------------------------+
>>   090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34
>> | l34_listing |   123145979615694
>>   090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34
>> | l34_listing |   123145979615694989
>>
>>
>> We did not had any node which was down longer than gc_grace_period.
>>
>>
>> Thank you.
>>
>
>

Re: duplicate rows for partition

Posted by James Shaw <jx...@gmail.com>.
interesting. what are insert statement and select statement ?

Thanks,

James

On Wed, Aug 22, 2018 at 6:55 PM, Gosar M <ko...@yahoo.com.invalid>
wrote:

> CREATE TABLE user_data (
>     "userid" text,
>     "secondaryid" text,
>     "tDate" timestamp,
>     "tid3" text,
>     "sid4" text,
>     "pid5" text,
>     associate_degree text
>   PRIMARY KEY (("userid", "secondaryid"),"tDate", "tid3", "sid4", "pid5")
>   WITH CLUSTERING ORDER BY ("tDate" ASC, "tid3" ASC, "sid4" ASC, "pid5"
> ASC)
>
>
>
> On Wednesday, 22 August 2018, 15:08:03 GMT-7,
> dinesh.joshi@yahoo.com.INVALID <di...@yahoo.com.INVALID> wrote:
>
>
> What is the schema of the table? Could your include the output of DESCRIBE?
>
> Dinesh
>
>
> On Wednesday, August 22, 2018, 2:22:31 PM PDT, Gosar M
> <ko...@yahoo.com.INVALID> wrote:
>
>
> Hello,
>
> Have a table with following partition and clustering keys
>
> partition key - ("userid", "secondaryid"),
> clustering key - "tDate", "tid3", "sid4", "pid5"
>
> Data is inserted based on above partition and clustering key. For 1 record
> seeing 2 rows returned when queried by both partition and clustering key.
>
>
>  userid      | secondaryid      | tdate               | tid3      | sid4 |
> pid5        | associate_degree
>  ------------------------------------------+----------------
> -------------------------------------------------+
>   090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34 |
> l34_listing |   123145979615694
>   090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34 |
> l34_listing |   123145979615694989
>
>
> We did not had any node which was down longer than gc_grace_period.
>
>
> Thank you.
>

Re: duplicate rows for partition

Posted by Gosar M <ko...@yahoo.com.INVALID>.
CREATE TABLE user_data (
    "userid" text,
    "secondaryid" text,
    "tDate" timestamp,
    "tid3" text,
    "sid4" text,
    "pid5" text,
    associate_degree text
  PRIMARY KEY (("userid", "secondaryid"),"tDate", "tid3", "sid4", "pid5") 
  WITH CLUSTERING ORDER BY ("tDate" ASC, "tid3" ASC, "sid4" ASC, "pid5" ASC)



   On Wednesday, 22 August 2018, 15:08:03 GMT-7, dinesh.joshi@yahoo.com.INVALID <di...@yahoo.com.INVALID> wrote:  
 
 What is the schema of the table? Could your include the output of DESCRIBE?
Dinesh 

    On Wednesday, August 22, 2018, 2:22:31 PM PDT, Gosar M <ko...@yahoo.com.INVALID> wrote:  
 
 Hello,
Have a table with following partition and clustering keys
partition key - ("userid", "secondaryid"), 
clustering key - "tDate", "tid3", "sid4", "pid5"
Data is inserted based on above partition and clustering key. For 1 record seeing 2 rows returned when queried by both partition and clustering key.

  userid      | secondaryid      | tdate               | tid3      | sid4 | pid5        | associate_degree
 ------------------------------------------+-----------------------------------------------------------------+ 
  090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34 | l34_listing |   123145979615694 
  090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34 | l34_listing |   123145979615694989

We did not had any node which was down longer than gc_grace_period. 


Thank you. 
    

Re: duplicate rows for partition

Posted by "dinesh.joshi@yahoo.com.INVALID" <di...@yahoo.com.INVALID>.
What is the schema of the table? Could your include the output of DESCRIBE?
Dinesh 

    On Wednesday, August 22, 2018, 2:22:31 PM PDT, Gosar M <ko...@yahoo.com.INVALID> wrote:  
 
 Hello,
Have a table with following partition and clustering keys
partition key - ("userid", "secondaryid"), 
clustering key - "tDate", "tid3", "sid4", "pid5"
Data is inserted based on above partition and clustering key. For 1 record seeing 2 rows returned when queried by both partition and clustering key.

  userid      | secondaryid      | tdate               | tid3      | sid4 | pid5        | associate_degree
 ------------------------------------------+-----------------------------------------------------------------+ 
  090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34 | l34_listing |   123145979615694 
  090sdfdsf898 | ab984564 | 2018-08-04 07:59:59+0000 | 0a5995672e3 | l34 | l34_listing |   123145979615694989

We did not had any node which was down longer than gc_grace_period. 


Thank you.