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

Jim Apple resolved IMPALA-5782.
-------------------------------
    Resolution: Information Provided

The Cloudera JDBC driver is not part of Apache Impala, and this is the ticket 
tracking system for Apache Impala. However, I have forwarded this report to a 
person at Cloudera who will take a look.

> Issue with WITH clause with Cloudera JDBC Driver for Impala - Returning 
> column name instead of actual Data
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: IMPALA-5782
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5782
>             Project: IMPALA
>          Issue Type: Bug
>    Affects Versions: Impala 2.8.0
>            Reporter: Arghya Saha
>
> I am using Cloudera JDBC Driver for Impala v 2.5.38 with Spark 1.6.0 to 
> create DataFrame. It is working fine for all queries except WITH clause, but 
> WITH is extensively used in my organization. Below is my code snippet.
> {code:java}
> def jdbcHDFS(url:String,sql: String):DataFrame = {
>   var rddDF: DataFrame = null
>   val jdbcURL = s"jdbc:impala://$url"
>   val connectionProperties = new java.util.Properties
>   
> connectionProperties.setProperty("driver","com.cloudera.impala.jdbc41.Driver")
>   rddDF = sqlContext.read.jdbc(jdbcURL, s"($sql) AS ST", connectionProperties)
>   rddDF
> }
> {code}
> Given below example for working and non-working SQL
> {code:java}
> val workingSQL = "select empname from (select * from employee) as tmp"
> val nonWorkingSQL = "WITH tmp as (select * from employee) select empname from 
> tmp"
> {code}
> Below is the output of rddDF.first for above SQLs.
> For workingSQL
> {code:java}
> scala> rddDF.first
> res8: org.apache.spark.sql.Row = [Kushal]
> {code}
> For nonWorkingSQL
> {code:java}
> scala> rddDF.first
> res8: org.apache.spark.sql.Row = [empname] //Here we are expecting actual 
> data ie. 'Kushal' instead of column name like the output of previous query.
> {code}
> It would be really helpful if anyone can suggest any solution for it.
> Please note: Both the queries are working fine in IMPALA-SHELL as well as in 
> HIVE through HUE.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to