-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtestParse.java
More file actions
35 lines (29 loc) · 1.02 KB
/
Copy pathtestParse.java
File metadata and controls
35 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package hive;
import gudusoft.gsqlparser.EDbVendor;
import gudusoft.gsqlparser.TGSqlParser;
import junit.framework.TestCase;
/**
* Created by IntelliJ IDEA.
* User: tako
* Date: 13-7-21
* Time: 下午10:43
* To change this template use File | Settings | File Templates.
*/
public class testParse extends TestCase {
public void test1(){
TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvhive);
sqlparser.sqltext = "INSERT OVERWRITE TABLE pv_gender_sum\n" +
" SELECT pv_users.gender, count (DISTINCT pv_users.userid)\n" +
" FROM pv_users\n" +
" GROUP BY pv_users.gender;";
assertTrue(sqlparser.parse() == 0);
}
public void test2(){
TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvhive);
sqlparser.sqltext =
" SELECT pv_users.gender, count (DISTINCT pv_users.userid)\n" +
" FROM pv_users\n" +
" GROUP BY pv_users.gender;";
assertTrue(sqlparser.parse() == 0);
}
}