OmniSciDB  2e3a973ef4
DDLTest.java
Go to the documentation of this file.
1 package com.mapd.parser.extension.ddl;
2 
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.fail;
5 
6 import com.google.gson.Gson;
7 import com.google.gson.JsonObject;
10 import com.omnisci.thrift.calciteserver.TPlanResult;
11 
12 import org.junit.Before;
13 
14 import java.io.FileReader;
15 import java.util.ArrayList;
16 
17 public class DDLTest {
18  protected String resourceDirPath;
19  protected static final Gson gson = new Gson();
20  protected String jsonTestDir;
22 
23  @Before
24  public void setup() throws Exception {
25  calciteServerHandler = new CalciteServerHandler(0,
26  "",
27  resourceDirPath + "ast/test_extension_functions.ast",
29  "");
30  }
31 
32  TPlanResult processDdlCommand(final String ddlCommand) throws Exception {
33  return calciteServerHandler.process(
34  "", "", "", ddlCommand, new ArrayList<>(), false, false, false);
35  }
36 
37  JsonObject getJsonFromFile(final String fileName) throws Exception {
38  final String filePath = resourceDirPath + "json/ddl/" + jsonTestDir + "/" + fileName;
39  return gson.fromJson(new FileReader(filePath), JsonObject.class);
40  }
41 }
JsonObject getJsonFromFile(final String fileName)
Definition: DDLTest.java:37
CalciteServerHandler calciteServerHandler
Definition: DDLTest.java:21
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:32
static SockTransportProperties getUnencryptedClient()
TPlanResult process(String user, String session, String catalog, String sqlText, java.util.List< TFilterPushDownInfo > thriftFilterPushDownInfo, boolean legacySyntax, boolean isExplain, boolean isViewOptimize)