Package com.alibaba.druid.sql.dialect.odps.parser

Examples of com.alibaba.druid.sql.dialect.odps.parser.OdpsStatementParser.match()


    public void test_0() throws Exception {
        String sql = "show partitions secods.xxx";
        OdpsStatementParser parser = new OdpsStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toOdpsString(stmt);
        Assert.assertEquals("SHOW PARTITIONS secods.xxx", output);
    }
}
View Full Code Here


    public void test_0() throws Exception {
        String sql = "CREATE TABLE sale_detail_like LIKE sale_detail;";
        OdpsStatementParser parser = new OdpsStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toOdpsString(stmt);
        Assert.assertEquals("CREATE TABLE sale_detail_likesale_detail_like LIKE sale_detail", output);
    }
}
View Full Code Here

                     + "PARTITIONED BY (sale_date STRING,region STRING)" //
                     + "LIFECYCLE 5" //
                     + ";";
        OdpsStatementParser parser = new OdpsStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toOdpsString(stmt);
        Assert.assertEquals("CREATE TABLE IF NOT EXISTS sale_detailsale_detail ("//
                + "\n\tshop_name STRING, "//
                + "\n\tcustomer_id STRING, "//
                + "\n\ttotal_price DOUBLE"//
View Full Code Here

    public void test_0() throws Exception {
        String sql = "show statistic secods.xxx";
        OdpsStatementParser parser = new OdpsStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toOdpsString(stmt);
        Assert.assertEquals("SHOW STATISTIC secods.xxx", output);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.