leanken commented on a change in pull request #30560:
URL: https://github.com/apache/spark/pull/30560#discussion_r533303435



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala
##########
@@ -394,7 +394,7 @@ trait GetMapValueUtil extends BinaryExpression with 
ImplicitCastInputTypes {
     val keyJavaType = CodeGenerator.javaType(keyType)
     nullSafeCodeGen(ctx, ev, (eval1, eval2) => {
       val keyNotFoundBranch = if (failOnError) {
-        s"""throw new NoSuchElementException("Key " + $eval2 + " does not 
exist.");"""
+        s"""throw new java.util.NoSuchElementException("Key " + $eval2 + " 
does not exist.");"""

Review comment:
       > @leanken, can we add a test?
   
   Currently, this case being missed in SPARK-33460 it is because 
checkExceptionInExpression is not as expected. And as i investigated, there are 
some cases would fail if I correct the behavior of checkExceptionInExpression 
by using withSQLConf set CodeGenFallBack to false, like ObjectExpressionsSuite 
and RegexpExpressionsSuite and ETC.
   
   So I need your advise. Should I
   1. Fix all these wrong behavior separately and then final fix 
checkExceptionInExpression.
   2. Fix all these wrong behavior and checkExceptionInExpression with the same 
patch.
   
   The reason why i submit this PR it's because this bug introduced by me and I 
know of the history, but all those other behavior is fresh to me, and the 
all-in-one fix might be big.
   
   As for add a test to the java.util.NoSuchElementException, I think the 
offline manual verification is enough, If we fix checkExceptionInExpression, 
and make it reliable, then we don't need to check code gen behavior for every 
new added or updated operation, right?
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to