Search in sources :

Example 1 with HazelcastTableFunction

use of com.hazelcast.jet.sql.impl.schema.HazelcastTableFunction in project hazelcast by hazelcast.

the class HazelcastSqlOperatorTableTest method testOperandTypeChecker.

/**
 * Make sure that all our operators either define the top-level operand checker that overrides that call binding,
 * or confirm explicitly that they override the binding manually.
 */
@Test
public void testOperandTypeChecker() {
    for (SqlOperator operator : HazelcastSqlOperatorTable.instance().getOperatorList()) {
        boolean valid = operator instanceof HazelcastOperandTypeCheckerAware || operator instanceof HazelcastTableFunction || operator instanceof HazelcastWindowTableFunction || operator instanceof HazelcastCaseOperator || operator == HazelcastSqlOperatorTable.ARGUMENT_ASSIGNMENT;
        assertTrue("Operator must implement one of classes from " + HazelcastFunction.class.getPackage().toString() + ": " + operator.getClass().getSimpleName(), valid);
    }
}
Also used : HazelcastWindowTableFunction(com.hazelcast.jet.sql.impl.aggregate.function.HazelcastWindowTableFunction) HazelcastTableFunction(com.hazelcast.jet.sql.impl.schema.HazelcastTableFunction) SqlOperator(org.apache.calcite.sql.SqlOperator) HazelcastFunction(com.hazelcast.jet.sql.impl.validate.operators.common.HazelcastFunction) HazelcastCaseOperator(com.hazelcast.jet.sql.impl.validate.operators.misc.HazelcastCaseOperator) HazelcastOperandTypeCheckerAware(com.hazelcast.jet.sql.impl.validate.operators.common.HazelcastOperandTypeCheckerAware) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 2 with HazelcastTableFunction

use of com.hazelcast.jet.sql.impl.schema.HazelcastTableFunction in project hazelcast by hazelcast.

the class HazelcastSqlOperatorTableTest method testReturnTypeInference.

@Test
public void testReturnTypeInference() {
    for (SqlOperator operator : HazelcastSqlOperatorTable.instance().getOperatorList()) {
        if (operator instanceof HazelcastTableFunction || operator instanceof HazelcastWindowTableFunction || operator == HazelcastSqlOperatorTable.IN || operator == HazelcastSqlOperatorTable.NOT_IN || operator == HazelcastSqlOperatorTable.UNION || operator == HazelcastSqlOperatorTable.UNION_ALL || operator == HazelcastSqlOperatorTable.ARGUMENT_ASSIGNMENT) {
            continue;
        }
        boolean valid = operator.getReturnTypeInference() instanceof HazelcastReturnTypeInference;
        assertTrue("Operator must have " + HazelcastReturnTypeInference.class.getSimpleName() + ": " + operator.getClass().getSimpleName(), valid);
    }
}
Also used : HazelcastWindowTableFunction(com.hazelcast.jet.sql.impl.aggregate.function.HazelcastWindowTableFunction) HazelcastTableFunction(com.hazelcast.jet.sql.impl.schema.HazelcastTableFunction) SqlOperator(org.apache.calcite.sql.SqlOperator) HazelcastReturnTypeInference(com.hazelcast.jet.sql.impl.validate.operators.typeinference.HazelcastReturnTypeInference) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

HazelcastWindowTableFunction (com.hazelcast.jet.sql.impl.aggregate.function.HazelcastWindowTableFunction)2 HazelcastTableFunction (com.hazelcast.jet.sql.impl.schema.HazelcastTableFunction)2 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2 SqlOperator (org.apache.calcite.sql.SqlOperator)2 Test (org.junit.Test)2 HazelcastFunction (com.hazelcast.jet.sql.impl.validate.operators.common.HazelcastFunction)1 HazelcastOperandTypeCheckerAware (com.hazelcast.jet.sql.impl.validate.operators.common.HazelcastOperandTypeCheckerAware)1 HazelcastCaseOperator (com.hazelcast.jet.sql.impl.validate.operators.misc.HazelcastCaseOperator)1 HazelcastReturnTypeInference (com.hazelcast.jet.sql.impl.validate.operators.typeinference.HazelcastReturnTypeInference)1