You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/02/19 11:36:18 UTC
[jira] [Commented] (DRILL-4346) NumberFormatException when casting
empty string to int in hbase/maprdb
[ https://issues.apache.org/jira/browse/DRILL-4346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15154061#comment-15154061 ]
ASF GitHub Bot commented on DRILL-4346:
---------------------------------------
GitHub user vdiravka opened a pull request:
https://github.com/apache/drill/pull/384
DRILL-4346: Handle NumberFormatException when casting empty string to int in hbase/maprdb
- Made replacing of functions casting for nullable input varbinary and var16char types are working (in CastFunctions.java setting 'drill.exec.functions.cast_empty_string_to_null = true' didn't work);
- Added new generated classes for casting varbinary and var16char to int (CastEmptyStringVarTypesToNullableNumeric template and Casts.tdd data);
- Created a test (in TestHBaseQueries.java) for checking an empty string to integer casting in maprdb/hbase table;
- Small design changes according to comments in review (import statements, prefixes ...).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/vdiravka/drill DRILL-4346
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/drill/pull/384.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #384
----
commit d7e0e3d45956506aae2c6a54cf39abaa1df9dc9b
Author: vataga <vi...@mail.ru>
Date: 2016-02-02T11:18:49Z
DRILL-4346: Handle NumberFormatException when casting empty string to int in hbase/maprdb
- Made replacing of functions casting for nullable input varbinary and var16char types are working (in CastFunctions.java setting 'drill.exec.functions.cast_empty_string_to_null = true' didn't work);
- Added new generated classes for casting varbinary and var16char to int (CastEmptyStringVarTypesToNullableNumeric template and Casts.tdd data);
- Created a test (in TestHBaseQueries.java) for checking an empty string to integer casting in maprdb/hbase table;
- Small design changes according to comments in review (import statements, prefixes ...).
----
> NumberFormatException when casting empty string to int in hbase/maprdb
> ----------------------------------------------------------------------
>
> Key: DRILL-4346
> URL: https://issues.apache.org/jira/browse/DRILL-4346
> Project: Apache Drill
> Issue Type: Bug
> Components: Functions - Drill
> Affects Versions: 1.2.0
> Reporter: Vitalii Diravka
> Assignee: Vitalii Diravka
>
> Queries to null values in HBase with no data when casting to Integer results in NumberFormatException:
> {code}
> Data
> row1,1,2
> row2,,4
> row3,5,6
> row4,7,8
> Create Table
> $ maprcli table create -path /user/cmatta/projects/cmatta_test
> $ maprcli table cf create -path /user/cmatta/projects/cmatta_test -cfname a
> Load into Hbase table:
> hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=',' -Dimporttsv.columns=HBASE_ROW_KEY,a:c1,a:c2 /user/cmatta/projects/cmatta_test maprfs:///user/cmatta/projects/testdata_hbase_null
> {code}
> {code}
> 0: jdbc:drill:> select cast(x.`row_key` as varchar(128)) as `row_key`, CAST(x.`a`.`c1` as INTEGER) from maprfs.cmatta.`cmatta_test` x;
> Error: SYSTEM ERROR: NumberFormatException:
> Fragment 0:0
> [Error Id: 05a0e5ed-d830-4926-a442-569c9d70d0b4 on se-node11.se.lab:31010] (state=,code=0)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)