github-actions[bot] commented on code in PR #69567:
URL: https://github.com/apache/doris/pull/69567#discussion_r4366311383


##########
fe/fe-connector/fe-connector-paimon/src/main/java/org/apache/doris/connector/paimon/PaimonWriteBinding.java:
##########
@@ -165,6 +187,9 @@ static Map<String, String> 
resolveStaticPartition(FileStoreTable table, Connecto
             if (type.getTypeRoot() == DataTypeRoot.CHAR && 
charPaddedFields.test(canonicalName)) {
                 value = padChar(value, ((CharType) type).getLength());
             }
+            if (isBinary(type)) {
+                value = binaryStaticValue(canonicalName, value);

Review Comment:
   [P2] Support finite binary lengths in the static-value cast
   
   For a Paimon table with `p BINARY(2)` or `VARBINARY(2)`, partitioned by `p` 
with `partition.legacy-name=false`, `INSERT OVERWRITE t PARTITION (p = X'4142') 
SELECT 1` still fails while planning, even though the bytes are valid UTF-8 and 
fit the column. These source types map to Doris `VARBINARY(2)`, whereas the 
parser gives the binary literal `VarBinaryType.INSTANCE` (maximum length). 
`getCastStaticPartitionSpec()` calls 
`PluginDrivenInsertCommandContext.writtenValue` -> `Literal.checkedCastTo`; 
`Literal.uncheckedCastTo` rejects differing VARBINARY lengths, so the call at 
line 172 throws before reaching this new conversion. The added finite-type 
tests supply `0x4142` through a fake handle and bypass that failure. Add 
byte-preserving binary-to-binary literal casting/retagging and cover the real 
command context so the newly enabled finite-type overwrites can reach the 
decoder.



-- 
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]

Reply via email to