drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Barclay (Drill) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DRILL-2471) JDBC : ResultSet.getXXX should return 0 when we encounter null for primitives which are numeric
Date Fri, 27 Mar 2015 22:08:52 GMT

     [ https://issues.apache.org/jira/browse/DRILL-2471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Barclay (Drill) resolved DRILL-2471.
-------------------------------------------
    Resolution: Fixed

> JDBC : ResultSet.getXXX should return 0 when we encounter null for primitives which are
numeric
> -----------------------------------------------------------------------------------------------
>
>                 Key: DRILL-2471
>                 URL: https://issues.apache.org/jira/browse/DRILL-2471
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>            Reporter: Rahul Challapalli
>            Assignee: Daniel Barclay (Drill)
>             Fix For: 0.9.0
>
>
> git.commit.id.abbrev=7b4c887
> I used the below query through JDBC to see how it behaves. From sqlline we get back all
nulls
> {code}
> select cast(null as int) as int_null, cast(null as bigint) as bigint_null, cast(null
as date) as date_null, cast(null as time) time_null, cast(null as timestamp) timestamp_null,
cast(null as varchar) as varchar_null, cast(null as double) as double_null, cast(null as float)
as float_null, cast(null as boolean) as boolean_null from dfs.jdbctesting.`fewtypes_null.parquet`
> {code}
> I used the below code to access the results
> {code}
> while (rs.next()) {
>     System.out.print("  " + rs.getInt(1));
>     System.out.print("  " + rs.getLong(2));
>     System.out.print("      " + rs.getDate(3));
>     System.out.print("      " + rs.getTime(4));
>     System.out.print("      " + rs.getTimestamp(5));
>     System.out.print("      " + rs.getString(6));
>     System.out.print("      " + rs.getDouble(7));
>      System.out.print("      " + rs.getFloat(8));
> }
> {code}
> Output :
> {code}
> 	7	4689679848943082537	null	null	null		-3.290061219836685E278	6.833468E-39
> 	892875088	4693955415459489645	null	null	null		-3.95183706712737E-209	6.83356E-39
> 	155464248	4687298138466757168	null	null	null		-6.25777451781332E89	6.853372E-39
> 	1342177280	4791877540239403909	null	null	null		1.1616051025384076E-19	6.85333E-39
> 	961823793	4648967379092714291	null	null	null		-1.566140588249918E-294	6.853375E-39
> 	1395995696	4665039317688404410	null	null	null		-1.2019953071460916E-255	6.853377E-39
> 	9	4739979635665875763	null	null	null		2.0158752237719652E142	6.853885E-39
> 	1413755216	4681520666516803027	null	null	null		9.5367431749203E-10	6.853843E-39
> 	808464441	4681489713615213691	null	null	null		1.5839247263595919E-196	6.853887E-39
> 	2643	4706865145145752289	null	null	null		-2.640804284464335E199	6.853888E-39
> 	808538112	4680740055935877120	null	null	null		6.805647344887834E38	6.855466E-39
> 	809063492	4680120333056896873	null	null	null		-6.330130140122477E-128	6.855469E-39
> 	223555632	4694820525793932739	null	null	null		7.131979894486345E177	6.874924E-39
> 	1342177280	4694805443005237533	null	null	null		-2.4466921838949077E-91	6.875437E-39
> 	961823793	4710968886936375132	null	null	null		3.4645199782253463E-9	6.875952E-39
> 	775238704	4701502231015057932	null	null	null		4.4671552526292066E147	6.854837E-39
> 	1395666993	4663911482860999226	null	null	null		-1.7310953463334223E41	6.85488E-39
> 	5	4724388908060135916	null	null	null		-1.7469523604389314E-85	6.85492E-39
> 	844706128	4680757843285235466	null	null	null		4.997003201540759E257	6.854851E-39
> 	845	4665966412149049786	null	null	null		-1.8661194612154757E-24	6.856876E-39
> 	1496469504	4710000304825743442	null	null	null		6.722218728220181E89	6.854963E-39
> {code}
> In the above output, we should make sure drill returns 0 for numeric types



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message