You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by pv...@apache.org on 2019/03/27 08:50:04 UTC

[hive] branch master updated: HIVE-21455: Too verbose logging in AvroGenericRecordReader (Miklos Szurap, reviewed by David Mollitor and Peter Vary)

This is an automated email from the ASF dual-hosted git repository.

pvary pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new b389484  HIVE-21455: Too verbose logging in AvroGenericRecordReader (Miklos Szurap, reviewed by David Mollitor and Peter Vary)
b389484 is described below

commit b389484b094ef1d2c8b7ce079f52e52ffb638b32
Author: Miklos Szurap <ms...@gmail.com>
AuthorDate: Wed Mar 27 09:49:02 2019 +0100

    HIVE-21455: Too verbose logging in AvroGenericRecordReader (Miklos Szurap, reviewed by David Mollitor and Peter Vary)
---
 .../hadoop/hive/ql/io/avro/AvroGenericRecordReader.java  | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/avro/AvroGenericRecordReader.java b/ql/src/java/org/apache/hadoop/hive/ql/io/avro/AvroGenericRecordReader.java
index 68138c8..b2bbab9 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/io/avro/AvroGenericRecordReader.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/avro/AvroGenericRecordReader.java
@@ -29,6 +29,7 @@ import org.apache.avro.generic.GenericData;
 import org.apache.avro.generic.GenericDatumReader;
 import org.apache.avro.generic.GenericRecord;
 import org.apache.avro.mapred.FsInput;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hadoop.fs.Path;
@@ -113,10 +114,8 @@ public class AvroGenericRecordReader implements
       for (Map.Entry<Path,PartitionDesc> pathsAndParts: mapWork.getPathToPartitionInfo().entrySet()){
         Path partitionPath = pathsAndParts.getKey();
         if(pathIsInPartition(split.getPath(), partitionPath)) {
-          if(LOG.isInfoEnabled()) {
-              LOG.info("Matching partition " + partitionPath +
-                      " with input split " + split);
-          }
+          LOG.info("Matching partition {} with input split {}", partitionPath,
+              split);
 
           Properties props = pathsAndParts.getValue().getProperties();
           if(props.containsKey(AvroTableProperties.SCHEMA_LITERAL.getPropName()) || props.containsKey(AvroTableProperties.SCHEMA_URL.getPropName())) {
@@ -127,17 +126,16 @@ public class AvroGenericRecordReader implements
           }
         }
       }
-      if(LOG.isInfoEnabled()) {
-        LOG.info("Unable to match filesplit " + split + " with a partition.");
-      }
+      LOG.info("Unable to match filesplit {} with a partition.", split);
     }
 
     // In "select * from table" situations (non-MR), we can add things to the job
     // It's safe to add this to the job since it's not *actually* a mapred job.
     // Here the global state is confined to just this process.
     String s = job.get(AvroTableProperties.AVRO_SERDE_SCHEMA.getPropName());
-    if(s != null) {
-      LOG.info("Found the avro schema in the job: " + s);
+    if (StringUtils.isNotBlank(s)) {
+      LOG.info("Found the avro schema in the job");
+      LOG.debug("Avro schema: {}", s);
       return AvroSerdeUtils.getSchemaFor(s);
     }
     // No more places to get the schema from. Give up.  May have to re-encode later.