You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/10/17 06:13:56 UTC

[GitHub] [spark] lvshaokang commented on a diff in pull request #38251: [SPARK-40368][SQL] Migrate Bloom Filter type check failures onto error classes

lvshaokang commented on code in PR #38251:
URL: https://github.com/apache/spark/pull/38251#discussion_r996646587


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/BloomFilterMightContain.scala:
##########
@@ -59,12 +61,25 @@ case class BloomFilterMightContain(
             if !subquery.containsPattern(OUTER_REFERENCE) =>
             TypeCheckResult.TypeCheckSuccess
           case _ =>
-            TypeCheckResult.TypeCheckFailure(s"The Bloom filter binary input to $prettyName " +
-              "should be either a constant value or a scalar subquery expression")
+            DataTypeMismatch(
+              errorSubClass = "BLOOM_FILTER_BINARY_OP_WRONG_TYPE",
+              messageParameters = Map(
+                "functionName" -> toSQLId(prettyName),
+                "actual" -> toSQLType(bloomFilterExpression.dataType)

Review Comment:
   > toSQLExpr(bloomFilterExpression)
   
   Yes, I tested it and using `toSQLExpr` is more clearer and useful, it will return actual bloomFilterExpression.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org