This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new b33a1613abf [fix](multi-catalog)fix hive partition insert regression
case (#35821)
b33a1613abf is described below
commit b33a1613abf058ac027eb8d8e08db8704ff0d0d9
Author: slothever <[email protected]>
AuthorDate: Tue Jun 4 12:01:11 2024 +0800
[fix](multi-catalog)fix hive partition insert regression case (#35821)
forbid hive external table insert with partition spec and modify
regression case
---
.../nereids/analyzer/UnboundTableSinkCreator.java | 3 +++
.../hive/ddl/test_hive_write_type.groovy | 24 +++++++++++++---------
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundTableSinkCreator.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundTableSinkCreator.java
index 6c361c36f05..66222fcf3d6 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundTableSinkCreator.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundTableSinkCreator.java
@@ -105,6 +105,9 @@ public class UnboundTableSinkCreator {
isPartialUpdate, dmlCommandType, Optional.empty(),
Optional.empty(), plan);
} else if (curCatalog instanceof HMSExternalCatalog &&
!isAutoDetectPartition) {
+ if (!partitions.isEmpty()) {
+ throw new AnalysisException("Not support insert with partition
spec in hive catalog.");
+ }
return new UnboundHiveTableSink<>(nameParts, colNames, hints,
partitions,
dmlCommandType, Optional.empty(), Optional.empty(), plan);
} else if (curCatalog instanceof IcebergExternalCatalog &&
!isAutoDetectPartition) {
diff --git
a/regression-test/suites/external_table_p0/hive/ddl/test_hive_write_type.groovy
b/regression-test/suites/external_table_p0/hive/ddl/test_hive_write_type.groovy
index ae5caa80d54..62b8b730e2b 100644
---
a/regression-test/suites/external_table_p0/hive/ddl/test_hive_write_type.groovy
+++
b/regression-test/suites/external_table_p0/hive/ddl/test_hive_write_type.groovy
@@ -178,9 +178,9 @@ suite("test_hive_write_type",
"p0,external,hive,external_docker,external_docker_
`col7` DECIMAL(6,4) COMMENT 'col7',
`col8` VARCHAR(11) COMMENT 'col8',
`col9` STRING COMMENT 'col9',
+ `pt3` DATE COMMENT 'pt3',
`pt1` VARCHAR COMMENT 'pt1',
- `pt2` STRING COMMENT 'pt2',
- `pt3` DATE COMMENT 'pt3'
+ `pt2` STRING COMMENT 'pt2'
) ENGINE=hive
PARTITION BY LIST (pt1, pt2) ()
PROPERTIES (
@@ -197,7 +197,7 @@ suite("test_hive_write_type",
"p0,external,hive,external_docker,external_docker_
} catch (Exception e) {
log.info(e.getMessage())
// BE err msg need use string contains to check
- assertTrue(e.getMessage().contains("Arithmetic overflow,
convert failed from 1234567, expected data is [-999999, 999999]"))
+ assertTrue(e.getMessage().contains("Arithmetic overflow when
converting value 123.4567 from type Decimal(7, 4) to type Decimal(6, 4)"))
}
try {
@@ -208,7 +208,7 @@ suite("test_hive_write_type",
"p0,external,hive,external_docker,external_docker_
"""
} catch (Exception e) {
log.info(e.getMessage())
- assertTrue(e.getMessage().contains("Arithmetic overflow,
convert failed from 1234567, expected data is [-999999, 999999]"))
+ assertTrue(e.getMessage().contains("Arithmetic overflow when
converting value 123.4567 from type Decimal(7, 4) to type Decimal(6, 4)"))
}
test {
@@ -246,20 +246,24 @@ suite("test_hive_write_type",
"p0,external,hive,external_docker,external_docker_
VALUES
('abcdefghij', 'error', true, 123);
"""
- exception "errCode = 2, detailMessage = Column count doesn't
match value count"
+ exception "errCode = 2, detailMessage = Not support insert
with partition spec in hive catalog"
}
- sql """ INSERT INTO ex_tbl_${file_format} partition(`pt1`,`pt2`)
(`col3`, `col6`, `col9`)
- VALUES
- (9876543210, 6.28, 'no_error');
- """
+ // TODO: support partition spec
+ test {
+ sql """ INSERT INTO ex_tbl_${file_format}
partition(`pt1`,`pt2`) (`col3`, `col6`, `col9`)
+ VALUES
+ (9876543210, 6.28, 'no_error');
+ """
+ exception "errCode = 2, detailMessage = Not support insert
with partition spec in hive catalog"
+ }
test {
sql """ INSERT INTO ex_tbl_${file_format} partition(`pt0`,
`pt1`,`pt3`) (`col3`, `col6`, `col9`)
VALUES
('err', 'err', 'err', 9876543210, 6.28, 'error');
"""
- exception "errCode = 2, detailMessage = Column count doesn't
match value count"
+ exception "errCode = 2, detailMessage = Not support insert
with partition spec in hive catalog"
}
sql """ DROP TABLE
${catalog_name}.test_hive_ex.ex_tbl_${file_format} """
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]