github-actions[bot] commented on code in PR #68532:
URL: https://github.com/apache/doris/pull/68532#discussion_r4124844886
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java:
##########
@@ -1265,6 +1291,9 @@ private static Optional<DataType>
findCommonVariantType(VariantType left, Varian
private static Optional<DataType> findWiderPrimitiveTypeForTwo(
DataType leftType, DataType rightType, boolean overflowToDouble,
boolean stringIsHighPriority) {
+ if (leftType.isVarBinaryType() || rightType.isVarBinaryType()) {
Review Comment:
[P1] Guard mixed binary collections before unsupported BE functions. For a
STRING slot `s`, this branch makes `array(X'61', s)` and `map(X'61', 1, s, 2)`
use VARBINARY elements/keys; both used STRING at the base in either coercion
mode. `array_min`/`array_max` accept the array in FE, but their BE aggregate
factory throws for TYPE_VARBINARY. `map_contains_key` accepts the map, but its
BE `array_contains` dispatch excludes TYPE_VARBINARY; mixed map values also
reach `map_contains_value`/`map_contains_entry` without binary dispatch. These
formerly executable expressions now fail when prepared or run. Reject VARBINARY
for these functions during analysis or implement their byte-wise BE paths, and
add mixed binary/text tests for both coercion modes.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java:
##########
@@ -2036,6 +2069,9 @@ private static Optional<DataType>
findCommonComplexTypeForCaseWhen(DataType left
@VisibleForTesting
@Deprecated
public static Optional<DataType>
findCommonPrimitiveTypeForCaseWhen(DataType t1, DataType t2) {
+ if (t1.isVarBinaryType() || t2.isVarBinaryType()) {
Review Comment:
[P1] Preserve mixed binary/text DISTINCT set operations. For a STRING slot
`s`, `SELECT X'61' AS v UNION SELECT s AS v FROM source_bytes` (likewise
`INTERSECT`/`EXCEPT`) previously chose a STRING common column in both coercion
modes. The new binary common-type branches make it VARBINARY. `UNION DISTINCT`
rewrites to an aggregate that FE rejects as a VARBINARY group key;
`INTERSECT`/`EXCEPT` either get a local aggregate with the same rejection or
reach BE set hash initialization, which rejects VARBINARY keys. These formerly
working queries now fail. Keep STRING coercion for DISTINCT set operators until
binary deduplication is supported, or add the binary hash path and mixed-input
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]