[GitHub] [carbondata] akashrn5 commented on a change in pull request #3290: [WIP] Fix creating mv datamap with column name having length more than 128

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akashrn5 commented on a change in pull request #3290: [WIP] Fix creating mv datamap with column name having length more than 128

GitBox
akashrn5 commented on a change in pull request #3290: [WIP] Fix creating mv datamap with column name having length more than 128
URL: https://github.com/apache/carbondata/pull/3290#discussion_r293788127
 
 

 ##########
 File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/datamap/MVHelper.scala
 ##########
 @@ -320,13 +322,16 @@ object MVHelper {
   }
 
   def getUpdatedName(name: String): String = {
-    val updatedName = name.replace("(", "_")
+    var updatedName = name.replace("(", "_")
       .replace(")", "")
       .replace(" ", "_")
       .replace("=", "")
       .replace(",", "")
       .replace(".", "_")
       .replace("`", "")
+    if (updatedName.length >= CarbonCommonConstants.MAXIMUM_CHAR_LENGTH) {
+      updatedName = updatedName.substring(0, 110) + CarbonCommonConstants.UNDERSCORE + sysNanoTime
 
 Review comment:
   i think, if you take the substring and add always the same time to it, there can be chance that two columns get same name

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


With regards,
Apache Git Services