开发者社区> 问答> 正文

给hbase的表创建phoenix映射之后再phoenix里面查询的时候包这个错

Hbase创建行程表
create 'MAPBAR_CARTRAVEL',{'NAME'=>'carTrack', 'COMPRESSION'=>'SNAPPY'},{'NAME'=>'carTravel', 'COMPRESSION'=>'SNAPPY'}, {'NAME'=>'originalData', 'COMPRESSION'=>'SNAPPY'},{SPLITS_FILE=>'region_split_info.txt'}

表结构
{NAME => 'carTrack', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'SNAPPY', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}
{NAME => 'carTravel', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'SNAPPY', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}
{NAME => 'originalData', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'SNAPPY', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}

phoenix创建Hbase行程映射表
create table "MAPBAR_CARTRAVEL"("ROW" varchar primary key, "carTrack"."lonlat" varchar,"carTrack"."roadTime" varchar,"carTrack"."speed" varchar,"carTrack"."hdop" varchar,"carTrack"."dire" varchar,"carTrack"."altitude" varchar,"carTravel"."name" varchar,"carTravel"."distance" varchar,"carTravel"."tratime" varchar,"carTravel"."avgSpeed" varchar,"carTravel"."maxSpeed" varchar,"carTravel"."overSpeed" varchar,"carTravel"."brake" INTEGER,"carTravel"."swerve" INTEGER,"carTravel"."speedUp" INTEGER,"originalData"."tid" varchar);

错误:
0: jdbc:phoenix:192.168.145.80:2181> select * from MAPBAR_CARTRAVEL;
Error: ERROR 201 (22000): Illegal data. Expected length of at least 4 bytes, but had 1 (state=22000,code=201)
java.sql.SQLException: ERROR 201 (22000): Illegal data. Expected length of at least 4 bytes, but had 1
at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:422)
at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)
at org.apache.phoenix.schema.KeyValueSchema.next(KeyValueSchema.java:211)
at org.apache.phoenix.expression.ProjectedColumnExpression.evaluate(ProjectedColumnExpression.java:115)
at org.apache.phoenix.compile.ExpressionProjector.getValue(ExpressionProjector.java:69)
at org.apache.phoenix.jdbc.PhoenixResultSet.getObject(PhoenixResultSet.java:524)
at sqlline.Rows$Row.(Rows.java:157)
at sqlline.BufferedRows.(BufferedRows.java:38)
at sqlline.SqlLine.print(SqlLine.java:1650)
at sqlline.Commands.execute(Commands.java:833)
at sqlline.Commands.sql(Commands.java:732)
at sqlline.SqlLine.dispatch(SqlLine.java:808)
at sqlline.SqlLine.begin(SqlLine.java:681)
at sqlline.SqlLine.start(SqlLine.java:398)
at sqlline.SqlLine.main(SqlLine.java:292)
0: jdbc:phoenix:192.168.145.80:2181>

展开
收起
hbase小能手 2018-11-08 10:47:53 7589 0
1 条回答
写回答
取消 提交回答
  • 社区管理员

    phoenix映射存在的hbase表部分数字类型和日期类型需要使用unsigned类型。此处报错是数据反序列化二进制时出错。

    2019-07-17 23:12:53
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
大数据时代的存储 ——HBase的实践与探索 立即下载
Hbase在滴滴出行的应用场景和最佳实践 立即下载
阿里云HBase主备双活 立即下载