public boolean equals(Object rhs) { if (rhs == this) { return true; } if (rhs == null || rhs.getClass() != getClass()) { return false; } return this.getStrippedValue().equals(((HiveCharWritable) rhs).getStrippedValue()); }
public int compareTo(HiveCharWritable rhs) { return getStrippedValue().compareTo(rhs.getStrippedValue()); }
public int getCharacterLength() { return HiveStringUtils.getTextUtfLength(getStrippedValue()); }
public int hashCode() { return getStrippedValue().hashCode(); }
@Override public void setSafeValue(ObjectInspector oi, Object hiveFieldValue, ValueVector outputVV, int outputIndex) { final Text value = ((HiveCharObjectInspector)oi).getPrimitiveWritableObject(hiveFieldValue).getStrippedValue(); final byte[] valueBytes = value.getBytes(); final int valueLen = value.getLength(); ((NullableVarCharVector) outputVV).getMutator().setSafe(outputIndex, valueBytes, 0, valueLen); } }
/** * Write CHAR(N). * The representation of char in Teradata binary format is: * the byte number to read is based on the [charLength] * [bytePerChar] <- totalLength, * bytePerChar is decided by the charset: LATAIN charset is 2 bytes per char and UNICODE charset is 3 bytes per char. * the null char will use space to pad. * * @param writable the writable * @param length the byte n * @throws IOException the io exception */ public void writeChar(HiveCharWritable writable, int length) throws IOException { if (writable == null) { String pad = join("", Collections.nCopies(length, " ")); write(pad.getBytes("UTF8")); return; } Text t = writable.getStrippedValue(); int contentLength = t.getLength(); write(t.getBytes(), 0, contentLength); if (length - contentLength < 0) { throw new IOException(format("The byte num %s of HiveCharWritable is more than the byte num %s we can hold. " + "The content of HiveCharWritable is %s", contentLength, length, writable.getPaddedValue())); } if (length > contentLength) { String pad = join("", Collections.nCopies(length - contentLength, " ")); write(pad.getBytes("UTF8")); } }
Text text = ((HiveCharObjectInspector) poi).getPrimitiveWritableObject(o).getStrippedValue(); return Murmur3.hash32(text.getBytes(), text.getLength());
.getStrippedValue()); } else { t.set(((HiveCharObjectInspector) inputOI).getPrimitiveJavaObject(input).getStrippedValue());
case CHAR: Text vChar = ((HiveCharObjectInspector)inputOI). getPrimitiveWritableObject(parameters[0]).getStrippedValue(); bf.addBytes(vChar.getBytes(), 0, vChar.getLength()); break;
case CHAR: Text vChar = ((HiveCharObjectInspector)inputOI). getPrimitiveWritableObject(parameters[0]).getStrippedValue(); bf.addBytes(vChar.getBytes(), 0, vChar.getLength()); break;
Text t = hc.getStrippedValue(); serializeBytes(buffer, t.getBytes(), t.getLength(), invert); return;
case CHAR: Text vChar = ((HiveCharObjectInspector) valObjectInspector). getPrimitiveWritableObject(arguments[0].get()).getStrippedValue(); return bloomFilter.testBytes(vChar.getBytes(), 0, vChar.getLength()); case VARCHAR:
case CHAR: Text vChar = ((HiveCharObjectInspector) valObjectInspector). getPrimitiveWritableObject(arguments[0].get()).getStrippedValue(); return bloomFilter.testBytes(vChar.getBytes(), 0, vChar.getLength()); case VARCHAR:
public boolean equals(Object rhs) { if (rhs == this) { return true; } if (rhs == null || rhs.getClass() != getClass()) { return false; } return this.getStrippedValue().equals(((HiveCharWritable) rhs).getStrippedValue()); }
public boolean equals(Object rhs) { if (rhs == this) { return true; } if (rhs == null || rhs.getClass() != getClass()) { return false; } return this.getStrippedValue().equals(((HiveCharWritable) rhs).getStrippedValue()); }
public boolean equals(Object rhs) { if (rhs == this) { return true; } if (rhs == null || rhs.getClass() != getClass()) { return false; } return this.getStrippedValue().equals(((HiveCharWritable) rhs).getStrippedValue()); }
public boolean equals(Object rhs) { if (rhs == this) { return true; } if (rhs == null || rhs.getClass() != getClass()) { return false; } return this.getStrippedValue().equals(((HiveCharWritable) rhs).getStrippedValue()); }
public int compareTo(HiveCharWritable rhs) { return getStrippedValue().compareTo(rhs.getStrippedValue()); }
public int hashCode() { return getStrippedValue().hashCode(); }
@Override public void setSafeValue(ObjectInspector oi, Object hiveFieldValue, ValueVector outputVV, int outputIndex) { final Text value = ((HiveCharObjectInspector)oi).getPrimitiveWritableObject(hiveFieldValue).getStrippedValue(); final byte[] valueBytes = value.getBytes(); final int valueLen = value.getLength(); ((VarCharVector) outputVV).setSafe(outputIndex, valueBytes, 0, valueLen); } }