package org.apache.drill.exec.test.generated; import org.apache.drill.exec.exception.SchemaChangeException; import org.apache.drill.exec.expr.holders.NullableBitHolder; import org.apache.drill.exec.expr.holders.NullableVarCharHolder; import org.apache.drill.exec.expr.holders.VarCharHolder; import org.apache.drill.exec.ops.FragmentContext; import org.apache.drill.exec.record.RecordBatch; import org.apache.drill.exec.vector.NullableVarCharVector; public class GenericGenerated { NullableVarCharVector vv1; VarCharHolder string5; VarCharHolder constant6; NullableVarCharVector vv8; VarCharHolder string12; VarCharHolder constant13; public void setString5(VarCharHolder string5) { this.string5 = string5; } public void setString12(VarCharHolder string12) { this.string12 = string12; } public boolean doEval(int inIndex, int outIndex) throws SchemaChangeException { { NullableBitHolder out0 = new NullableBitHolder(); AndOP0: { NullableVarCharHolder out4 = new NullableVarCharHolder(); { out4 .isSet = vv1 .getAccessor().isSet((inIndex)); if (out4 .isSet == 1) { out4 .buffer = vv1 .getBuffer(); long startEnd = vv1 .getAccessor().getStartEnd((inIndex)); out4 .start = ((int) startEnd); out4 .end = ((int)(startEnd >> 32)); } } //---- start of eval portion of greater_than_or_equal_to function. ----// NullableBitHolder out7 = new NullableBitHolder(); { if (out4 .isSet == 0) { out7 .isSet = 0; } else { final NullableBitHolder out = new NullableBitHolder(); NullableVarCharHolder left = out4; VarCharHolder right = constant6; GCompareVarCharVsVarChar$GreaterThanEqVarCharVsVarChar_eval: { int cmp; outside: { cmp = org.apache.drill.exec.expr.fn.impl.ByteFunctionHelpers.compare( left.buffer, left.start, left.end, right.buffer, right.start, right.end ); } out.value = cmp > -1 ? 1 : 0; } out.isSet = 1; out7 = out; out.isSet = 1; } } //---- end of eval portion of greater_than_or_equal_to function. ----// if ((out7 .isSet == 1)&&(out7 .value!= 1)) { out0 .isSet = 1; out0 .value = 0; break AndOP0; } NullableVarCharHolder out11 = new NullableVarCharHolder(); { out11 .isSet = vv8 .getAccessor().isSet((inIndex)); if (out11 .isSet == 1) { out11 .buffer = vv8 .getBuffer(); long startEnd = vv8 .getAccessor().getStartEnd((inIndex)); out11 .start = ((int) startEnd); out11 .end = ((int)(startEnd >> 32)); } } //---- start of eval portion of equal function. ----// NullableBitHolder out14 = new NullableBitHolder(); { if (out11 .isSet == 0) { out14 .isSet = 0; } else { final NullableBitHolder out = new NullableBitHolder(); NullableVarCharHolder left = out11; VarCharHolder right = constant13; GCompareVarCharVsVarChar$EqualsVarCharVsVarChar_eval: { out.value = org.apache.drill.exec.expr.fn.impl.ByteFunctionHelpers.equal( left.buffer, left.start, left.end, right.buffer, right.start, right.end ); } out.isSet = 1; out14 = out; out.isSet = 1; } } //---- end of eval portion of equal function. ----// if ((out14 .isSet == 1)&&(out14 .value!= 1)) { out0 .isSet = 1; out0 .value = 0; break AndOP0; } if ((out7 .isSet*out14 .isSet) == 0) { out0 .isSet = 0; } else { out0 .isSet = 1; out0 .value = 1; } } return (out0 .value == 1); } } public void doSetup(FragmentContext context, RecordBatch incoming, RecordBatch outgoing) throws SchemaChangeException { { int[] fieldIds2 = new int[ 1 ] ; fieldIds2 [ 0 ] = 2; Object tmp3 = (incoming).getValueAccessorById(NullableVarCharVector.class, fieldIds2).getValueVector(); if (tmp3 == null) { throw new SchemaChangeException("Failure while loading vector vv1 with id: TypedFieldId [fieldIds=[2], remainder=null]."); } vv1 = ((NullableVarCharVector) tmp3); constant6 = string5; /** start SETUP for function greater_than_or_equal_to **/ { VarCharHolder right = constant6; {} } /** end SETUP for function greater_than_or_equal_to **/ int[] fieldIds9 = new int[ 1 ] ; fieldIds9 [ 0 ] = 1; Object tmp10 = (incoming).getValueAccessorById(NullableVarCharVector.class, fieldIds9).getValueVector(); if (tmp10 == null) { throw new SchemaChangeException("Failure while loading vector vv8 with id: TypedFieldId [fieldIds=[1], remainder=null]."); } vv8 = ((NullableVarCharVector) tmp10); constant13 = string12; /** start SETUP for function equal **/ { VarCharHolder right = constant13; {} } /** end SETUP for function equal **/ } } public void __DRILL_INIT__() throws SchemaChangeException { } }