You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hcatalog-commits@incubator.apache.org by tr...@apache.org on 2012/08/30 01:00:46 UTC

svn commit: r1378783 - in /incubator/hcatalog/trunk: CHANGES.txt hcatalog-pig-adapter/src/main/java/org/apache/hcatalog/pig/HCatBaseStorer.java

Author: travis
Date: Thu Aug 30 01:00:45 2012
New Revision: 1378783

URL: http://svn.apache.org/viewvc?rev=1378783&view=rev
Log:
HCAT-483 HCatBaseStorer.getHCatFSFromPigFS fails when Table schema is not provided (pengfeng via traviscrawford)

Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    incubator/hcatalog/trunk/hcatalog-pig-adapter/src/main/java/org/apache/hcatalog/pig/HCatBaseStorer.java

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1378783&r1=1378782&r2=1378783&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Thu Aug 30 01:00:45 2012
@@ -89,6 +89,8 @@ Trunk (unreleased changes)
   OPTIMIZATIONS
 
   BUG FIXES
+  HCAT-483 HCatBaseStorer.getHCatFSFromPigFS fails when Table schema is not provided (pengfeng via traviscrawford)
+
   HCAT-477 Drop table API in webhcat client does not respect the "ifExists" parameter.
 
   HCAT-471 Test HCat_ShowDes_1[1-3] fails (vikram.dixit via gates)

Modified: incubator/hcatalog/trunk/hcatalog-pig-adapter/src/main/java/org/apache/hcatalog/pig/HCatBaseStorer.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/hcatalog-pig-adapter/src/main/java/org/apache/hcatalog/pig/HCatBaseStorer.java?rev=1378783&r1=1378782&r2=1378783&view=diff
==============================================================================
--- incubator/hcatalog/trunk/hcatalog-pig-adapter/src/main/java/org/apache/hcatalog/pig/HCatBaseStorer.java (original)
+++ incubator/hcatalog/trunk/hcatalog-pig-adapter/src/main/java/org/apache/hcatalog/pig/HCatBaseStorer.java Thu Aug 30 01:00:45 2012
@@ -152,11 +152,15 @@ public abstract class HCatBaseStorer ext
       return new HCatFieldSchema(fSchema.alias, Type.STRING, null);
 
     case DataType.INTEGER:
-      if (!SUPPORTED_INTEGER_CONVERSIONS.contains(hcatFieldSchema.getType())) {
-        throw new FrontendException("Unsupported type: " + type + "  in Pig's schema",
+      if (hcatFieldSchema != null) {
+        if (!SUPPORTED_INTEGER_CONVERSIONS.contains(hcatFieldSchema.getType())) {
+          throw new FrontendException("Unsupported type: " + type + "  in Pig's schema",
             PigHCatUtil.PIG_EXCEPTION_CODE);
+        }
+        return new HCatFieldSchema(fSchema.alias, hcatFieldSchema.getType(), null);
+      } else {
+        return new HCatFieldSchema(fSchema.alias, Type.INT, null);
       }
-      return new HCatFieldSchema(fSchema.alias, hcatFieldSchema.getType(), null);
 
     case DataType.LONG:
       return new HCatFieldSchema(fSchema.alias, Type.BIGINT, null);