hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Work logged] (HIVE-21924) Split text files even if header/footer exists
Date Fri, 27 Sep 2019 09:18:03 GMT

     [ https://issues.apache.org/jira/browse/HIVE-21924?focusedWorklogId=319444&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319444
]

ASF GitHub Bot logged work on HIVE-21924:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Sep/19 09:17
            Start Date: 27/Sep/19 09:17
    Worklog Time Spent: 10m 
      Work Description: sankarh commented on pull request #791: HIVE-21924
URL: https://github.com/apache/hive/pull/791#discussion_r328983856
 
 

 ##########
 File path: ql/src/test/queries/clientpositive/file_with_header_footer_aggregation.q
 ##########
 @@ -0,0 +1,94 @@
+set hive.mapred.mode=nonstrict;
+
+dfs ${system:test.dfs.mkdir} ${system:test.tmp.dir};
+dfs -copyFromLocal ../../data/files/header_footer_table_4  ${system:test.tmp.dir}/header_footer_table_4;
+
+CREATE TABLE numbrs (numbr int);
+INSERT INTO numbrs VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12),
(NULL);
+CREATE EXTERNAL TABLE header_footer_table_4 (header_int int, header_name string, header_choice
varchar(10)) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION '${system:test.tmp.dir}/header_footer_table_4'
tblproperties ("skip.header.line.count"="1", "skip.footer.line.count"="2");
+
+SELECT * FROM header_footer_table_4;
+
+SELECT * FROM header_footer_table_4 ORDER BY header_int LIMIT 8;
+
+-- should return nothing as title is correctly skipped
+SELECT * FROM header_footer_table_4 WHERE header_choice = 'header_choice';
 
 Review comment:
   Also, test count(*) as well.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 319444)
    Time Spent: 1h 20m  (was: 1h 10m)

> Split text files even if header/footer exists
> ---------------------------------------------
>
>                 Key: HIVE-21924
>                 URL: https://issues.apache.org/jira/browse/HIVE-21924
>             Project: Hive
>          Issue Type: Improvement
>          Components: File Formats
>    Affects Versions: 2.4.0, 4.0.0, 3.2.0
>            Reporter: Prasanth Jayachandran
>            Assignee: Mustafa Iman
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21924.patch
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> https://github.com/apache/hive/blob/967a1cc98beede8e6568ce750ebeb6e0d048b8ea/ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java#L494-L503

> {code}
>     int headerCount = 0;
>     int footerCount = 0;
>     if (table != null) {
>       headerCount = Utilities.getHeaderCount(table);
>       footerCount = Utilities.getFooterCount(table, conf);
>       if (headerCount != 0 || footerCount != 0) {
>         // Input file has header or footer, cannot be splitted.
>         HiveConf.setLongVar(conf, ConfVars.MAPREDMINSPLITSIZE, Long.MAX_VALUE);
>       }
>     }
> {code}
> this piece of code makes the CSV (or any text files with header/footer) files not splittable
if header or footer is present. 
> If only header is present, we can find the offset after first line break and use that
to split. Similarly for footer, may be read few KB's of data at the end and find the last
line break offset. Use that to determine the data range which can be used for splitting. Few
reads during split generation are cheaper than not splitting the file at all.  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message