在cassandra CQL中获取数据问题

First I created a columnfamily using below query.

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'};

Then successfully inserted the below two rows.

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

When I am trying to use fetch the results from table.I got the below warnings.

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.

And my result set is like below:

[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] => 
            )

    )

)

How can I fix this issue. I am using https://github.com/mauritsl/php-cassandra package.

douci1677
douci1677 下面我提到第66行:returnreset(unpack('N',$this->read(4)));问题是当列包含null时,它不会占用该列并产生错误。
接近 6 年之前 回复
doudieyou5209
doudieyou5209 你能提供错误的代码吗?具体来说,第66行......
接近 6 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐