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

ASF GitHub Bot commented on DRILL-3566:
---------------------------------------

GitHub user dsbos opened a pull request:

    https://github.com/apache/drill/pull/111

    DRILL-3566: PreparedStatement fix and DRILL-3347: ...hadoop.io.Text fix

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dsbos/incubator-drill 
bugs/drill-3566_etc._jdbc

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/111.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 #111
    
----
commit aad3db5dd3787e0c0e26b42e02a2351d1d5df788
Author: dbarclay <dbarc...@maprtech.com>
Date:   2015-07-28T02:27:50Z

    DRILL-3566: Fix:  PreparedStatement.executeQuery() got ClassCastException.
    
    Main:
    Restored DrillResultSetImpl(...)'s statement parameter from overly
    restrictive DrillStatementImpl to AvaticaStatement and removed caller
    cast that was throwing.  (Relatedly, adjusted getStatement() and moved
    internal casting from statement to connection.)
    
    Added basic test of querying via PreparedStatement.  [PreparedStatementTest]
    Added some case test of statement-creation methods.  [ConnectionTest]

commit 537f7db912f8a80088b331bde67cefbc132fae5a
Author: dbarclay <dbarc...@maprtech.com>
Date:   2015-08-04T23:51:07Z

    DRILL-3347: VARCHAR ResultSet.getObject returned ...hadoop.io.Text, not 
String.
    
    Core fix:
    - Fixed {,Nullable}VarCharAccessor's getObject() to return String instead of
      value vector's internal org.apache.hadoop.io.Text.
    - Updated unit tests (to expect only String now).
      [DatabaseMetaDataGetColumnsTest, ResultSetMetaDataTest]
    
    Also Added getObject check in tracing proxy test.  [TracingProxyDriverTest]
    Changed hard references to Hadoop's Text and JodaTime's Period to strings in
    warning check in tracing proxy.  [InvocationReporterImpl]
    
    Cleanup:
    - Added @Override annotations.  [SqlAccessors]
    - (Unintentionally) fixed (undetected) missing comma.  
[ValueVectorTypes.tdd]

----


> Calling Connection.prepareStatement throws a ClassCastException
> ---------------------------------------------------------------
>
>                 Key: DRILL-3566
>                 URL: https://issues.apache.org/jira/browse/DRILL-3566
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>            Reporter: Rahul Challapalli
>            Assignee: Parth Chandra
>            Priority: Blocker
>             Fix For: 1.2.0
>
>
> Git Commit # : 65935db8d01b95a7a3107835d7cd5e61220e2f84
> I am hitting the below exception when using Connection.prepareStatement 
> without binding any parameters
> {code}
> PreparedStatement stmt = con.prepareStatement(DRILL_SAMPLE_QUERY);
> Exception in thread "main" java.lang.ClassCastException: 
> org.apache.drill.jdbc.impl.DrillJdbc41Factory$DrillJdbc41PreparedStatement 
> cannot be cast to org.apache.drill.jdbc.impl.DrillStatementImpl
> at 
> org.apache.drill.jdbc.impl.DrillJdbc41Factory.newResultSet(DrillJdbc41Factory.java:106)
> at 
> org.apache.drill.jdbc.impl.DrillJdbc41Factory.newResultSet(DrillJdbc41Factory.java:1)
> at 
> net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:397)
> at 
> net.hydromatic.avatica.AvaticaPreparedStatement.executeQuery(AvaticaPreparedStatement.java:77)
> at com.incorta.trails.DrillTest.query(DrillTest.java:33)
> at com.incorta.trails.DrillTest.main(DrillTest.java:12)
> {code}



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

Reply via email to