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

[fix](meta) fix bug for using full name in show_full_columns stmt #28019

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add test cases
  • Loading branch information
Yulei-Yang committed Dec 6, 2023
commit 2791e291a8793b2d674bdcea86b88e5219e6f990
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("test_show_colums", "p0,external,hive,external_docker,external_docker_hive") {

sql """create database if not exists db1"""
sql """drop table if exists db1.test_full_column"""
sql '''create table db1.test_full_column (
id int not null,
name varchar(20) not null
)
distributed by hash(id) buckets 4
properties (
"replication_num"="1"
);
'''
result = sql """show full columns from db1.test_full_column"""
assertEquals(result.size(), 2)
assertEquals(result[0][0], "id")

String enabled = context.config.otherConfigs.get("enableHiveTest")
if (enabled != null && enabled.equalsIgnoreCase("true")) {
String hms_port = context.config.otherConfigs.get("hms_port")
String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")

String catalog_name = "hive_test_other"

sql """drop catalog if exists ${catalog_name}"""
sql """create catalog if not exists ${catalog_name} properties (
"type"="hms",
'hive.metastore.uris' = 'thrift://${externalEnvIp}:${hms_port}'
);"""

sql """switch ${catalog_name}"""

result = sql """show full columns from internal.db1.test_full_column"""
assertEquals(result.size(), 2)
assertEquals(result[0][0], "id")

sql """switch internal"""

result = sql """show full columns from internal.db1.test_full_column"""
assertEquals(result.size(), 2)
assertEquals(result[1][0], "name")

sql """drop catalog if exists ${catalog_name}"""
}
}