public void eval() { String str = format.print(in.value); out.buffer = buffer; out.start = 0; out.end = Math.min((int)len.value, str.length()); // truncate if target type has length smaller than that of input's string out.buffer.setBytes(0, str.substring(0,out.end).getBytes()); } }
public void eval() { String str = outputFormat.format(left.value); out.buffer = buffer; out.start = 0; out.end = Math.min(100, str.length()); // truncate if target type has length smaller than that of input's string out.buffer.setBytes(0, str.substring(0,out.end).getBytes()); } }
public void eval() { String str = format.print(in.value); out.buffer = buffer; out.start = 0; out.end = Math.min((int)len.value, str.length()); // truncate if target type has length smaller than that of input's string out.buffer.setBytes(0, str.substring(0,out.end).getBytes()); } }
public void eval() { String str = outputFormat.format(left.value); out.buffer = buffer; out.start = 0; out.end = Math.min(100, str.length()); // truncate if target type has length smaller than that of input's string out.buffer.setBytes(0, str.substring(0,out.end).getBytes()); } }
public void eval() { // print current value in the desired format String str = format.print(left.value); out.buffer = buffer; out.start = 0; out.end = Math.min(100, str.length()); // truncate if target type has length smaller than that of input's string out.buffer.setBytes(0, str.substring(0,out.end).getBytes()); } }
public void eval() { buffer = buffer.reallocIfNeeded((int) len.value); String istr = (new Double(in.value)).toString(); out.buffer = buffer; out.start = 0; out.end = Math.min((int)len.value, istr.length()); // truncate if target type has length smaller than that of input's string out.buffer.setBytes(0, istr.substring(0,out.end).getBytes()); } }
public void eval() { buffer = buffer.reallocIfNeeded((int) len.value); String istr = (new Integer(in.value)).toString(); out.buffer = buffer; out.start = 0; out.end = Math.min((int)len.value, istr.length()); // truncate if target type has length smaller than that of input's string out.buffer.setBytes(0, istr.substring(0,out.end).getBytes()); } }
public void eval() { buffer = buffer.reallocIfNeeded((int) len.value); String istr = (new Long(in.value)).toString(); out.buffer = buffer; out.start = 0; out.end = Math.min((int)len.value, istr.length()); // truncate if target type has length smaller than that of input's string out.buffer.setBytes(0, istr.substring(0,out.end).getBytes()); } }
@Override public void eval() { java.io.ByteArrayOutputStream outputStream = new java.io.ByteArrayOutputStream(); com.dremio.dac.explore.udfs.FormatList.formatList(input, delimiterArray, outputStream); byte [] bytes = outputStream.toByteArray(); out.start = 0; buffer = buffer.reallocIfNeeded(bytes.length); out.buffer = buffer; out.buffer.setBytes(0, bytes); out.end = bytes.length; } }
public static NullableVarCharHolder getNullableVarCharHolder(ArrowBuf buf, String s){ NullableVarCharHolder vch = new NullableVarCharHolder(); byte[] b = s.getBytes(Charsets.UTF_8); vch.start = 0; vch.end = b.length; vch.buffer = buf.reallocIfNeeded(b.length); vch.buffer.setBytes(0, b); vch.isSet = 1; return vch; }
@Override public void setup() { final byte[] queryUserNameBytes = contextInfo.getQueryUser().getBytes(); buffer = buffer.reallocIfNeeded(queryUserNameBytes.length); queryUserBytesLength = queryUserNameBytes.length; buffer.setBytes(0, queryUserNameBytes); }
@Override public void setup() { final byte[] currentSchemaBytes = contextInfo.getCurrentDefaultSchema().getBytes(); buffer = buffer.reallocIfNeeded(currentSchemaBytes.length); currentSchemaBytesLength= currentSchemaBytes.length; buffer.setBytes(0, currentSchemaBytes); }
@Override public void output() { byte[] ba = ((com.dremio.exec.expr.fn.hll.HLLAccum) work.obj).getOutputBytes(); buffer = buffer.reallocIfNeeded(ba.length); out.buffer = buffer; out.start = 0; out.end = ba.length; out.buffer.setBytes(0, ba); out.isSet = 1; }
@Override public void output() { byte[] ba = ((com.dremio.exec.expr.fn.hll.HLLAccum) work.obj).getOutputBytes(); buffer = buffer.reallocIfNeeded(ba.length); out.buffer = buffer; out.start = 0; out.end = ba.length; out.buffer.setBytes(0, ba); out.isSet = 1; }
@Override public void output() { byte[] ba = ((com.dremio.exec.expr.fn.hll.HLLAccum) work.obj).getOutputBytes(); buffer = buffer.reallocIfNeeded(ba.length); out.buffer = buffer; out.start = 0; out.end = ba.length; out.buffer.setBytes(0, ba); out.isSet = 1; }
@Override public void output() { byte[] ba = ((com.dremio.exec.expr.fn.hll.HLLAccum) work.obj).getOutputBytes(); buffer = buffer.reallocIfNeeded(ba.length); out.buffer = buffer; out.start = 0; out.end = ba.length; out.buffer.setBytes(0, ba); out.isSet = 1; }
@Override public void output() { byte[] ba = ((com.dremio.exec.expr.fn.hll.HLLAccum) work.obj).getOutputBytes(); buffer = buffer.reallocIfNeeded(ba.length); out.buffer = buffer; out.start = 0; out.end = ba.length; out.buffer.setBytes(0, ba); out.isSet = 1; }
@Override public void eval() { byte[] buf = com.dremio.common.util.DremioStringUtils.toBinaryStringNoFormat(in.buffer, in.start, in.end).getBytes(charset); out.buffer = buffer = buffer.reallocIfNeeded(buf.length); buffer.setBytes(0, buf); buffer.setIndex(0, buf.length); out.start = 0; out.end = buf.length; out.buffer = buffer; } }
@Override public void eval() { buffer.clear(); br.set(bytes); org.apache.hadoop.hbase.util.OrderedBytes.encodeInt32(br, in.value, org.apache.hadoop.hbase.util.Order.ASCENDING); buffer.setBytes(0, bytes, 0, 5); out.buffer = buffer; out.start = 0; out.end = 5; } }
private void expandTmpBufIfNecessary() { if (charLengthOffset < tmpBuf.capacity()) { return; } byte[] tmp = new byte[tmpBuf.capacity()]; tmpBuf.getBytes(0, tmp); tmpBuf = tmpBuf.reallocIfNeeded(tmpBuf.capacity() * 2); tmpBuf.setBytes(0, tmp); charLengthOffset = tmp.length; }