Package org.apache.pig

Examples of org.apache.pig.PigException


    }

    if (type == Type.BOOLEAN){
      errMsg = "Howl column type 'BOOLEAN' is not supported in " +
      "Pig as a column type";
      throw new PigException(errMsg, PIG_EXCEPTION_CODE);
    }

    errMsg = "Howl column type '"+ type.toString() +"' is not supported in Pig as a column type";
    throw new PigException(errMsg, PIG_EXCEPTION_CODE);
  }
View Full Code Here


      }
  }

  private static void validateIsPigCompatibleMapWithPrimitives(HowlFieldSchema hfs) throws IOException{
      if (hfs.getMapKeyType() != Type.STRING){
          throw new PigException("Incompatible type in schema, found map with " +
                  "non-string key type in :"+hfs.getTypeString(), PIG_EXCEPTION_CODE);
      }
      validateIsPigCompatiblePrimitive(hfs.getMapValueSchema().getFields().get(0));
  }
View Full Code Here

      if (
              (hfs.isComplex()) ||
              (htype == Type.TINYINT) ||
              (htype == Type.SMALLINT)
              ){
            throw new PigException("Incompatible type in schema, expected pig " +
                      "compatible primitive for:" + hfs.getTypeString());
          }

  }
View Full Code Here

            PigHowlUtil.getHowlServerPrincipal(job));
    HowlSchema howlTableSchema = HowlUtil.getTableSchemaWithPtnCols(table);
    try {
      PigHowlUtil.validateHowlTableSchemaFollowsPigRules(howlTableSchema);
    } catch (IOException e){
      throw new PigException(
          "Table schema incompatible for reading through HowlLoader :" + e.getMessage()
          + ";[Table schema was "+ howlTableSchema.toString() +"]"
          ,PigHowlUtil.PIG_EXCEPTION_CODE, e);
    }
    storeInUDFContext(signature, HowlConstants.HOWL_TABLE_SCHEMA, howlTableSchema);
View Full Code Here

       
        try {
            lp.swap(load, foreach);
            fail("Expected failure.");
        } catch (Exception e){
            PigException pe = LogUtils.getPigException(e);
            assertTrue(pe.getErrorCode() == 1100);
        }
       
    }
View Full Code Here

       
        try {
            lp.pushBefore(frjoin, filter, 0);
            fail("Expected failure.");
        } catch (Exception e) {
            PigException pe = LogUtils.getPigException(e);
            assertTrue(pe.getErrorCode() == 2156);
        }       
    }
View Full Code Here

       
        try {
            lp.pushBefore(cogroup, filter, 0);
            fail("Expected failure.");
        } catch(Exception e) {
            PigException pe = LogUtils.getPigException(e);
            assertTrue(pe.getErrorCode() == 2158);
        }
       
    }
View Full Code Here

        try {
            lp.trimAbove(cogroup);
            fail("Excepted failure.");
        } catch (Exception e) {
            PigException pe = LogUtils.getPigException(e);
            assertTrue(pe.getErrorCode() == 1097);
        }
       
    }
View Full Code Here

       
        try {
            lp.trimAbove(cogroup);
            fail("Excepted failure");
        } catch (Exception e) {
            PigException pe = LogUtils.getPigException(e);
            assertTrue(pe.getErrorCode() == 1097);
        }
       
    }
View Full Code Here

        Grunt grunt = new Grunt(new BufferedReader(reader), context);
   
        try {
            grunt.exec();
        } catch (Exception e) {
            PigException pe = LogUtils.getPigException(e);
            String msg = (pe == null? e.getMessage(): pe.getMessage());
            assertTrue(msg.contains("Encountered \" \";"));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.pig.PigException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.