[ 
https://issues.apache.org/jira/browse/DRILL-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14085373#comment-14085373
 ] 

Mehant Baid commented on DRILL-1251:
------------------------------------

The problem is that the CSV file includes a header indicating the column names 
which gets inserted in HBase as is. After importing the csv into HBase when I 
execute the following command on hbase shell
get 'products', 'prod_id'  I get back rows corresponding to this row_key.

In the query to Drill we are trying to cast row_key as an integer and it fails 
with NumberFormatException on this particular row. Removing the header from csv 
file, importing into hbase again and performing the query works fine. 

> SQLException error when performing select against HBASE table
> -------------------------------------------------------------
>
>                 Key: DRILL-1251
>                 URL: https://issues.apache.org/jira/browse/DRILL-1251
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - HBase
>         Environment: 5-node mapR cluster, hbase 0.94.17 installed.
>            Reporter: Andy Pernsteiner
>         Attachments: hbase.sh, products.csv
>
>
> When attempting to query a 965 row HBASE table, I'm seeing an SQLException 
> error after 843 lines are output.  CSV file and importtsv script are attached 
> to this JIRA.  I've tried removing any possible offending characters, to no 
> avail.
> Here's the query:
> {code}
> select cast (row_key as int) as prod_id, cast
> (t.details.name as varchar(20)) as name, cast
> (t.details.category as varchar(20)) as category, cast
> (t.pricing.price as varchar(20)) as price
>  from
> hbase.`products` t;
> {code}
> And the output:
> {code}
> | 818        | Staples 6 Outlet Sur | Appliances | 12         |
> +------------+------------+------------+------------+
> |  prod_id   |    name    |  category  |   price    |
> +------------+------------+------------+------------+
> | 819        | Staples Battery-Oper | Pens & Art Supplies | 10         |
> | 82         | Avery 05222 Permanen | Labels     | 4          |
> | 820        | Staples Brown Kraft  | Envelopes  | 6          |
> | 821        | Staples Bulldog Clip | Rubber Bands | 4          |
> | 822        | Staples Colored Inte | Envelopes  | 31         |
> | 823        | Staples File Caddy | Storage & Organizati | 9          |
> | 824        | Staples� General Use | Binders and Binder A | 2          |
> | 825        | *Staples* Highlighti | Pens & Art Supplies | 5          |
> | 826        | *Staples* Letter Ope | ScissorsRulers and T | 2          |
> | 827        | Staples Metal Binder | Rubber Bands | 3          |
> | 828        | *Staples* Packaging  | Labels     | 3          |
> | 829        | Staples Pen Style Li | Pens & Art Supplies | 6          |
> | 83         | Avery� 3 1/2 Diskett | Binders and Binder A | 10         |
> | 830        | Staples Plastic Wall | Office Furnishings | 48         |
> | 831        | Staples Plastic Wall | Office Furnishings | 8          |
> | 832        | Staples Pushpins | Rubber Bands | 2          |
> | 833        | Staples SlimLine Pen | Pens & Art Supplies | 12         |
> | 834        | Staples Standard Env | Envelopes  | 6          |
> | 835        | Staples Surge Protec | Appliances | 11         |
> | 836        | *Staples* vLetter Op | ScissorsRulers and T | 4          |
> | 837        | Steel Personal Filin | Storage & Organizati | 36         |
> | 838        | Sterling Rubber Band | Rubber Bands | 5          |
> | 839        | Stockwell Push Pins | Rubber Bands | 2          |
> | 84         | Avery 4027 File Fold | Labels     | 31         |
> | 840        | Storex Dura Pro� Bin | Binders and Binder A | 6          |
> | 841        | Storex DuraTech Recy | Binders and Binder A | 4          |
> | 842        | Super Bands12/Pack | Rubber Bands | 2          |
> | 843        | Super Decoflex Porta | Storage & Organizati | 15         |
> java.lang.RuntimeException: java.sql.SQLException: Failure while trying to 
> get next result batch.
>       at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514)
>       at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2148)
>       at sqlline.SqlLine.print(SqlLine.java:1809)
>       at sqlline.SqlLine$Commands.execute(SqlLine.java:3766)
>       at sqlline.SqlLine$Commands.sql(SqlLine.java:3663)
>       at sqlline.SqlLine.dispatch(SqlLine.java:889)
>       at sqlline.SqlLine.begin(SqlLine.java:763)
>       at sqlline.SqlLine.start(SqlLine.java:498)
>       at sqlline.SqlLine.main(SqlLine.java:460)
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to