Search in sources :

Example 1 with ExpressionType

use of com.hazelcast.jet.sql.impl.support.expressions.ExpressionType in project hazelcast by hazelcast.

the class ComparisonPredicateIntegrationTest method testNumeric.

@Test(timeout = 600_000)
public void testNumeric() {
    Object[] values = getNumericValues();
    for (int i = 0; i < values.length; i++) {
        for (int j = i; j < values.length; j++) {
            checkNumeric(values[i], values[j]);
        }
    }
    for (ExpressionType type : ExpressionTypes.numeric()) {
        // Column/column
        checkUnsupportedColumnColumn(type, ExpressionTypes.allExcept(ExpressionTypes.numeric()));
        // Column/literal
        SqlColumnType columnType = type.getFieldConverterType().getTypeFamily().getPublicType();
        checkUnsupportedColumnLiteral(type.valueFrom(), columnType, LITERAL_VARCHAR, LITERAL_BOOLEAN);
        // Column/parameter
        if (type.getFieldConverterType().getTypeFamily().getPrecedence() >= QueryDataType.BIGINT.getTypeFamily().getPrecedence()) {
            checkUnsupportedColumnParameter(type.valueFrom(), columnType, 0, ExpressionTypes.allExcept(ExpressionTypes.numeric()));
        }
    }
}
Also used : ExpressionType(com.hazelcast.jet.sql.impl.support.expressions.ExpressionType) SqlColumnType(com.hazelcast.sql.SqlColumnType) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

ExpressionType (com.hazelcast.jet.sql.impl.support.expressions.ExpressionType)1 SqlColumnType (com.hazelcast.sql.SqlColumnType)1 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1