Member since
01-28-2016
8
Posts
7
Kudos Received
0
Solutions
02-09-2016
07:20 PM
Thank you very much Enis!
... View more
02-09-2016
02:51 PM
1 Kudo
@Enis I think I finally understand your reply. For float serialized in HBase, if the float are non-negative, map it to Phoenix Unsigned_Float, you will get correct value in Phoenix. If float serialized in HBase can be negative, if I map it to FLOAT in Phoenix, I got wrong value because of different encoding method. If I map to to Unsigned_Float, then I got run time Exception( java.sql.SQLException: ERROR 201 (22000): Illegal data.) when I try to get a negative value. So, seems there is no way to properly handle existing negative float value serialized by HBase in Phoenix. Am I right?
... View more
02-08-2016
09:56 PM
1 Kudo
One more information, these data was bulk loaded into HBase from CSV files. I verified CSV file, Hbase shell is returning the correct value. During bulk load process, Bytes.toBytes(float) was used to serialize all float type values.
... View more
02-08-2016
09:11 PM
1 Kudo
I am using Bytes class to serialize float. And pay attention How I get it from Hbase shell, I am telling HBase shell that the column d:temp is a float and use toFloat to deserialize it get'wanghai:obsweather','AP611_mesonet|2014-02-01 00:01:30','d:temp:toFloat'
... View more
02-08-2016
08:11 PM
1 Kudo
Can you please elaborate on the encoding of float is different? I did not see that in Phoenix manual. The most important thing, How do I handle this to make phoenix useful for float value in my Hbase table? It would be useless if I can not see the correct value in Phoenix. Is there any configuration to tweak?
... View more
02-08-2016
07:58 PM
3 Kudos
I have created a view to map to an existing HBase table as following: create view "wanghai:obsweather"(pk VARCHAR primary key,
"d"."stationid" VARCHAR,
"d"."temp" Float,
...); In Hbase shell, my query on a row/column yields the following: hbase(main):004:0> get 'wanghai:obsweather', 'AP611_mesonet|2014-02-01 00:01:30', 'd:temp:toFloat'
COLUMN CELL
d:temp timestamp=1454132157194, value=274.261108398437
1 row(s) in 0.0210 seconds In Phoenix sqlline.py, I got the following: 0: jdbc:phoenix:localhost:2181:/hbase-unsecur> select pk, "d"."stationid", "d"."temp" from "wanghai:obsweather"
. . . . . . . . . . . . . . . . . . . . . . .> where pk='AP611_mesonet|2014-02-01 00:01:30';
'PK','stationid','temp'
'AP611_mesonet|2014-02-01 00:01:30','AP611_mesonet','-0.015067715'
1 row selected (0.11 seconds) Any idea for the same (row, cf:q), why I get "274.2611" from Hbase shell, but "-0.015067715" in Phoenix? What is wrong?
... View more
Labels:
- Labels:
-
Apache HBase
-
Apache Phoenix
02-01-2016
06:47 PM
Check out this URL https://hbase.apache.org/book.html#hbase.mapreduce.classpath You need to add certain jars to HADOOP_CLASSPATH when you launch your map reduce job using either hadoop or yarn command.
... View more