[GitHub] [carbondata] ravipesala commented on a change in pull request #3297: [CARBONDATA-3444]Fix MV query failure when column name and table name is same in case of join scenario

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

[GitHub] [carbondata] ravipesala commented on a change in pull request #3297: [CARBONDATA-3444]Fix MV query failure when column name and table name is same in case of join scenario

GitBox
ravipesala commented on a change in pull request #3297: [CARBONDATA-3444]Fix MV query failure when column name and table name is same in case of join scenario
URL: https://github.com/apache/carbondata/pull/3297#discussion_r296076681
 
 

 ##########
 File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/datamap/MVUtil.scala
 ##########
 @@ -310,4 +310,35 @@ object MVUtil {
         " are not allowed for this datamap")
     }
   }
+
+  def updateDuplicateColumns(outputList: Seq[NamedExpression]): Seq[NamedExpression] = {
+    val duplicateNameCols = outputList.groupBy(_.name).filter(_._2.length > 1).flatMap(_._2)
+      .toList
+    val updatedOutList = outputList.map { col =>
+      val duplicateColumn = duplicateNameCols
+        .find(a => a.semanticEquals(col))
+      val qualifiedName = col.qualifier.getOrElse(s"${ col.name }_${ col.exprId.id }")
 
 Review comment:
   I think it supposed to be
   ```
   val qualifiedName =col.qualifier.getOrElse(s"${ col.exprId.id }")+"_" + col.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