Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]add UT for create external table like DDL #8804

Merged
merged 2 commits into from Jul 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,35 @@
// This file is licensed under the Elastic License 2.0. Copyright 2021-present, StarRocks Limited.

package com.starrocks.analysis;
imay marked this conversation as resolved.
Show resolved Hide resolved

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);
}
}