Search in sources :

Example 46 with OdpsStatementParser

use of com.alibaba.druid.sql.dialect.odps.parser.OdpsStatementParser in project druid by alibaba.

the class OdpsSetLabelTest method test_odps.

public void test_odps() throws Exception {
    String sql = "SET LABEL S3 TO USER aliyun$abc@alibaba-inc.com";
    OdpsStatementParser parser = new OdpsStatementParser(sql);
    SQLStatement stmt = parser.parseStatementList().get(0);
    parser.match(Token.EOF);
    Assert.assertEquals("SET LABEL S3 TO USER aliyun$abc@alibaba-inc.com", SQLUtils.toOdpsString(stmt));
    Assert.assertEquals("set label S3 to user aliyun$abc@alibaba-inc.com", SQLUtils.toOdpsString(stmt, SQLUtils.DEFAULT_LCASE_FORMAT_OPTION));
}
Also used : OdpsStatementParser(com.alibaba.druid.sql.dialect.odps.parser.OdpsStatementParser) SQLStatement(com.alibaba.druid.sql.ast.SQLStatement)

Aggregations

SQLStatement (com.alibaba.druid.sql.ast.SQLStatement)46 OdpsStatementParser (com.alibaba.druid.sql.dialect.odps.parser.OdpsStatementParser)46 OdpsSchemaStatVisitor (com.alibaba.druid.sql.dialect.odps.visitor.OdpsSchemaStatVisitor)8 SchemaStatVisitor (com.alibaba.druid.sql.visitor.SchemaStatVisitor)6 InputStream (java.io.InputStream)6 InputStreamReader (java.io.InputStreamReader)6 Reader (java.io.Reader)6 Column (com.alibaba.druid.stat.TableStat.Column)2 MySqlSchemaStatVisitor (com.alibaba.druid.sql.dialect.mysql.visitor.MySqlSchemaStatVisitor)1 OdpsOutputVisitor (com.alibaba.druid.sql.dialect.odps.visitor.OdpsOutputVisitor)1 SQLStatementParser (com.alibaba.druid.sql.parser.SQLStatementParser)1 SqlCodeStat (com.alibaba.druid.support.opds.udf.SqlCodeStat)1 File (java.io.File)1