You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/02/25 07:11:35 UTC

[GitHub] [hive] ayushtkn opened a new pull request #2018: HIVE-24827. Hive aggregation query returns incorrect results for non text files.

ayushtkn opened a new pull request #2018:
URL: https://github.com/apache/hive/pull/2018


   


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kgyrtkirk commented on a change in pull request #2018: HIVE-24827. Hive aggregation query returns incorrect results for non text files.

Posted by GitBox <gi...@apache.org>.
kgyrtkirk commented on a change in pull request #2018:
URL: https://github.com/apache/hive/pull/2018#discussion_r585508226



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
##########
@@ -4028,6 +4030,8 @@ public static int getFooterCount(TableDesc table, JobConf job) throws IOExceptio
     int footerCount;
     try {
       footerCount = Integer.parseInt(table.getProperties().getProperty(serdeConstants.FOOTER_COUNT, "0"));
+      footerCount =
+          validateHeaderFooter(table, footerCount, "skip.footer.line.count");

Review comment:
       since `FOOTER_COUNT = "skip.footer.line.count"` ; I think you could also push in this `Integer.parseInt` into you method 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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ayushtkn commented on a change in pull request #2018: HIVE-24827. Hive aggregation query returns incorrect results for non text files.

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #2018:
URL: https://github.com/apache/hive/pull/2018#discussion_r589270214



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
##########
@@ -4028,6 +4030,8 @@ public static int getFooterCount(TableDesc table, JobConf job) throws IOExceptio
     int footerCount;
     try {
       footerCount = Integer.parseInt(table.getProperties().getProperty(serdeConstants.FOOTER_COUNT, "0"));
+      footerCount =
+          validateHeaderFooter(table, footerCount, "skip.footer.line.count");

Review comment:
       Done, Thanx




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kgyrtkirk merged pull request #2018: HIVE-24827. Hive aggregation query returns incorrect results for non text files.

Posted by GitBox <gi...@apache.org>.
kgyrtkirk merged pull request #2018:
URL: https://github.com/apache/hive/pull/2018


   


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kgyrtkirk commented on a change in pull request #2018: HIVE-24827. Hive aggregation query returns incorrect results for non text files.

Posted by GitBox <gi...@apache.org>.
kgyrtkirk commented on a change in pull request #2018:
URL: https://github.com/apache/hive/pull/2018#discussion_r583499772



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
##########
@@ -4028,6 +4035,13 @@ public static int getFooterCount(TableDesc table, JobConf job) throws IOExceptio
     int footerCount;
     try {
       footerCount = Integer.parseInt(table.getProperties().getProperty(serdeConstants.FOOTER_COUNT, "0"));
+      if (footerCount > 0 && table.getInputFileFormatClass() != null
+          && !TextInputFormat.class
+          .isAssignableFrom(table.getInputFileFormatClass())) {
+        LOG.warn("skip.footer.line.count is only valid for TextInputFormat "
+            + "files, ignoring the value.");
+        footerCount = 0;
+      }

Review comment:
       seems to be a duplicate block ; you could move it into a method




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ayushtkn commented on pull request #2018: HIVE-24827. Hive aggregation query returns incorrect results for non text files.

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on pull request #2018:
URL: https://github.com/apache/hive/pull/2018#issuecomment-786588569


   Thanx @kgyrtkirk for the review. I tried the scenario in HIVE-24224. I think it worked as expected:
   ```
   +-------------------+--------------------+----------------+
   | bz2tst2.sequence  |     bz2tst2.id     | bz2tst2.other  |
   +-------------------+--------------------+----------------+
   | 9                 | 20200315 X00 1356  | 123            |
   | 17                | 20200315 X00 1357  | 123            |
   +-------------------+--------------------+----------------+
   ```
   
   The file in was :
   ```
    printf "offset,id,other\n9,\"20200315 X00 1356\",123\n17,\"20200315 X00 1357\",123\nrst,rst,rst" > data.csv
   
   bzip2 -f data.csv 
   
   hdfs dfs -put data.csv.bz2 hdfs://hostname:8020/warehouse/tablespace/external/hive/bz2tst2
   ```
   
   Table is 
   ```
   +----------------------------------------------------+
   |                   createtab_stmt                   |
   +----------------------------------------------------+
   | CREATE EXTERNAL TABLE `bz2tst2`(                   |
   |   `sequence` int,                                  |
   |   `id` string,                                     |
   |   `other` string)                                  |
   | ROW FORMAT SERDE                                   |
   |   'org.apache.hadoop.hive.serde2.OpenCSVSerde'     |
   | STORED AS INPUTFORMAT                              |
   |   'org.apache.hadoop.mapred.TextInputFormat'       |
   | OUTPUTFORMAT                                       |
   |   'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' |
   | LOCATION                                           |
   |   'hdfs://ayushsaxena-3.ayushsaxena.root.hwx.site:8020/warehouse/tablespace/external/hive/bz2tst2' |
   | TBLPROPERTIES (                                    |
   |   'bucketing_version'='2',                         |
   |   'skip.footer.line.count'='1',                    |
   |   'skip.header.line.count'='1',                    |
   |   'transient_lastDdlTime'='1614334965')            |
   +----------------------------------------------------+
   ```
   
   Seems working, the UT was working. :-)


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org