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

Khurram Faraaz commented on DRILL-3908:
---------------------------------------

I ran the test using simba JDBC driver, and getColumnDisplaySize(1) returns 
1258, unlike Drill's JDBC driver where we return 10.

Here is the definition of the parquet file over which the query is run from 
JDBC.
{code}
[root@centos-01 parquet-tools]# ./parquet-schema 0_0_0.parquet
message root {
  optional int32 col0;
  optional int64 col1;
  optional float col2;
  optional double col3;
  optional int32 col4 (TIME_MILLIS);
  optional int64 col5 (TIMESTAMP_MILLIS);
  optional int32 col6 (DATE);
  optional boolean col7;
  optional binary col8 (UTF8);
  optional binary col9 (UTF8);
}
{code}

[root@centos-01 ~]# javac DataFromDrill.java
[root@centos-01 ~]# java DataFromDrill
log4j:WARN No appenders could be found for logger 
(org.apache.drill.common.config.NestedConfig).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more 
info.
ResultSetMetadata.getColumnDisplaySize(1) :1258

I used simba JDBC driver to run the test

{code}
[root@centos-01 ~]# echo $CLASSPATH
.:/root/simbaJDBC/*
[root@centos-01 ~]# cd simbaJDBC/
[root@centos-01 simbaJDBC]# ls
antlr-runtime-3.5.2.jar        DrillJDBC41.jar                
javassist-3.19.0-GA.jar         netty-transport-4.0.27.Final.jar
commons-lang3-3.3.2.jar        drill-protocol-1.1.0.jar       joda-time-2.7.jar 
              protobuf-java-2.6.1.jar
config-1.2.1.jar               guava-16.0.1.jar               log4j-1.2.17.jar  
              reflections-0.9.9.jar
curator-client-2.7.1.jar       hadoop-common-2.6.0.jar        
metrics-core-3.0.2.jar          slf4j-api-1.7.12.jar
curator-framework-2.7.1.jar    jackson-annotations-2.5.2.jar  
metrics-jvm-3.0.2.jar           slf4j-log4j12-1.7.12.jar
curator-recipes-2.7.1.jar      jackson-core-2.5.2.jar         
netty-buffer-4.0.27.Final.jar   zookeeper-3.4.6.jar
curator-x-discovery-2.7.1.jar  jackson-core-asl-1.9.13.jar    
netty-codec-4.0.27.Final.jar
drill-common-1.1.0.jar         jackson-databind-2.5.2.jar     
netty-common-4.0.27.Final.jar
drill-java-exec-1.1.0.jar      jackson-mapper-asl-1.9.13.jar  
netty-handler-4.0.27.Final.jar
{code}

Snippet to run the query
{code}
                final String URL_STRING = "jdbc:drill:drillbit=10.10.100.201";  
             
                Class.forName("com.mapr.drill.jdbc41.Driver").newInstance();
                Connection conn = 
DriverManager.getConnection(URL_STRING,"root","mapr");

                Statement stmt = conn.createStatement();
                String query = "select col9 from dfs.tmp.FEWRWSPQQ_101";
                ResultSet rs = stmt.executeQuery(query);
                ResultSetMetaData rsmd = rs.getMetaData();

                System.out.println("ResultSetMetadata.getColumnDisplaySize(1) 
:"+rsmd.getColumnDisplaySize(1));
{code}

> ResultSetMetadata.getColumnDisplaySize() does not return correct column 
> length value
> ------------------------------------------------------------------------------------
>
>                 Key: DRILL-3908
>                 URL: https://issues.apache.org/jira/browse/DRILL-3908
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>    Affects Versions: 1.1.0
>         Environment: Linux lnxx64r6 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 
> 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
>            Reporter: Sergio Lob
>            Assignee: Parth Chandra
>            Priority: Critical
>             Fix For: 1.3.0
>
>
> ResultSetMetadata.getColumnDisplaySize() does not return correct column 
> length value. In fact, invocation of this method seems to always return value 
> 10.  This causes our JDBC application to process data incorrectly.  I see 
> that this problem was referenced in jira DRILL-3151, but the this bug has 
> apparently not been addressed, although status of DRILL-3151 is "resolved". 
> This is a critical bug for us. 



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

Reply via email to