You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "John Omernik (JIRA)" <ji...@apache.org> on 2016/04/20 18:45:25 UTC
[jira] [Commented] (DRILL-4620) Drill query Hbase table got base64
encoded results while Hbase Shell show table content correctly
[ https://issues.apache.org/jira/browse/DRILL-4620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15250228#comment-15250228 ]
John Omernik commented on DRILL-4620:
-------------------------------------
I see someone closed this as not a bug already. But more details here:
https://drill.apache.org/docs/querying-hbase/
This is how HBASE data is returned to Drill, you can create a view to change how's returned to the user like this
CREATE VIEW view_hbase_table as
SELECT CONVERT_FROM(row_key, 'UTF8') AS rowkey,
CONVERT_FROM(cf1.c1, 'UTF8') AS c1,
CONVERT_FROM(cf1.c2, 'UTF8') AS c2,
CONVERT_FROM(cf2.c3, 'UTF8') AS c3,
CONVERT_FROM(cf3.c1, 'UTF8') AS c4
FROM `hbase_table`;
Then selecting from the view will show the correct data. If you do maprdb, then instead of hbase_table, you'd have /path/to/maprdb_table.
> Drill query Hbase table got base64 encoded results while Hbase Shell show table content correctly
> --------------------------------------------------------------------------------------------------
>
> Key: DRILL-4620
> URL: https://issues.apache.org/jira/browse/DRILL-4620
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Chunhui Shi
>
> Create a table using hbase shell following the steps in https://www.mapr.com/blog/secondary-indexing-mapr-db-using-elasticsearch. However query the generated table in drill showing base64 encoded results but not the correct plaintext. As shown below:
> [root@atsqa4-128 ~]# hbase shell
> HBase Shell; enter 'help<RETURN>' for list of supported commands.
> Type "exit<RETURN>" to leave the HBase Shell
> Version 0.98.12-mapr-1602, rcf7a299d9b0a24150d4a13cbce7fc9eac9b2404d, Tue Mar 1 19:32:45 UTC 2016
> Not all HBase shell commands are applicable to MapR tables.
> Consult MapR documentation for the list of supported commands.
> hbase(main):001:0> scan '/user/person'
> ROW COLUMN+CELL
> 1 column=details:address, timestamp=1461110148447, value=350 Holger Way
> 1 column=details:fname, timestamp=1461110112541, value=Tom
> 1 column=details:lname, timestamp=1461110121828, value=John
> 2 column=details:address, timestamp=1461110227143, value=340 Holger Way
> 2 column=details:fname, timestamp=1461110171622, value=David
> 2 column=details:lname, timestamp=1461110189721, value=Robert
> 3 column=details:address, timestamp=1461110282174, value=310 Holger Way
> 3 column=details:fname, timestamp=1461110248477, value=Samuel
> 3 column=details:lname, timestamp=1461110268460, value=Trump
> 4 column=details:address, timestamp=1461110355548, value=100 Zanker Ave
> 4 column=details:fname, timestamp=1461110307194, value=Christina
> 4 column=details:lname, timestamp=1461110332695, value=Rogers
> 4 row(s) in 0.1380 seconds
> hbase(main):002:0> exit
> [root@atsqa4-128 ~]# /opt/mapr/drill/drill-1.7.0/bin/sqlline -u "jdbc:drill:zk=10.10.88.125:5181"
> apache drill 1.7.0-SNAPSHOT
> "what ever the mind of man can conceive and believe, drill can query"
> 0: jdbc:drill:zk=10.10.88.125:5181> select * from hbase.`/user/person`;
> +--------------+-------------------------------------------------------------------------------+
> | row_key | details |
> +--------------+-------------------------------------------------------------------------------+
> | [B@5eb1ea22 | {"address":"MzUwIEhvbGdlciBXYXk=","fname":"VG9t","lname":"Sm9obg=="} |
> | [B@31cf2fc4 | {"address":"MzQwIEhvbGdlciBXYXk=","fname":"RGF2aWQ=","lname":"Um9iZXJ0"} |
> | [B@19490668 | {"address":"MzEwIEhvbGdlciBXYXk=","fname":"U2FtdWVs","lname":"VHJ1bXA="} |
> | [B@943a2d0 | {"address":"MTAwIFphbmtlciBBdmU=","fname":"Q2hyaXN0aW5h","lname":"Um9nZXJz"} |
> +--------------+-------------------------------------------------------------------------------+
> 4 rows selected (4.097 seconds)
> 0: jdbc:drill:zk=10.10.88.125:5181>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)