wForget commented on code in PR #7181:
URL: https://github.com/apache/kyuubi/pull/7181#discussion_r2668326884


##########
extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/helper/SparkSQLLineageParseHelper.scala:
##########
@@ -124,19 +115,19 @@ trait LineageParser {
   }
 
   private def getSelectColumnLineage(
-      named: Seq[NamedExpression],
-      inputTablesByPlan: mutable.HashSet[String]): AttributeMap[AttributeSet] 
= {
+      named: Seq[NamedExpression]): AttributeMap[AttributeSet] = {
     val exps = named.map {
       case exp: Alias =>
         val references =
-          if (exp.references.nonEmpty) exp.references
-          else {
+          if (exp.references.isEmpty || 
exp.child.isInstanceOf[ScalarSubquery]) {

Review Comment:
   Is it enough to simply check if exp.child is a ScalarSubquery? Do we need to 
recursively check the children of exp?
   
   For example, could you verify this sql?
   
   ```
   select if((select sum(a) from table0 where table1.b = table0.b) > 100, 1, 2) 
as aa, b from table1
   ```



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