mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved odps sql parser support 'read ...'
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.alibaba.druid.bvt.sql.odps;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class OdpsReadTest extends TestCase {
|
||||
|
||||
public void test_read() throws Exception {
|
||||
String sql = "read sale_detail";
|
||||
Assert.assertEquals("READ sale_detail", SQLUtils.formatOdps(sql));
|
||||
}
|
||||
|
||||
|
||||
public void test_read_column() throws Exception {
|
||||
String sql = "read sale_detail(f0, f1, f2) 10";
|
||||
Assert.assertEquals("READ sale_detail (f0, f1, f2) 10", SQLUtils.formatOdps(sql));
|
||||
}
|
||||
|
||||
public void test_read_limit() throws Exception {
|
||||
String sql = "read sale_detail 10";
|
||||
Assert.assertEquals("READ sale_detail 10", SQLUtils.formatOdps(sql));
|
||||
}
|
||||
|
||||
public void test_read_partition() throws Exception {
|
||||
String sql = "read sale_detail partition(ds='20150701')";
|
||||
Assert.assertEquals("READ sale_detail PARTITION (ds = '20150701')", SQLUtils.formatOdps(sql));
|
||||
}
|
||||
|
||||
public void test_read_partition_limit() throws Exception {
|
||||
String sql = "read sale_detail partition(ds='20150701') 10";
|
||||
Assert.assertEquals("READ sale_detail PARTITION (ds = '20150701') 10", SQLUtils.formatOdps(sql));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user