private static LiteralExpression getNullLiteralExpression(Determinism determinism) { return NULL_EXPRESSIONS[determinism.ordinal()] ; }
public static boolean isFalse(Expression child) { if (child!=null) { return child == BOOLEAN_EXPRESSIONS[child.getDeterminism().ordinal()]; } return false; }
private static LiteralExpression getBooleanLiteralExpression(Boolean bool, Determinism determinism){ return BOOLEAN_EXPRESSIONS[ (Boolean.FALSE.equals(bool) ? 0 : Determinism.values().length) + determinism.ordinal()]; }
public static boolean isTrue(Expression child) { if (child!=null) { return child == BOOLEAN_EXPRESSIONS[Determinism.values().length+child.getDeterminism().ordinal()]; } return false; }
private static LiteralExpression getTypedNullLiteralExpression(PDataType type, Determinism determinism){ return TYPED_NULL_EXPRESSIONS[type.ordinal()+PDataType.values().length*determinism.ordinal()]; }
public static boolean isBooleanNull(Expression child) { if (child!=null) { return child == TYPED_NULL_EXPRESSIONS[PBoolean.INSTANCE.ordinal()+PDataType.values().length*child.getDeterminism().ordinal()]; } return false; }
@Override public void write(DataOutput output) throws IOException { WritableUtils.writeVInt(output, (byteValue.length + 1) * (this.determinism==Determinism.ALWAYS ? 1 : -1)); output.write(byteValue); // since we need to support clients of a lower version, serialize the determinism enum ordinal in the int used to // serialize sort order system value (which is either 1 or 2) int sortOrderAndDeterminism = ((this.determinism.ordinal()+1)<<2) + sortOrder.getSystemValue(); WritableUtils.writeVInt(output, sortOrderAndDeterminism); WritableUtils.writeVInt(output, this.type == null ? -1 : this.type.ordinal()); }
public static boolean isFalse(Expression child) { if (child!=null) { return child == BOOLEAN_EXPRESSIONS[child.getDeterminism().ordinal()]; } return false; }
public static boolean isFalse(Expression child) { if (child!=null) { return child == BOOLEAN_EXPRESSIONS[child.getDeterminism().ordinal()]; } return false; }
@Override public Boolean defaultReturn(Expression node, List<Boolean> returnValues) { if (node.getDeterminism().ordinal() > Determinism.PER_STATEMENT.ordinal() || returnValues.size() < node.getChildren().size()) { return Boolean.FALSE; } for (Boolean returnValue : returnValues) { if (!returnValue) { return Boolean.FALSE; } } return Boolean.TRUE; }
public static boolean isTrue(Expression child) { if (child!=null) { return child == BOOLEAN_EXPRESSIONS[Determinism.values().length+child.getDeterminism().ordinal()]; } return false; }
public static boolean isTrue(Expression child) { if (child!=null) { return child == BOOLEAN_EXPRESSIONS[Determinism.values().length+child.getDeterminism().ordinal()]; } return false; }
public static boolean isBooleanNull(Expression child) { if (child!=null) { return child == TYPED_NULL_EXPRESSIONS[PBoolean.INSTANCE.ordinal()+PDataType.values().length*child.getDeterminism().ordinal()]; } return false; }
@Override public void write(DataOutput output) throws IOException { WritableUtils.writeVInt(output, (byteValue.length + 1) * (this.determinism==Determinism.ALWAYS ? 1 : -1)); output.write(byteValue); // since we need to support clients of a lower version, serialize the determinism enum ordinal in the int used to // serialize sort order system value (which is either 1 or 2) int sortOrderAndDeterminism = ((this.determinism.ordinal()+1)<<2) + sortOrder.getSystemValue(); WritableUtils.writeVInt(output, sortOrderAndDeterminism); WritableUtils.writeVInt(output, this.type == null ? -1 : this.type.ordinal()); }
@Override public void write(DataOutput output) throws IOException { WritableUtils.writeVInt(output, (byteValue.length + 1) * (this.determinism==Determinism.ALWAYS ? 1 : -1)); output.write(byteValue); // since we need to support clients of a lower version, serialize the determinism enum ordinal in the int used to // serialize sort order system value (which is either 1 or 2) int sortOrderAndDeterminism = ((this.determinism.ordinal()+1)<<2) + sortOrder.getSystemValue(); WritableUtils.writeVInt(output, sortOrderAndDeterminism); WritableUtils.writeVInt(output, this.type == null ? -1 : this.type.ordinal()); }