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
@@ -0,0 +1,53 @@
create database if not exists partition_tables;
use partition_tables;

CREATE TABLE decimal_partition_table (
id INT,
name STRING,
value FLOAT
)
PARTITIONED BY (partition_col DECIMAL(10, 2))
STORED AS PARQUET
LOCATION '/user/doris/preinstalled_data/partition_tables/decimal_partition_table';

CREATE TABLE int_partition_table (
id INT,
name STRING,
value FLOAT
)
PARTITIONED BY (partition_col INT)
STORED AS PARQUET
LOCATION '/user/doris/preinstalled_data/partition_tables/int_partition_table';

CREATE TABLE string_partition_table (
id INT,
name STRING,
value FLOAT
)
PARTITIONED BY (partition_col STRING)
STORED AS PARQUET
LOCATION '/user/doris/preinstalled_data/partition_tables/string_partition_table';

CREATE TABLE date_partition_table (
id INT,
name STRING,
value FLOAT
)
PARTITIONED BY (partition_col DATE)
STORED AS PARQUET
LOCATION '/user/doris/preinstalled_data/partition_tables/date_partition_table';

CREATE TABLE string_partition_table_with_comma (
id INT,
name STRING,
value FLOAT
)
PARTITIONED BY (partition_col STRING)
STORED AS PARQUET
LOCATION '/user/doris/preinstalled_data/partition_tables/string_partition_table_with_comma';

msck repair table decimal_partition_table;
msck repair table int_partition_table;
msck repair table string_partition_table;
msck repair table date_partition_table;
msck repair table string_partition_table_with_comma;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ private FileCacheValue loadFiles(FileCacheKey key) {
} catch (Exception e) {
LOG.warn("unknown scheme in path: " + finalLocation, e);
}
FileInputFormat.setInputPaths(jobConf, finalLocation.get());
// NOTICE: the setInputPaths has 2 overloads, the 2nd arg should be Path not String
FileInputFormat.setInputPaths(jobConf, finalLocation.getPath());
try {
FileCacheValue result = getFileCache(finalLocation.get(), key.inputFormat, jobConf,
key.getPartitionValues(), key.bindBrokerName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ nation=us/city=washington

-- !q21 --

-- !string_partition_table_with_comma --
1 a 1.1 ,
2 b 2.2 a, b
3 c 3.3 a, b, c

-- !q01 --
33 1.11xyz
34 1.11XYZ
Expand Down Expand Up @@ -241,3 +246,8 @@ nation=us/city=washington

-- !q21 --

-- !string_partition_table_with_comma --
1 a 1.1 ,
2 b 2.2 a, b
3 c 3.3 a, b, c

Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ suite("test_hive_partitions", "p0,external,hive,external_docker,external_docker_

q01()

qt_string_partition_table_with_comma """
select * from partition_tables.string_partition_table_with_comma order by id;
"""

sql """set num_partitions_in_batch_mode=1"""
explain {
sql ("select * from partition_table")
Expand All @@ -99,8 +103,6 @@ suite("test_hive_partitions", "p0,external,hive,external_docker,external_docker_
contains "(approximate)inputSplitNum=60"
}
sql """unset variable num_partitions_in_batch_mode"""

// sql """drop catalog if exists ${catalog_name}"""
} finally {
}
}
Expand Down