Search in sources :

Example 1 with PGPointExpr

use of com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGPointExpr in project druid by alibaba.

the class BoxTest method test_timestamp.

public void test_timestamp() throws Exception {
    String sql = "box '((0,0),(1,1))' + point '(2.0,0)'";
    PGExprParser parser = new PGExprParser(sql);
    SQLBinaryOpExpr binaryExpr = (SQLBinaryOpExpr) parser.expr();
    PGBoxExpr box = (PGBoxExpr) binaryExpr.getLeft();
    PGPointExpr point = (PGPointExpr) binaryExpr.getRight();
    Assert.assertEquals("BOX '((0,0),(1,1))' + POINT '(2.0,0)'", binaryExpr.toString());
}
Also used : PGExprParser(com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser) SQLBinaryOpExpr(com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr) PGPointExpr(com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGPointExpr) PGBoxExpr(com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGBoxExpr)

Aggregations

SQLBinaryOpExpr (com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr)1 PGBoxExpr (com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGBoxExpr)1 PGPointExpr (com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGPointExpr)1 PGExprParser (com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser)1