Alex Liu created SPARK-3823:
-------------------------------

             Summary: Spark Hive SQL readColumn is not reset each time for a 
new query
                 Key: SPARK-3823
                 URL: https://issues.apache.org/jira/browse/SPARK-3823
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 1.1.0
            Reporter: Alex Liu


After a few queries running in the same hiveContext, 
"hive.io.file.readcolumn.ids"" and "hive.io.file.readcolumn.names" values are 
added on by pre-running queries.

e.g. running the following querys

{code}
hql("use sql_integration_ks")
val container = hql("select * from double_table as aa JOIN boolean_table as bb 
on aa.type_id = bb.type_id")
container.collect().foreach(println)
val container = hql("select * from ascii_table ORDER BY type_id")
 container.collect().foreach(println)
val container = hql("select shippers.shippername, COUNT(orders.orderid) AS 
numorders FROM orders LEFT JOIN shippers ON orders.shipperid=shippers.shipperid 
GROUP BY shippername")
 container.collect().foreach(println)
val container = hql("select * from ascii_table where type_id > 126")
container.collect().length
{code}

The read column ids for the last query are [2, 0, 3, 1]
read column names are : 
type_id,value,type_id,value,type_id,value,orderid,shipperid,shipper name, 
shipperid

The source code is at 
https://github.com/apache/spark/blob/master/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScan.scala#L80

hiveContext has a shared hiveconf which add readColumns for each query. It 
should be reset each time for a new hive query.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to