You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lens.apache.org by pr...@apache.org on 2015/08/11 14:20:46 UTC

[23/50] [abbrv] incubator-lens git commit: LENS-703 : Fix ClassNotFound while doing 'list partition' after 'update partition'

LENS-703 : Fix ClassNotFound while doing 'list partition' after 'update partition'


Project: http://git-wip-us.apache.org/repos/asf/incubator-lens/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-lens/commit/784ed04e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-lens/tree/784ed04e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-lens/diff/784ed04e

Branch: refs/heads/current-release-line
Commit: 784ed04eb5e2b0f5625a2cfde451699fe418b3f2
Parents: c63eced
Author: Rajat Khandelwal <pr...@apache.org>
Authored: Wed Jul 29 14:42:17 2015 +0530
Committer: Amareshwari Sriramadasu <am...@apache.org>
Committed: Wed Jul 29 14:42:17 2015 +0530

----------------------------------------------------------------------
 .../java/org/apache/lens/server/metastore/JAXBUtils.java     | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/784ed04e/lens-server/src/main/java/org/apache/lens/server/metastore/JAXBUtils.java
----------------------------------------------------------------------
diff --git a/lens-server/src/main/java/org/apache/lens/server/metastore/JAXBUtils.java b/lens-server/src/main/java/org/apache/lens/server/metastore/JAXBUtils.java
index b7c4b40..70bd20d 100644
--- a/lens-server/src/main/java/org/apache/lens/server/metastore/JAXBUtils.java
+++ b/lens-server/src/main/java/org/apache/lens/server/metastore/JAXBUtils.java
@@ -33,6 +33,7 @@ import org.apache.lens.cube.metadata.ExprColumn.ExprSpec;
 import org.apache.hadoop.hive.metastore.TableType;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
 import org.apache.hadoop.hive.metastore.api.Order;
+import org.apache.hadoop.hive.ql.io.HiveFileFormatUtils;
 import org.apache.hadoop.hive.ql.io.HiveOutputFormat;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.metadata.Partition;
@@ -854,7 +855,12 @@ public final class JAXBUtils {
       partition.setInputFormatClass((Class<? extends InputFormat>) Class.forName(xp.getInputFormat()));
     }
     if (xp.getOutputFormat() != null) {
-      partition.setOutputFormatClass((Class<? extends HiveOutputFormat>) Class.forName(xp.getOutputFormat()));
+      Class<? extends HiveOutputFormat> outputFormatClass =
+        (Class<? extends HiveOutputFormat>) Class.forName(xp.getOutputFormat());
+      partition.setOutputFormatClass(outputFormatClass);
+      // Again a hack, for the issue described in HIVE-11278
+      partition.getTPartition().getSd().setOutputFormat(
+        HiveFileFormatUtils.getOutputFormatSubstitute(outputFormatClass, false).getName());
     }
     partition.getParameters().put(MetastoreConstants.PARTITION_UPDATE_PERIOD, xp.getUpdatePeriod().name());
     partition.getTPartition().getSd().getSerdeInfo().setSerializationLib(xp.getSerdeClassname());