Examples of HiveCharWritable


Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable

  public Object copyObject(Object o) {
    if (o == null) {
      return null;
    }
    HiveCharWritable writable = (HiveCharWritable) o;
    if (doesWritableMatchTypeParams((HiveCharWritable) o)) {
      return new HiveCharWritable(writable);
    }
    return getWritableWithParams(writable);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable

  @Override
  public Object set(Object o, HiveChar value) {
    if (value == null) {
      return null;
    }
    HiveCharWritable writable = (HiveCharWritable) o;
    writable.set(value, getMaxLength());
    return o;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable

  @Override
  public Object set(Object o, String value) {
    if (value == null) {
      return null;
    }
    HiveCharWritable writable = (HiveCharWritable) o;
    writable.set(value, getMaxLength());
    return o;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable

    return o;
  }

  @Override
  public Object create(HiveChar value) {
    HiveCharWritable ret;
    ret = new HiveCharWritable();
    ret.set(value, getMaxLength());
    return ret;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable

    public HiveCharConverter(PrimitiveObjectInspector inputOI,
        SettableHiveCharObjectInspector outputOI) {
      this.inputOI = inputOI;
      this.outputOI = outputOI;
      hc = new HiveCharWritable();
    }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable

    HiveChar hc = new HiveChar(val, getMaxLength());
    return hc;
  }

  private HiveCharWritable getWritableWithParams(HiveChar val) {
    HiveCharWritable hcw = new HiveCharWritable();
    hcw.set(val, getMaxLength());
    return hcw;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable

        return;
      }

      case CHAR: {
        HiveCharObjectInspector hcoi = (HiveCharObjectInspector) poi;
        HiveCharWritable hc = hcoi.getPrimitiveWritableObject(o);
        // Trailing space should ignored for char comparisons.
        // So write stripped values for this SerDe.
        Text t = hc.getStrippedValue();
        serializeBytes(buffer, t.getBytes(), t.getLength(), invert);
        return;
      }
      case VARCHAR: {
        HiveVarcharObjectInspector hcoi = (HiveVarcharObjectInspector)poi;
        HiveVarcharWritable hc = hcoi.getPrimitiveWritableObject(o);
        // use varchar's text field directly
        Text t = hc.getTextValue();
        serializeBytes(buffer, t.getBytes(), t.getLength(), invert);
        return;
      }

      case BINARY: {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable

      writeEscaped(out, t.getBytes(), 0, t.getLength(), escaped, escapeChar,
          needsEscape);
      break;
    }
    case CHAR: {
      HiveCharWritable hc = ((HiveCharObjectInspector) oi).getPrimitiveWritableObject(o);
      Text t = hc.getPaddedValue();
      writeEscaped(out, t.getBytes(), 0, t.getLength(), escaped, escapeChar,
          needsEscape);
      break;
    }
    case VARCHAR: {
      HiveVarcharWritable hc = ((HiveVarcharObjectInspector)oi).getPrimitiveWritableObject(o);
      Text t = hc.getTextValue();
      writeEscaped(out, t.getBytes(), 0, t.getLength(), escaped, escapeChar,
          needsEscape);
      break;
    }
    case BINARY: {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable

  protected int maxLength = -1;

  public LazyHiveChar(LazyHiveCharObjectInspector oi) {
    super(oi);
    maxLength = ((CharTypeInfo)oi.getTypeInfo()).getLength();
    data = new HiveCharWritable();
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable

  }

  public LazyHiveChar(LazyHiveChar copy) {
    super(copy);
    this.maxLength = copy.maxLength;
    data = new HiveCharWritable(copy.data);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.