924060929 commented on code in PR #68934:
URL: https://github.com/apache/doris/pull/68934#discussion_r4255472271
##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergConnectorTransaction.java:
##########
@@ -929,14 +930,19 @@ private Expression buildPartitionFilter(Map<String,
String> staticPartitions, Pa
* both paths that build this predicate: DELETE/UPDATE/MERGE conflict
detection and
* {@code INSERT OVERWRITE ... PARTITION(d='nan')}.
*/
- private static Expression identityPartitionPredicate(String sourceColName,
Object value) {
+ private static Expression identityPartitionPredicate(Types.NestedField
sourceField, Object value) {
+ String sourceColName = sourceField.name();
if (value == null) {
return Expressions.isNull(sourceColName);
}
if ((value instanceof Double || value instanceof Float)
&& Double.isNaN(((Number) value).doubleValue())) {
return Expressions.isNaN(sourceColName);
}
+ if (sourceField.type().typeId() == TypeID.TIMESTAMP_NANO) {
+ // Partition values are already nanos; a raw Long would be rebound
as microseconds.
+ return Expressions.equal(sourceColName, Expressions.nanos((Long)
value));
Review Comment:
Confirmed in the FE review at `3f7020a33f405beaf37e5adbf07ccbb55a06774a`.
`commitStaticPartitionOverwrite` builds this predicate directly, while only
user-supplied constraints pass through `IcebergPredicateConverter.forTable`.
The generated partition conflict filter also calls this helper. Please share
the table-history safety check across these entry points: reject an unsafe
static overwrite or interpret the retained bounds correctly; dropping the
overwrite predicate would incorrectly broaden deletion. The regression case
should retain an unpartitioned DATE file across promotion and
identity-partition addition, then verify that static overwrite removes the
intended old rows. Static source/dependency inspection only; I did not run
tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]