use of org.apache.hyracks.algebricks.core.algebra.typing.OpRefTypeEnvPointer in project asterixdb by apache.
the class SelectOperator method computeOutputTypeEnvironment.
@Override
public IVariableTypeEnvironment computeOutputTypeEnvironment(ITypingContext ctx) throws AlgebricksException {
ITypeEnvPointer[] envPointers = new ITypeEnvPointer[1];
envPointers[0] = new OpRefTypeEnvPointer(inputs.get(0), ctx);
PropagatingTypeEnvironment env = new PropagatingTypeEnvironment(ctx.getExpressionTypeComputer(), ctx.getMissableTypeComputer(), ctx.getMetadataProvider(), TypePropagationPolicy.ALL, envPointers);
if (condition.getValue().getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) {
return env;
}
AbstractFunctionCallExpression f1 = (AbstractFunctionCallExpression) condition.getValue();
if (!f1.getFunctionIdentifier().equals(AlgebricksBuiltinFunctions.NOT)) {
return env;
}
ILogicalExpression a1 = f1.getArguments().get(0).getValue();
if (a1.getExpressionTag() == LogicalExpressionTag.FUNCTION_CALL) {
AbstractFunctionCallExpression f2 = (AbstractFunctionCallExpression) a1;
if (f2.getFunctionIdentifier().equals(AlgebricksBuiltinFunctions.IS_MISSING)) {
ILogicalExpression a2 = f2.getArguments().get(0).getValue();
if (a2.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
LogicalVariable var = ((VariableReferenceExpression) a2).getVariableReference();
env.getNonNullVariables().add(var);
}
}
}
return env;
}
Aggregations