Package org.apache.hive.hcatalog.data.schema.HCatFieldSchema

Examples of org.apache.hive.hcatalog.data.schema.HCatFieldSchema.Type


      }
      if (valueToken != JsonToken.START_OBJECT) {
        throw new IOException("Start of Object expected");
      }
      Map<Object, Object> map = new LinkedHashMap<Object, Object>();
      Type keyType = hcatFieldSchema.getMapKeyType();
      HCatFieldSchema valueSchema = hcatFieldSchema.getMapValueSchema().get(0);
      while ((valueToken = p.nextToken()) != JsonToken.END_OBJECT) {
        Object k = getObjectOfCorrespondingPrimitiveType(p.getCurrentName(), keyType);
        Object v;
        if (valueSchema.getType() == HCatFieldSchema.Type.STRUCT) {
View Full Code Here


  private Object getJavaObj(Object pigObj, HCatFieldSchema hcatFS) throws HCatException, BackendException {
    try {

      // The real work-horse. Spend time and energy in this method if there is
      // need to keep HCatStorer lean and go fast.
      Type type = hcatFS.getType();
      switch (type) {

      case BINARY:
        if (pigObj == null) {
          return null;
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public static Object extractPigObject(Object o, HCatFieldSchema hfs) throws Exception {
    Object result;
    Type itemType = hfs.getType();
    switch (itemType) {
    case BINARY:
      result = (o == null) ? null : new DataByteArray((byte[]) o);
      break;
    case STRUCT:
View Full Code Here

    }
  }

  private static void validateHcatFieldFollowsPigRules(HCatFieldSchema hcatField) throws PigException {
    try {
      Type hType = hcatField.getType();
      switch (hType) {
      case BOOLEAN:
        if (!pigHasBooleanSupport) {
          throw new PigException("Incompatible type found in HCat table schema: "
              + hcatField, PigHCatUtil.PIG_EXCEPTION_CODE);
View Full Code Here

  private Object getJavaObj(Object pigObj, HCatFieldSchema hcatFS) throws HCatException, BackendException {
    try {
      if(pigObj == null) return null;
      // The real work-horse. Spend time and energy in this method if there is
      // need to keep HCatStorer lean and go fast.
      Type type = hcatFS.getType();
      switch (type) {
      case BINARY:
        return ((DataByteArray) pigObj).get();

      case STRUCT:
View Full Code Here

    * All Pig conversion should be done here, etc.*/
    if(o == null) {
      return null;
    }
    Object result;
    Type itemType = hfs.getType();
    switch (itemType) {
    case BINARY:
      result = new DataByteArray((byte[]) o);
      break;
    case STRUCT:
View Full Code Here

    }
  }

  private static void validateHcatFieldFollowsPigRules(HCatFieldSchema hcatField) throws PigException {
    try {
      Type hType = hcatField.getType();
      switch (hType) {
      case BOOLEAN:
        if (!pigHasBooleanSupport) {
          throw new PigException("Incompatible type found in HCat table schema: "
              + hcatField, PigHCatUtil.PIG_EXCEPTION_CODE);
View Full Code Here

    * All Pig conversion should be done here, etc.*/
    if(o == null) {
      return null;
    }
    Object result;
    Type itemType = hfs.getType();
    switch (itemType) {
    case BINARY:
      result = new DataByteArray((byte[]) o);
      break;
    case STRUCT:
View Full Code Here

    }
  }

  private static void validateHcatFieldFollowsPigRules(HCatFieldSchema hcatField) throws PigException {
    try {
      Type hType = hcatField.getType();
      switch (hType) {
      case BOOLEAN:
        if (!pigHasBooleanSupport) {
          throw new PigException("Incompatible type found in HCat table schema: "
              + hcatField, PigHCatUtil.PIG_EXCEPTION_CODE);
View Full Code Here

TOP

Related Classes of org.apache.hive.hcatalog.data.schema.HCatFieldSchema.Type

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.