@Override public int compareTo(Datum datum) { if (datum.kind() == TajoDataTypes.Type.PROTOBUF) { return value.equals(((ProtobufDatum)datum).get()) ? 0 : -1; } else { return -1; } }
@Override public int compareTo(Datum datum) { if (datum.type() == TajoDataTypes.Type.PROTOBUF) { return value.equals(((ProtobufDatum)datum).get()) ? 0 : -1; } else { return -1; } }
@Override public void merge(FunctionContext context, Tuple part) { ConcatContext concatCtx = (ConcatContext) context; if (part.isBlankOrNull(0)) { return; } ProtobufDatum datum = (ProtobufDatum) part.getProtobufDatum(0); StringAggProto proto = (StringAggProto) datum.get(); String delimiter = proto.getDelimiter(); String concatData = proto.getValue(); if (concatCtx.concatData.length() > 0) { concatCtx.concatData.append(delimiter); } concatCtx.concatData.append(concatData); }
@Override public void merge(FunctionContext ctx, Tuple part) { AvgContext avgCtx = (AvgContext) ctx; if (part.isBlankOrNull(0)) { return; } ProtobufDatum datum = (ProtobufDatum) part.getProtobufDatum(0); AvgDoubleProto proto = (AvgDoubleProto) datum.get(); avgCtx.sum += proto.getSum(); avgCtx.count += proto.getCount(); }
@Override public void merge(FunctionContext ctx, Tuple part) { AvgContext avgCtx = (AvgContext) ctx; if (part.isBlankOrNull(0)) { return; } ProtobufDatum datum = (ProtobufDatum) part.getProtobufDatum(0); AvgLongProto proto = (AvgLongProto) datum.get(); avgCtx.sum += proto.getSum(); avgCtx.count += proto.getCount(); }
@Override public void merge(FunctionContext ctx, Tuple part) { AvgContext avgCtx = (AvgContext) ctx; if (part.isBlankOrNull(0)) { return; } ProtobufDatum datum = (ProtobufDatum) part.getProtobufDatum(0); AvgLongProto proto = (AvgLongProto) datum.get(); avgCtx.sum += proto.getSum(); avgCtx.count += proto.getCount(); }
@Override public void merge(FunctionContext ctx, Tuple part) { AvgContext avgCtx = (AvgContext) ctx; if (part.isBlankOrNull(0)) { return; } ProtobufDatum datum = (ProtobufDatum) part.getProtobufDatum(0); AvgDoubleProto proto = (AvgDoubleProto) datum.get(); avgCtx.sum += proto.getSum(); avgCtx.count += proto.getCount(); }
case PROTOBUF: ProtobufDatum protobuf = (ProtobufDatum) datum; byte[] protoBytes = protobufJsonFormat.printToString(protobuf.get()).getBytes(); length = protoBytes.length; out.write(protoBytes, 0, protoBytes.length);
case PROTOBUF: ProtobufDatum protobuf = (ProtobufDatum) tuple.getProtobufDatum(columnIndex); byte[] protoBytes = protobufJsonFormat.printToString(protobuf.get()).getBytes(Bytes.UTF8_CHARSET); length = protoBytes.length; out.write(protoBytes, 0, protoBytes.length);
case PROTOBUF: ProtobufDatum protobuf = (ProtobufDatum) tuple.getProtobufDatum(columnIndex); byte[] protoBytes = protobufJsonFormat.printToString(protobuf.get()).getBytes(Bytes.UTF8_CHARSET); length = protoBytes.length; out.write(protoBytes, 0, protoBytes.length);
case PROTOBUF: ProtobufDatum protobuf = (ProtobufDatum) tuple.getProtobufDatum(index); byte[] protoBytes = protobufJsonFormat.printToString(protobuf.get()).getBytes(); length = protoBytes.length; out.write(protoBytes, 0, protoBytes.length);
case PROTOBUF: ProtobufDatum protobuf = (ProtobufDatum) tuple.getProtobufDatum(index); byte[] protoBytes = protobufJsonFormat.printToString(protobuf.get()).getBytes(); length = protoBytes.length; out.write(protoBytes, 0, protoBytes.length);
case PROTOBUF: ProtobufDatum protobuf = (ProtobufDatum) datum; byte[] protoBytes = protobufJsonFormat.printToString(protobuf.get()).getBytes(); length = protoBytes.length; out.write(protoBytes, 0, protoBytes.length);
case PROTOBUF: ProtobufDatum protobuf = (ProtobufDatum) datum; byte[] protoBytes = protobufJsonFormat.printToString(protobuf.get()).getBytes(); length = protoBytes.length; out.write(protoBytes, 0, protoBytes.length);
@Override public void merge(FunctionContext ctx, Tuple part) { VarianceContext varianceCtx = (VarianceContext) ctx; if (part.isBlankOrNull(0)) { return; } ProtobufDatum datum = (ProtobufDatum) part.getProtobufDatum(0); VarianceProto proto = (VarianceProto) datum.get(); double delta = proto.getAvg() - varianceCtx.avg; varianceCtx.avg += delta * proto.getCount() / (varianceCtx.count + proto.getCount()); varianceCtx.squareSumOfDiff += proto.getSquareSumOfDiff() + delta * delta * varianceCtx.count * proto.getCount() / (varianceCtx.count + proto.getCount()); varianceCtx.count += proto.getCount(); }
@Override public void merge(FunctionContext ctx, Tuple part) { VarianceContext varianceCtx = (VarianceContext) ctx; if (part.isBlankOrNull(0)) { return; } ProtobufDatum datum = (ProtobufDatum) part.getProtobufDatum(0); VarianceProto proto = (VarianceProto) datum.get(); double delta = proto.getAvg() - varianceCtx.avg; varianceCtx.avg += delta * proto.getCount() / (varianceCtx.count + proto.getCount()); varianceCtx.squareSumOfDiff += proto.getSquareSumOfDiff() + delta * delta * varianceCtx.count * proto.getCount() / (varianceCtx.count + proto.getCount()); varianceCtx.count += proto.getCount(); }
case PROTOBUF: ProtobufDatum protobuf = (ProtobufDatum) tuple.getProtobufDatum(columnIndex); return protobufJsonFormat.printToString(protobuf.get()); case NULL_TYPE: default:
CorrProto proto = (CorrProto) datum.get(); long nA = corrContext.count; long nB = proto.getCount();
CorrProto proto = (CorrProto) datum.get(); long nA = corrContext.count; long nB = proto.getCount();