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

Karel Kolman commented on HIVE-21798:
-------------------------------------

[~gopalv] thx for your reply, ill try to dig into the acid v1 / v2 differences 
a bit more for our use case.

OrcInputFormat#ACIDSplitStrategy#getSplits  code has what seems to me a "return 
empty split list / throw exception code" only code
{noformat}
  static class ACIDSplitStrategyimplements SplitStrategy<OrcSplit> {

   .... 

    @Override
    public List<OrcSplit> getSplits() throws IOException {
      List<OrcSplit> splits = Lists.newArrayList();

      if (acidOperationalProperties != null && 
acidOperationalProperties.isSplitUpdate()) {
        return Collections.emptyList();
      }

      if (!deltas.isEmpty()) {
        //since HIVE-17089 if here, then it's not an acid table so there should 
never be any deltas
        throw new IllegalStateException("Found unexpected deltas: " + deltas + 
" in " + dir);
      }
      return splits;
    }
{noformat}

since 
https://github.com/apache/hive/commit/34b0e07a3bd5002b197b749e3e5a7992e196c237#diff-ede47c0c518f8577dd3895984f019330L1037

that seems kind of weird.

> OrcInputFormat#generateSplitsInfo returns 0 splits for a transactional 
> delta-only table
> ---------------------------------------------------------------------------------------
>
>                 Key: HIVE-21798
>                 URL: https://issues.apache.org/jira/browse/HIVE-21798
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 3.1.0
>            Reporter: Karel Kolman
>            Priority: Major
>
> OrcInputFormat#generateSplitsInfo returns 0 splits for acid table which has 
> no base - deltas only.
>  
> Table data (no base)
> {noformat}
> $ hadoop fs -ls /apps/hive/warehouse/test_table
> drwxr-xr-x - hive hdfs 0 2019-05-28 13:13 
> /apps/hive/warehouse/test_table/delta_0000001_0000001_0000
> $ hadoop fs -ls -r /apps/hive/warehouse/test_table/delta_0000001_0000001_0000
> Found 4 items
> -rw-r--r-- 3 hive hdfs 1302 2019-05-28 13:13 
> /apps/hive/warehouse/test_table/delta_0000001_0000001_0000/bucket_00002
> -rw-r--r-- 3 hive hdfs 1250 2019-05-28 13:13 
> /apps/hive/warehouse/test_table/delta_0000001_0000001_0000/bucket_00001
> -rw-r--r-- 3 hive hdfs 1215 2019-05-28 13:13 
> /apps/hive/warehouse/test_table/delta_0000001_0000001_0000/bucket_00000
> -rw-r--r-- 3 hive hdfs 1 2019-05-28 13:13 
> /apps/hive/warehouse/test_table/delta_0000001_0000001_0000/_orc_acid_version{noformat}
> Table created with
> {noformat}
> CREATE TABLE test_table (userid bigint)
>       clustered by (userid)
>       into 3 buckets
>       stored as orc
>       TBLPROPERTIES ('transactional'='true');
> INSERT INTO TABLE test_table SELECT * FROM source_table;
> {noformat}
>  
> Is this expected behavior ?
>  
> Change of behavior from earlier Hive versions seems to come from commit
>  
> [https://github.com/apache/hive/commit/34b0e07a3bd5002b197b749e3e5a7992e196c237#diff-ede47c0c518f8577dd3895984f019330L1037]
>  related to HIVE-17089.
> Earlier Hive versions return valid split data from 
> OrcInputFormat#generateSplitsInfo.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to