PHILO-HE commented on code in PR #10523:
URL:
https://github.com/apache/incubator-gluten/pull/10523#discussion_r2299996621
##########
backends-velox/src/main/scala/org/apache/gluten/expression/ExpressionRestrictions.scala:
##########
@@ -64,9 +64,14 @@ object ToJsonRestrictions extends ExpressionRestrictions {
val NOT_SUPPORT_WITH_OPTIONS: String =
s"${ExpressionNames.TO_JSON} with options is not supported in Velox"
+ val NOT_SUPPORT_UPPERCASE_STRUCT: String =
+ s"${ExpressionNames.TO_JSON} with 'spark.sql.caseSensitive = false' and
has struct type" +
+ s" which contains uppercase field name is not supported in Velox"
Review Comment:
Suggestion:
"When 'spark.sql.caseSensitive = false', ${ExpressionNames.TO_JSON} produces
unexpected result for struct field with uppercase name."
##########
gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionUtils.scala:
##########
@@ -40,4 +43,15 @@ object ExpressionUtils {
def hasComplexExpressions(plan: SparkPlan, threshold: Int): Boolean = {
hasComplexExpressions(plan.expressions, threshold)
}
+
+ def hasUppercaseFieldsStruct(dataType: DataType): Boolean = {
+ dataType match {
+ case StructType(fields) =>
+ fields.exists(field => field.name.toLowerCase(Locale.ROOT) !=
field.name)
Review Comment:
Suggestion:
`fields.exists(_.name.exists(_.isUpper))`
##########
gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionUtils.scala:
##########
@@ -40,4 +43,15 @@ object ExpressionUtils {
def hasComplexExpressions(plan: SparkPlan, threshold: Int): Boolean = {
hasComplexExpressions(plan.expressions, threshold)
}
+
+ def hasUppercaseFieldsStruct(dataType: DataType): Boolean = {
Review Comment:
Suggestion: `hasUppercaseStructFieldName`
--
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]