This is an automated email from the ASF dual-hosted git repository.
jakevin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 4fec0826f8 [fix](Nereids): avoid Exception to cause analyze time too
long (#23627)
4fec0826f8 is described below
commit 4fec0826f853b57323b4b7ad1bf284be4c78c374
Author: jakevin <[email protected]>
AuthorDate: Wed Aug 30 12:25:31 2023 +0800
[fix](Nereids): avoid Exception to cause analyze time too long (#23627)
AnyDataType will cause toCatalogDataType throw Exception, it will cost much
time.
Avoid to throw Exception in Analyzer.
---
.../nereids/trees/expressions/functions/IdenticalSignature.java | 8 ++++++++
.../trees/expressions/functions/ImplicitlyCastableSignature.java | 7 +++++++
.../trees/expressions/functions/NullOrIdenticalSignature.java | 8 ++++++++
3 files changed, 23 insertions(+)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/IdenticalSignature.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/IdenticalSignature.java
index 829f9125e4..499cd15f7f 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/IdenticalSignature.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/IdenticalSignature.java
@@ -18,7 +18,9 @@
package org.apache.doris.nereids.trees.expressions.functions;
import org.apache.doris.catalog.FunctionSignature;
+import org.apache.doris.nereids.types.ArrayType;
import org.apache.doris.nereids.types.DataType;
+import org.apache.doris.nereids.types.coercion.AnyDataType;
import java.util.List;
@@ -33,6 +35,12 @@ public interface IdenticalSignature extends ComputeSignature
{
static boolean isIdentical(DataType signatureType, DataType realType) {
try {
// TODO: copy matchesType to DataType
+ // TODO: resolve AnyDataType invoke toCatalogDataType
+ if (signatureType instanceof ArrayType) {
+ if (((ArrayType) signatureType).getItemType() instanceof
AnyDataType) {
+ return false;
+ }
+ }
return
realType.toCatalogDataType().matchesType(signatureType.toCatalogDataType());
} catch (Throwable t) {
// the signatureType maybe DataType and can not cast to catalog
data type.
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ImplicitlyCastableSignature.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ImplicitlyCastableSignature.java
index 0a0f2a972f..490d1344b2 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ImplicitlyCastableSignature.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ImplicitlyCastableSignature.java
@@ -19,6 +19,7 @@ package org.apache.doris.nereids.trees.expressions.functions;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.catalog.Type;
+import org.apache.doris.nereids.types.ArrayType;
import org.apache.doris.nereids.types.DataType;
import org.apache.doris.nereids.types.NullType;
import org.apache.doris.nereids.types.coercion.AnyDataType;
@@ -51,6 +52,12 @@ public interface ImplicitlyCastableSignature extends
ComputeSignature {
}
try {
// TODO: copy isImplicitlyCastable method to DataType
+ // TODO: resolve AnyDataType invoke toCatalogDataType
+ if (signatureType instanceof ArrayType) {
+ if (((ArrayType) signatureType).getItemType() instanceof
AnyDataType) {
+ return false;
+ }
+ }
if (Type.isImplicitlyCastable(realType.toCatalogDataType(),
signatureType.toCatalogDataType(), true)) {
return true;
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/NullOrIdenticalSignature.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/NullOrIdenticalSignature.java
index 5ed0bea656..6533d0fa50 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/NullOrIdenticalSignature.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/NullOrIdenticalSignature.java
@@ -18,8 +18,10 @@
package org.apache.doris.nereids.trees.expressions.functions;
import org.apache.doris.catalog.FunctionSignature;
+import org.apache.doris.nereids.types.ArrayType;
import org.apache.doris.nereids.types.DataType;
import org.apache.doris.nereids.types.NullType;
+import org.apache.doris.nereids.types.coercion.AnyDataType;
import java.util.List;
@@ -34,6 +36,12 @@ public interface NullOrIdenticalSignature extends
ComputeSignature {
static boolean isNullOrIdentical(DataType signatureType, DataType
realType) {
try {
// TODO: copy matchesType to DataType
+ // TODO: resolve AnyDataType invoke toCatalogDataType
+ if (signatureType instanceof ArrayType) {
+ if (((ArrayType) signatureType).getItemType() instanceof
AnyDataType) {
+ return false;
+ }
+ }
return realType instanceof NullType
||
realType.toCatalogDataType().matchesType(signatureType.toCatalogDataType());
} catch (Throwable t) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]