Search in sources :

Example 1 with ItemFuncBinary

use of com.actiontech.dble.plan.common.item.function.castfunc.ItemFuncBinary in project dble by actiontech.

the class MySQLItemVisitor method endVisit.

@Override
public void endVisit(SQLUnaryExpr x) {
    Item a = getItem(x.getExpr());
    switch(x.getOperator()) {
        case Negative:
            item = new ItemFuncNeg(a);
            break;
        case Not:
        case NOT:
            item = new ItemFuncNot(a);
            break;
        case Compl:
            item = new ItemFuncBitInversion(a);
            break;
        case Plus:
            item = a;
            break;
        case BINARY:
            item = new ItemFuncBinary(a, -1);
            break;
        default:
            throw new MySQLOutPutException(ErrorCode.ER_OPTIMIZER, "", "not supported kind expression:" + x.getOperator());
    }
    item.setWithSubQuery(a.isWithSubQuery());
    item.setCorrelatedSubQuery(a.isCorrelatedSubQuery());
    initName(x);
}
Also used : SQLSelectOrderByItem(com.alibaba.druid.sql.ast.statement.SQLSelectOrderByItem) ItemFuncNot(com.actiontech.dble.plan.common.item.function.operator.logic.ItemFuncNot) ItemFuncBinary(com.actiontech.dble.plan.common.item.function.castfunc.ItemFuncBinary) MySQLOutPutException(com.actiontech.dble.plan.common.exception.MySQLOutPutException)

Aggregations

MySQLOutPutException (com.actiontech.dble.plan.common.exception.MySQLOutPutException)1 ItemFuncBinary (com.actiontech.dble.plan.common.item.function.castfunc.ItemFuncBinary)1 ItemFuncNot (com.actiontech.dble.plan.common.item.function.operator.logic.ItemFuncNot)1 SQLSelectOrderByItem (com.alibaba.druid.sql.ast.statement.SQLSelectOrderByItem)1