zsxwing commented on code in PR #48986:
URL: https://github.com/apache/spark/pull/48986#discussion_r1866296703
##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala:
##########
@@ -1111,7 +1129,12 @@ private[hive] object HiveClientImpl extends Logging {
// struct<x:int,y.z:int> -> struct<`x`:int,`y.z`:int>
// array<struct<x:int,y.z:int>> -> array<struct<`x`:int,`y.z`:int>>
// map<string,struct<x:int,y.z:int>> ->
map<string,struct<`x`:int,`y.z`:int>>
- val typeStr = hc.getType.replaceAll("(?<=struct<|,)([^,<:]+)(?=:)", "`$1`")
+ val typeStr = if (SQLConf.get.getConf(QUOTE_HIVE_STRUCT_FIELD_NAME) &&
+ hc.getType.indexOf('`') < 0) { // This a defensive code for possible
changes in HMS
Review Comment:
Do we really need this code?
- For old Spark versions, they will not be able to write `typeStr` not
supported by `CatalystSqlParser.parseDataType` into HMS.
- For new Spark versions, including this change, this case should be taken
care of. 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.
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]