use of com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser in project druid by alibaba.
the class ExtractTest_Year method test_timestamp.
public void test_timestamp() throws Exception {
String sql = "EXTRACT(YEAR FROM TIMESTAMP '2001-02-16 20:38:40')";
PGExprParser parser = new PGExprParser(sql);
PGExtractExpr expr = (PGExtractExpr) parser.expr();
System.out.println(expr.toString());
}
use of com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser in project druid by alibaba.
the class CidrTest method test_timestamp.
public void test_timestamp() throws Exception {
String sql = "cidr '10.1.0.0/16'";
PGExprParser parser = new PGExprParser(sql);
PGCidrExpr expr = (PGCidrExpr) parser.expr();
Assert.assertEquals("cidr '10.1.0.0/16'", expr.toString());
}
use of com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser in project druid by alibaba.
the class LineSegmentsTest method test_timestamp.
public void test_timestamp() throws Exception {
String sql = "lseg '((-1,0),(1,0))'";
PGExprParser parser = new PGExprParser(sql);
PGLineSegmentsExpr expr = (PGLineSegmentsExpr) parser.expr();
Assert.assertEquals("lseg '((-1,0),(1,0))'", expr.toString());
}
use of com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser in project druid by alibaba.
the class PolygonTest method test_timestamp.
public void test_timestamp() throws Exception {
String sql = "# '((1,0),(0,1),(-1,0))'";
PGExprParser parser = new PGExprParser(sql);
SQLUnaryExpr unaryExpr = (SQLUnaryExpr) parser.expr();
Assert.assertEquals(SQLUnaryOperator.Pound, unaryExpr.getOperator());
}
use of com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser in project druid by alibaba.
the class TimestampTest method test_timestamp.
public void test_timestamp() throws Exception {
String sql = "TIMESTAMP '2004-10-19 10:23:54+02'";
PGExprParser parser = new PGExprParser(sql);
SQLTimestampExpr expr = (SQLTimestampExpr) parser.expr();
System.out.println(expr.toString());
}
Aggregations