dpafea04148 2014-10-09 11:15
浏览 36

在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.

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 outlook无法配置成功
    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题