forked from StarRocks/starrocks
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature]add UT for
create external table like
DDL (StarRocks#8804)
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
fe/fe-core/src/test/java/com/starrocks/analysis/CreateExternalTableLikeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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); | ||
} | ||
} |