在cassandra CQL中获取数据问题

时间:2014-10-09 11:15:56

标签: php codeigniter cassandra

首先,我使用以下查询创建了一个列家族。

CREATE TABLE gb_adminusers 
    (au_id int,au_created_ip text,au_created_on text, au_email_address text,au_password text,
     au_status int, au_updated_on text,au_username text,PRIMARY KEY ((au_id))
    ) WITH bloom_filter_fp_chance=0.010000 AND caching='KEYS_ONLY' AND comment='' AND
         dclocal_read_repair_chance=0.100000 AND  gc_grace_seconds=864000 AND
         index_interval=128 AND read_repair_chance=0.000000 AND replicate_on_write='true' AND
         populate_io_cache_on_flush='false' AND  default_time_to_live=0 AND
         speculative_retry='99.0PERCENTILE' AND memtable_flush_period_in_ms=0 AND
         compaction={'class': 'SizeTieredCompactionStrategy'} AND
         compression={'sstable_compression': 'LZ4Compressor'};

然后成功插入了以下两行。

au_id | au_created_ip | au_created_on       | au_email_address   | au_password                      | au_status | au_updated_on | au_username-------+---------------+---------------------+--------------------+----------------------------------+-----------+---------------+------------
 1 |  192.168.2.69 | 2014-09-10 12:02:43 |  k2badmin@mail.com | f2c452187d4af19966187e15f1e944e1 |         1 |          null |    k2badmin
 2 |  192.168.2.68 | 2014-10-09 03:11:24 | testuser@gmail.com | 5d9c68c6c50ed3d02a2fcf54f63993b6 |         1 |          null |    testuser

当我尝试使用从表中获取结果时。我收到了以下警告。

A PHP Error was encountered
Severity: Warning
Message: unpack(): Type N: not enough input, need 4, have 1
Filename: Cassandra/DataStream.php
Line Number: 66
A PHP Error was encountered

Severity: Warning
Message: reset() expects parameter 1 to be array, boolean given
Filename: Cassandra/DataStream.php
Line Number: 66
A PHP Error was encountered.

我的结果集如下:

[rows:protected] => Array
    (
        [0] => Array
            (
                [0] => 
                [1] => 192.168.2.69
                [2] => 2014-09-10 12:02:43
                [3] => k2badmin@mail.com
                [4] => f2c452187d4af19966187e15f1e944e1
                [5] => 
                [6] => k2badmin192.168.2.682014-09-10 03:11:24testuser@mail.com 5d9c68c6c50ed3d02a2fcf54f63993b6ÿÿÿÿtestuse
                [7] => 
            )

        [1] => Array
            (
                [0] => 
                [1] => 
                [2] => 
                [3] => 
                [4] => 
                [5] => 
                [6] => 
                [7] => 
            )

    )

如何解决此问题。我正在使用https://github.com/mauritsl/php-cassandra包。

0 个答案:

没有答案