Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -1806,3 +1806,17 @@ with serdeproperties
,'seperatorChar'=',');

insert into employee_gz values ('a', '1.1'), ('b', '2.2');

create database hive_schema_change;
use hive_schema_change;

create table struct_test (
id int,
sf struct<f1: int, f2: map<string, string>>) stored as parquet;

insert into struct_test values
(1, named_struct('f1', 1, 'f2', str_to_map('1:s2,2:s2'))),
(2, named_struct('f1', 2, 'f2', str_to_map('k1:s3,k2:s4'))),
(3, named_struct('f1', 3, 'f2', str_to_map('k1:s5,k2:s6')));

alter table struct_test change sf sf struct<f1:int, f2: string>;
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ suite("test_hive_parquet", "p0,external,hive,external_docker,external_docker_hiv
"""
}

def q21 = {
sql """use hive_schema_change"""
// not support the schema change of complex type
test {
sql "select * from struct_test"
exception "Wrong data type for column 'f2'"
}
}

String enabled = context.config.otherConfigs.get("enableHiveTest")
if (enabled != null && enabled.equalsIgnoreCase("true")) {
try {
Expand Down Expand Up @@ -175,6 +184,7 @@ suite("test_hive_parquet", "p0,external,hive,external_docker,external_docker_hiv
q18()
q19()
q20()
q21()

sql """explain physical plan select l_partkey from partition_table
where (nation != 'cn' or city !='beijing') and (l_quantity > 28 or l_extendedprice > 30000)
Expand Down