[fix](variant) fix variant cast (#39426)

## Proposed changes
backport: https://github.com/apache/doris/pull/39377
Issue Number: close #xxx

<!--Describe your changes.-->
This commit is contained in:
amory
2024-08-16 09:47:44 +08:00
committed by GitHub
parent 3aaee8f7d5
commit 46dc0d2192
2 changed files with 6 additions and 2 deletions

View File

@ -81,6 +81,8 @@ public class Cast extends Expression implements UnaryExpression {
return true;
} else if (childDataType.isJsonType() || targetType.isJsonType()) {
return true;
} else if (childDataType.isVariantType() || targetType.isVariantType()) {
return true;
} else {
return child().nullable();
}