[fix](multi-catalog)fix hive partition insert regression case (#35846)
from #35821
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -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} """
|
||||
|
||||
Reference in New Issue
Block a user