You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Valeriy Borysyuk (Jira)" <ji...@apache.org> on 2021/11/24 15:36:00 UTC

[jira] [Comment Edited] (SPARK-26663) Cannot query a Hive table with subdirectories

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

Valeriy Borysyuk edited comment on SPARK-26663 at 11/24/21, 3:35 PM:
---------------------------------------------------------------------

To reproduce this, Hive steps in description should be executed on Tez, not MR. 

{{set hive.execution.engine=tez;}}

And in the same session execute create tables and insert with UNION ALL.

It will create two subdirectories inside table location, which is causing problem.


was (Author: borysyuk):
To reproduce this, Hive steps in description should be executed on Tez, not MR. 

{{set hive.execution.engine=tez;}}

And in the same session execute create tables and insert with UNION ALL.

It will create two subdirectories inside table location, which is causing problem.

{{}}

> Cannot query a Hive table with subdirectories
> ---------------------------------------------
>
>                 Key: SPARK-26663
>                 URL: https://issues.apache.org/jira/browse/SPARK-26663
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Aäron
>            Priority: Major
>
> Hello,
>  
> I want to report the following issue (my first one :) )
> When I create a table in Hive based on a union all then Spark 2.4 is unable to query this table.
> To reproduce:
> *Hive 1.2.1*
> {code:java}
> hive> creat table a(id int);
> insert into a values(1);
> hive> creat table b(id int);
> insert into b values(2);
> hive> create table c(id int) as select id from a union all select id from b;
> {code}
>  
> *Spark 2.3.1*
>  
> {code:java}
> scala> spark.table("c").show
> +---+
> | id|
> +---+
> | 1|
> | 2|
> +---+
> scala> spark.table("c").count
> res5: Long = 2
>  {code}
>  
> *Spark 2.4.0*
> {code:java}
> scala> spark.table("c").show
> 19/01/18 17:00:49 WARN HiveMetastoreCatalog: Unable to infer schema for table perftest_be.c from file format ORC (inference mode: INFER_AND_SAVE). Using metastore schema.
> +---+
> | id|
> +---+
> +---+
> scala> spark.table("c").count
> res3: Long = 0
> {code}
> I did not find an existing issue for this.  Might be important to investigate.
>  
> +Extra info:+ Spark 2.3.1 and 2.4.0 use the same spark-defaults.conf.
>  
> Kind regards.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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