cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lijun Huang <coder...@gmail.com>
Subject Re: How to insert "Empty" timeuuid by Cql
Date Thu, 20 Oct 2016 02:19:28 GMT
Hi Vladimir,

Indeed, that's a little weird, I think it is like a empty string: '' but is
a timeuuid value. We have many such records that inserted by Astyanax API,
when we select it in cqlsh, it is like as below, note the column4 is
timeuuid, it is not null or some value, just "empty".

key              | column1      | column2 | column3 | column4 | value
------------------+--------------------+------------+------------
+------------+----------------------
test by thrift | accessState |              |              |              |
0x5

But when we use Cql, we couldn't set this empty value, it is null or
explicit value, like below,

key              | column1      | column2 | column3 | column4  | value
------------------+-------------------+--
-----------+-------------+--------------+----------------------
 test by cql   | accessState |              |             |  null         |
0x5

key              | column1      | column2 | column3 |
column4                              | value
-------------------+------------------+--
------------+------------+-----------------------------------------------------------+-
--------------------------------
 test by cql   | accessState |              |             |
4a528300-95cb-11e6-8650-0242f5eaa8c3| 0x5

I don't know whether you could understand now, if not I could provide some
code related to Astyanax. Really appreciate your help.


On Wed, Oct 19, 2016 at 9:53 PM, Vladimir Yudovin <vladyu@winguzone.com>
wrote:

> Hi,
>
> what does it exactly mean 'empty timeuuid'?  UUID takes 16 bytes for
> storage, so it should be either null, or some value. Do you mean 'zero'
> UUID?
>
> Best regards, Vladimir Yudovin,
>
> *Winguzone <https://winguzone.com?from=list> - Hosted Cloud
> CassandraLaunch your cluster in minutes.*
>
>
> ---- On Wed, 19 Oct 2016 09:16:29 -0400*coderhlj <coderhlj@gmail.com
> <coderhlj@gmail.com>>* wrote ----
>
> Hi all,
>
> We use Cassandra 2.1.11 in our product, and we update the Java Drive from
> Astyanax(Thrift API) to DataStax Java Driver(Cql) recently, but we
> encounter a difficult issue as following, please help us, thanks in advance.
>
> Previously we were using Astyanax API, and we can insert empty timeuuid
> like below, but now we can only insert null timeuuid by cql command but not
> empty one. Is there any cql function to insert an empty timeuuid like by
> Astyanax?
> And this cause a tough problem is that we can not delete the record by
> specifying the primary key, like:
> *delete from "Foo" where column1='test' and column2='accessState' and
> column3='' and column4=(need fill empty uuid here) IF EXISTS;*
>
> key              | column1      | column2 | column3 | column4 | value
> -------------+-------------+---------+---------
> +---------+----------------------
> test by thrift | accessState |              |              |              |
> 0x5
>
> key              | column1      | column2 | column3 | column4  | value
> -------------+-------------+---------+---------+----------+-
> ---------------------
>  test by cql   | accessState |              |             |  null         |
> 0x5
>
>
> cqlsh:StorageOS> desc table "Foo";
>
> CREATE TABLE "Foo" (
>   key text,
>   column1 text,
>   column2 text,
>   column3 text,
>   column4 timeuuid,
>   value blob,
>   PRIMARY KEY (key, column1, column2, column3, column4)
> ) WITH COMPACT STORAGE AND
>   bloom_filter_fp_chance=0.010000 AND
>   caching='{"keys":"ALL", "rows_per_partition":"NONE"}' AND
>   comment='' AND
>   dclocal_read_repair_chance=0.100000 AND
>   gc_grace_seconds=432000 AND
>   read_repair_chance=0.000000 AND
>   default_time_to_live=0 AND
>   speculative_retry='NONE' AND
>   memtable_flush_period_in_ms=0 AND
>   compaction={'class': 'SizeTieredCompactionStrategy'} AND
>   compression={'sstable_compression': 'LZ4Compressor'};
>
> ------------------
> Thanks,
> Lijun Huang
>
>
>


-- 
Best regards,
Lijun Huang

Mime
View raw message