Skip to content

Commit

Permalink
[Feature]add UT for create external table like DDL (StarRocks#8804)
Browse files Browse the repository at this point in the history
  • Loading branch information
adzfolc authored and melt-code committed Jul 17, 2022
1 parent 3b57232 commit 9ff800c
Showing 1 changed file with 35 additions and 0 deletions.
@@ -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);
}
}

0 comments on commit 9ff800c

Please sign in to comment.