ulysses-you commented on code in PR #4393:
URL: https://github.com/apache/kyuubi/pull/4393#discussion_r1113881042


##########
extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/helper/SparkSQLLineageParseHelper.scala:
##########
@@ -327,6 +336,19 @@ trait LineageParser {
           joinColumnsLineage(parentColumnsLineage, 
getSelectColumnLineage(p.aggregateExpressions))
         p.children.map(extractColumnsLineage(_, 
nextColumnsLineage)).reduce(mergeColumnsLineage)
 
+      case p: Expand =>
+        val childColumnsLineage = ListMap(p.output.collect {
+          case attr
+              if p.references.find(
+                _.name == 
attr.name.split('.').last.stripPrefix("`").stripSuffix("`")).nonEmpty =>
+            val ref = p.references
+              .find(_.name == 
attr.name.split('.').last.stripPrefix("`").stripSuffix("`")).get
+            (attr, ref.references)

Review Comment:
   what happens with `select count(distinct c1 + c2) as x, count(distinct(c3)) 
as y` ?
   do we return x -> [c1, c2] and y -> [c3] ?



-- 
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