panbingkun commented on code in PR #38438:
URL: https://github.com/apache/spark/pull/38438#discussion_r1010349649


##########
sql/core/src/test/java/test/org/apache/spark/sql/JavaColumnExpressionSuite.java:
##########
@@ -79,12 +80,8 @@ public void isInCollectionCheckExceptionMessage() {
       createStructField("a", IntegerType, false),
       createStructField("b", createArrayType(IntegerType, false), false)));
     Dataset<Row> df = spark.createDataFrame(rows, schema);
-    Exception e = Assert.assertThrows(Exception.class,
+    AnalysisException e = Assert.assertThrows(AnalysisException.class,
       () -> df.filter(df.col("a").isInCollection(Arrays.asList(new 
Column("b")))));
-    Arrays.asList("cannot resolve",
-      "due to data type mismatch: Arguments must be same type but were")
-        .forEach(s ->
-          Assert.assertTrue(e.getMessage().toLowerCase(Locale.ROOT)
-            .contains(s.toLowerCase(Locale.ROOT))));
+    
Assert.assertTrue(e.message().startsWith("[DATATYPE_MISMATCH.DATA_DIFF_TYPES]"));

Review Comment:
   e is an AnalysisException
   <img width="877" alt="image" 
src="https://user-images.githubusercontent.com/15246973/199227396-98442bc1-f5d6-4779-8e09-b21691b7ade5.png";>
   



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to