-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtestFileFormat.java
More file actions
27 lines (21 loc) · 1.08 KB
/
Copy pathtestFileFormat.java
File metadata and controls
27 lines (21 loc) · 1.08 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
package mssql;
import gudusoft.gsqlparser.EDbVendor;
import gudusoft.gsqlparser.EFileFormat;
import gudusoft.gsqlparser.TGSqlParser;
import gudusoft.gsqlparser.stmt.snowflake.TCreateFileFormatStmt;
import junit.framework.TestCase;
public class testFileFormat extends TestCase {
public void test1(){
TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvazuresql);
sqlparser.sqltext = "CREATE EXTERNAL FILE FORMAT jsonFileFormat\n" +
"WITH (\n" +
"FORMAT_TYPE = JSON,\n" +
"DATA_COMPRESSION = 'org.apache.hadoop.io.compress.SnappyCodec'\n" +
");";
assertTrue(sqlparser.parse() == 0);
TCreateFileFormatStmt createFileFormatStmt = (TCreateFileFormatStmt)sqlparser.sqlstatements.get(0);
assertTrue(createFileFormatStmt.getFileFormatName().toString().equalsIgnoreCase("jsonFileFormat"));
assertTrue(createFileFormatStmt.getFileFormat() == EFileFormat.json);
assertTrue(createFileFormatStmt.getDataCompression().equalsIgnoreCase("'org.apache.hadoop.io.compress.SnappyCodec'"));
}
}