hi、phoenix文档中数据类型部分有描述兼容现有hbase类型的类型,你可以看一下,就是名字有些区别
TonyChen <tonychen0...@qq.com> 于2020年10月10日周六 下午5:02写道: > 好的,我理解您的意思是: > 1,目前我的数据已经写到hbase中,只是phoenix在获取数据的时候反序列化存在问题。 > > scan 'ods_iot_gasdevice' > ROW COLUMN+CELL > 2900 column=base_info:device_id, > timestamp=1602319974755, value=\x00\x00\x0BT > 2900 column=base_info:verify_code, > timestamp=1602319974755, value=6682acbe69c1a14 > 2900 column=status_info:battery_power, > timestamp=1602319974755, value=\x00\x00\x00= > 2900 column=status_info:device_status, > timestamp=1602319974755, value=\x00\x00\x00\x02 > 2900 > column=time_characteristics:create_time, timestamp=1602319974755, > value=\x00\x00\x01u\x13m\xC9D > > 2. 我改用hbase shell建库。 > create 'ods_iot_gasdevice', 'base_info', 'status_info', > ‘time_characteristics' > 然后flink写入数据,最后在建立phoenix映射。 > CREATE TABLE IF NOT EXISTS "ods_iot_gasdevice"( > "rowkey" varchar not null primary key, > "base_info"."device_id" BIGINT, > "base_info"."verify_code" varchar, > "status_info"."battery_power" BIGINT, > "status_info"."device_status" BIGINT, > "time_characteristics"."create_time" varchar > ); > 在这样操作之后,phoenix获取数据仍是之前的现象。我已经用了最基本的数据类型。怎么判定哪些数据类型phoenix类型和hbase类型是兼容的? > > 谢谢 > > Best, > TonyChen > > > 2020年10月10日 下午4:31,Dream-底限 <zhan...@akulaku.com> 写道: > > > > hi、phoenix类型和hbase类型有一部分不兼容:1、使用phoenix建表并通过phoenix jdbc插入数据;2、使用hbase > > api建表并插入数据,然后phoenix映射到现有hbase表;现在是数据通过hbase > > api存到hbase了,但phoenix反序列化读取时候有问题,或者你建phoenix表的时候数据类型选择兼容hbase原始类型的类型 > > > > > > TonyChen <tonychen0...@qq.com> 于2020年10月10日周六 下午4:25写道: > > > >> 我这个表就是用 phoenix 创建的。。 > >> > >> > >> Best, > >> TonyChen > >> > >>> 2020年10月10日 下午4:11,Dream-底限 <zhan...@akulaku.com> 写道: > >>> > >>> hi、phoenix要映射现有hbase表,改一下phoenix建标语句应该可以解决 > >>> > >>> TonyChen <tonychen0...@qq.com> 于2020年10月10日周六 下午4:03写道: > >>> > >>>> 查了下 > >>>> > >>>> hbase(main):011:0> get 'ods_iot_gasdevice', '2900' > >>>> COLUMN CELL > >>>> base_info:device_id timestamp=1602314819543, > >>>> value=\x00\x00\x0BT > >>>> base_info:verify_code timestamp=1602314819543, > >>>> value=54976e8caf8f524 > >>>> status_info:battery_power timestamp=1602314819543, > >>>> value=\x00\x00\x00T > >>>> status_info:device_status timestamp=1602314819543, > >>>> value=\x00\x00\x00\x02 > >>>> time_characteristics:create_time timestamp=1602314819543, > >>>> value=\x00\x00\x01u\x13\x1F\x1Fv > >>>> 1 row(s) in 0.1950 seconds > >>>> > >>>> > >>>> Best, > >>>> TonyChen > >>>> > >>>>> 2020年10月10日 下午3:51,Jark Wu <imj...@gmail.com> 写道: > >>>>> > >>>>> 我看你是在 phoenix 中查询的,有试过在 hbase shell 中查询吗? > >>>>> > >>>>> On Sat, 10 Oct 2020 at 15:36, TonyChen <tonychen0...@qq.com> wrote: > >>>>> > >>>>>> 补充下:print输出数据正常 > >>>>>> > >>>>>> 11> +I(2910,2910,c514eecbc5c4748,9,1,2020-10-10T15:26:48.182) > >>>>>> 12> +I(2911,2911,0d1508ec452d27e,68,4,2020-10-10T15:26:48.182) > >>>>>> 3> +I(2902,2902,54976e60b7e8f54,83,1,2020-10-10T15:26:48.182) > >>>>>> 5> +I(2904,2904,72806e351aa5849,75,1,2020-10-10T15:26:48.182) > >>>>>> 8> +I(2907,2907,1f17c8000abc9e1,38,2,2020-10-10T15:26:48.182) > >>>>>> 1> +I(2900,2900,54976e8caf8f524,84,2,2020-10-10T15:26:48.182) > >>>>>> 6> +I(2905,2905,70852c245fbd949,45,3,2020-10-10T15:26:48.182) > >>>>>> 10> +I(2909,2909,22854c002e08c80,48,2,2020-10-10T15:26:48.182) > >>>>>> 2> +I(2901,2901,4110ae7bfd85814,58,2,2020-10-10T15:26:48.182) > >>>>>> 9> +I(2908,2908,e5074eeedcaea14,46,3,2020-10-10T15:26:48.182) > >>>>>> 4> +I(2903,2903,cc936a01758c0f3,6,4,2020-10-10T15:26:48.182) > >>>>>> 7> +I(2906,2906,30864c59367e180,50,4,2020-10-10T15:26:48.182) > >>>>>> 7> +I(2918,2918,90bbe8079999fd5,7,4,2020-10-10T15:26:49.178) > >>>>>> 9> +I(2920,2920,7e2f257406c730f,54,4,2020-10-10T15:26:49.178) > >>>>>> 4> +I(2915,2915,b4f2549ea4436b7,60,2,2020-10-10T15:26:49.178) > >>>>>> 11> +I(2922,2922,d7bfa14a1a9555f,6,1,2020-10-10T15:26:49.178) > >>>>>> 6> +I(2917,2917,9515c66bb40527b,78,1,2020-10-10T15:26:49.178) > >>>>>> 12> +I(2923,2923,8f4535a229b3a32,1,1,2020-10-10T15:26:49.178) > >>>>>> 5> +I(2916,2916,093037cdc5acec9,50,4,2020-10-10T15:26:49.178) > >>>>>> 2> +I(2913,2913,2842267351e9487,55,2,2020-10-10T15:26:49.178) > >>>>>> 10> +I(2921,2921,7704923d1f5042b,33,4,2020-10-10T15:26:49.178) > >>>>>> 1> +I(2912,2912,eba073be1b6f4b2,72,2,2020-10-10T15:26:49.178) > >>>>>> 8> +I(2919,2919,dd4ae09e50859b9,3,3,2020-10-10T15:26:49.178) > >>>>>> 3> +I(2914,2914,49655f1ca53e26e,24,2,2020-10-10T15:26:49.178) > >>>>>> 11> +I(2934,2934,3a00563a0ecaf6b,57,2,2020-10-10T15:26:50.173) > >>>>>> 9> +I(2932,2932,9a67d05622a57ae,54,1,2020-10-10T15:26:50.173) > >>>>>> 4> +I(2927,2927,c6db9148eeddd51,26,1,2020-10-10T15:26:50.173) > >>>>>> 5> +I(2928,2928,ae06b971bdeaff4,35,1,2020-10-10T15:26:50.173) > >>>>>> 1> +I(2924,2924,176b97cbb37b8e6,62,1,2020-10-10T15:26:50.173) > >>>>>> 6> +I(2929,2929,115d2d3f33188a6,62,2,2020-10-10T15:26:50.173) > >>>>>> 2> +I(2925,2925,3f3db2f63e505c7,86,4,2020-10-10T15:26:50.173) > >>>>>> 3> +I(2926,2926,d88f38f093f274d,55,1,2020-10-10T15:26:50.173) > >>>>>> 12> +I(2935,2935,56d5fbf93fd515d,72,1,2020-10-10T15:26:50.173) > >>>>>> 8> +I(2931,2931,dd98a2999028a83,59,1,2020-10-10T15:26:50.173) > >>>>>> 10> +I(2933,2933,377ec5fa4e52ca3,28,1,2020-10-10T15:26:50.173) > >>>>>> 7> +I(2930,2930,d2e93ff01ba5d2b,18,1,2020-10-10T15:26:50.174) > >>>>>> 9> +I(2944,2944,8589c30a128c7eb,45,3,2020-10-10T15:26:51.173) > >>>>>> 1> +I(2936,2936,d536e4d1703d20c,98,3,2020-10-10T15:26:51.173) > >>>>>> 5> +I(2940,2940,8fd48a674b19424,10,2,2020-10-10T15:26:51.173) > >>>>>> 11> +I(2946,2946,862c6321430e164,74,1,2020-10-10T15:26:51.173) > >>>>>> 2> +I(2937,2937,d177b845862342f,83,3,2020-10-10T15:26:51.173) > >>>>>> 6> +I(2941,2941,7c45b6f1ae69811,86,1,2020-10-10T15:26:51.173) > >>>>>> 4> +I(2939,2939,8db073425a9d0a9,81,1,2020-10-10T15:26:51.173) > >>>>>> 8> +I(2943,2943,b0d63314e8f7c63,57,1,2020-10-10T15:26:51.173) > >>>>>> 10> +I(2945,2945,384375f5f161a93,67,2,2020-10-10T15:26:51.173) > >>>>>> 12> +I(2947,2947,7a7ed532a9e5b5a,61,4,2020-10-10T15:26:51.173) > >>>>>> 3> +I(2938,2938,10e55f27f137a7f,22,4,2020-10-10T15:26:51.173) > >>>>>> 7> +I(2942,2942,52ae903a2633739,91,1,2020-10-10T15:26:51.176) > >>>>>> 3> +I(2950,2950,e3e60cd0630aa66,88,4,2020-10-10T15:26:52.174) > >>>>>> 1> +I(2948,2948,2cca133cca14cbf,44,1,2020-10-10T15:26:52.174) > >>>>>> 2> +I(2949,2949,7cc761cdb8bb924,77,4,2020-10-10T15:26:52.174) > >>>>>> > >>>>>> > >>>>>> Best, > >>>>>> TonyChen > >>>>>> > >>>>>> > >>>> > >>>> > >> > >> > >