pedrumj2 commented on code in PR #13639:
URL: https://github.com/apache/gluten/pull/13639#discussion_r4624539751


##########
shims/spark35/src/main/scala/org/apache/gluten/sql/shims/spark35/Spark35Shims.scala:
##########
@@ -440,4 +441,7 @@ class Spark35Shims extends SparkShims {
       params.clock
     )
   }
+
+  override def charVarcharLengthExceededError(limit: Int, cause: Throwable): 
RuntimeException =
+    GlutenQueryExecutionErrors.exceedMaxLimit(limit, cause)

Review Comment:
   Thanks for taking a look @zhztheplayer 
   
   > Why we need a new class `GlutenQueryExecutionErrors` here?
   
   TLDR: its to access package private class in Spark. 
   
   Spark calls 
[exceedMaxLimit](https://github.com/apache/spark/blob/v3.5.5/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala#L2576)
 which belongs to 
[QueryExceptionErrors](https://github.com/apache/spark/blob/v3.5.5/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala#L62)
 which is a package private class inside  `package org.apache.spark.sql`. It 
throws a 
[SparkRuntimeException](https://github.com/apache/spark/blob/v3.5.5/common/utils/src/main/scala/org/apache/spark/SparkException.scala#L406)
 which is also another package private class inside `org.apache.spark` and can 
only be reached by classes inside those packages and their nested packages. 
   
   The Gluten shims are inside `org.apache.gluten` so they won't be able to 
access any of those classes. The goal with this extra class is to allow access 
to those package private methods. 
   
   But please let me know if there is a better approach here, thanks!



-- 
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: [email protected]

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