-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
CreateExternalTableLikeTest.java
35 lines (29 loc) · 1.24 KB
/
CreateExternalTableLikeTest.java
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
// This file is licensed under the Elastic License 2.0. Copyright 2021-present, StarRocks Limited.
package com.starrocks.analysis;
import com.starrocks.qe.ConnectContext;
import com.starrocks.sql.analyzer.AnalyzeTestUtil;
import com.starrocks.utframe.StarRocksAssert;
import com.starrocks.utframe.UtFrameUtils;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import javax.validation.constraints.AssertTrue;
public class CreateExternalTableLikeTest {
private static StarRocksAssert starRocksAssert;
private static ConnectContext ctx;
@BeforeClass
public static void beforeClass() throws Exception {
UtFrameUtils.createMinStarRocksCluster();
AnalyzeTestUtil.init();
starRocksAssert = new StarRocksAssert();
starRocksAssert.withDatabase("db1").useDatabase("tbl1");
ctx = new ConnectContext(null);
ctx.setGlobalStateMgr(AccessTestUtil.fetchAdminCatalog());
}
@Test
public void testCreateTableLike() {
String sql_1 = "CREATE EXTERNAL TABLE hive_test_like LIKE hive_test";
com.starrocks.analysis.StatementBase statementBase = AnalyzeTestUtil.analyzeSuccess(sql_1);
Assert.assertTrue(statementBase instanceof CreateTableLikeStmt);
}
}