Search in sources :

Example 1 with NamedOperandCheckerProgram

use of com.hazelcast.jet.sql.impl.validate.operand.NamedOperandCheckerProgram in project hazelcast by hazelcast.

the class HazelcastSqlOperandMetadata method checkOperandTypes.

@Override
public final boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure) {
    HazelcastCallBinding binding = prepareBinding(callBinding, operandTypeInference);
    boolean checkResult;
    if (ValidationUtil.hasAssignment(binding.getCall())) {
        OperandChecker[] checkers = parameters.stream().map(HazelcastTableFunctionParameter::checker).toArray(OperandChecker[]::new);
        checkResult = new NamedOperandCheckerProgram(checkers).check(binding, throwOnFailure);
    } else {
        OperandChecker[] checkers = parameters.stream().limit(binding.getOperandCount()).map(HazelcastTableFunctionParameter::checker).toArray(OperandChecker[]::new);
        checkResult = new OperandCheckerProgram(checkers).check(binding, throwOnFailure);
    }
    return checkResult && checkOperandTypes(binding, throwOnFailure);
}
Also used : NamedOperandCheckerProgram(com.hazelcast.jet.sql.impl.validate.operand.NamedOperandCheckerProgram) OperandChecker(com.hazelcast.jet.sql.impl.validate.operand.OperandChecker) OperandCheckerProgram(com.hazelcast.jet.sql.impl.validate.operand.OperandCheckerProgram) NamedOperandCheckerProgram(com.hazelcast.jet.sql.impl.validate.operand.NamedOperandCheckerProgram) HazelcastCallBinding(com.hazelcast.jet.sql.impl.validate.HazelcastCallBinding)

Aggregations

HazelcastCallBinding (com.hazelcast.jet.sql.impl.validate.HazelcastCallBinding)1 NamedOperandCheckerProgram (com.hazelcast.jet.sql.impl.validate.operand.NamedOperandCheckerProgram)1 OperandChecker (com.hazelcast.jet.sql.impl.validate.operand.OperandChecker)1 OperandCheckerProgram (com.hazelcast.jet.sql.impl.validate.operand.OperandCheckerProgram)1