-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtestRedshift.java
More file actions
31 lines (26 loc) · 1.17 KB
/
Copy pathtestRedshift.java
File metadata and controls
31 lines (26 loc) · 1.17 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
package gettablecolumn;
import demos.gettablecolumns.TGetTableColumn;
import gudusoft.gsqlparser.EDbVendor;
import junit.framework.TestCase;
public class testRedshift extends TestCase {
static void doTest(String inputQuery, String desireResult){
TGetTableColumn getTableColumn = new TGetTableColumn(EDbVendor.dbvredshift);
getTableColumn.isConsole = false;
getTableColumn.showTableEffect = false;
getTableColumn.showColumnLocation = false;
getTableColumn.showTreeStructure = false;
getTableColumn.showDatatype = true;
getTableColumn.runText(inputQuery);
// System.out.println(getTableColumn.outList.toString().trim());
assertTrue(getTableColumn.outList.toString().trim().equalsIgnoreCase(desireResult));
}
public static void testLateralColumn() {
doTest("select clicks / impressions as probability, round(100 * probability, 1) as percentage from raw_data;",
"Tables:\n" +
"raw_data\n" +
"\n" +
"Fields:\n" +
"raw_data.clicks\n" +
"raw_data.impressions");
}
}