You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "vinayakmalik95 (via GitHub)" <gi...@apache.org> on 2024/09/19 13:01:38 UTC

[I] [Bug] Lineage is empty when logical plan has no child [kyuubi]

vinayakmalik95 opened a new issue, #6706:
URL: https://github.com/apache/kyuubi/issues/6706

   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [X] I have searched in the [issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Describe the bug
   
   Lineage is returned as empty since we dont return the parentColumnLineage 
   
   ### but an empty AttributeSet()
   case p if p.children.isEmpty => ListMap[Attribute, AttributeSet]()
   ![Screenshot 2024-09-19 at 6 18 23 PM](https://github.com/user-attachments/assets/4156b47d-9953-4729-8a03-7c3a1ffabe4b)
   
   ### where as it should be
   case p if p.children.isEmpty => parentColumnsLineage
   ![Screenshot 2024-09-19 at 6 17 02 PM](https://github.com/user-attachments/assets/0aaf4a1c-6823-46a7-bbb4-8928cfffa27a)
   
   
   
   ### Affects Version(s)
   
   https://github.com/apache/kyuubi/releases/tag/v1.9.2
   
   ### Kyuubi Server Log Output
   
   ```logtalk
   No error in server logs, you can test it simply by running test cases like
   
     test("columns lineage extract - AppendData/OverwriteByExpression") {
       val ddls =
         """
           |create table v2_catalog.db.tb0(col1 int, col2 string) partitioned by(col2)
           |""".stripMargin
       ddls.split("\n").filter(_.nonEmpty).foreach(spark.sql(_).collect())
       withTable("v2_catalog.db.tb0") { _ =>
         val ret0 =
           extractLineage(
             s"insert into table v2_catalog.db.tb0 " +
               s"select key as col1, value as col2 from test_db0.test_table0")
         assert(ret0 == Lineage(
           List(s"$DEFAULT_CATALOG.test_db0.test_table0"),
           List("v2_catalog.db.tb0"),
           List(
             ("v2_catalog.db.tb0.col1", Set(s"$DEFAULT_CATALOG.test_db0.test_table0.key")),
             ("v2_catalog.db.tb0.col2", Set(s"$DEFAULT_CATALOG.test_db0.test_table0.value")))))
   
         val ret1 =
           extractLineage(
             s"insert overwrite table v2_catalog.db.tb0 partition(col2) " +
               s"select key as col1, value as col2 from test_db0.test_table0")
         assert(ret1 == Lineage(
           List(s"$DEFAULT_CATALOG.test_db0.test_table0"),
           List("v2_catalog.db.tb0"),
           List(
             ("v2_catalog.db.tb0.col1", Set(s"$DEFAULT_CATALOG.test_db0.test_table0.key")),
             ("v2_catalog.db.tb0.col2", Set(s"$DEFAULT_CATALOG.test_db0.test_table0.value")))))
   
         val ret2 =
           extractLineage(
             s"insert overwrite table v2_catalog.db.tb0 partition(col2 = 'bb') " +
               s"select key as col1 from test_db0.test_table0")
         assert(ret2 == Lineage(
           List(s"$DEFAULT_CATALOG.test_db0.test_table0"),
           List("v2_catalog.db.tb0"),
           List(
             ("v2_catalog.db.tb0.col1", Set(s"$DEFAULT_CATALOG.test_db0.test_table0.key")),
             ("v2_catalog.db.tb0.col2", Set()))))
       }
     }
   ```
   
   
   ### Kyuubi Engine Log Output
   
   ```logtalk
   Empty Lineage returned : 
   
   inputTables(List())
   outputTables(List())
   columnLineage(List())
   
   ### Whereas it should return lineage like
   Lineage(
           List(s"$DEFAULT_CATALOG.test_db0.test_table0"),
           List("v2_catalog.db.tb0"),
           List(
             ("v2_catalog.db.tb0.col1", Set(s"$DEFAULT_CATALOG.test_db0.test_table0.key")),
             ("v2_catalog.db.tb0.col2", Set(s"$DEFAULT_CATALOG.test_db0.test_table0.value")))))
   
   
   this test fails 
   
   ### Test name :   test("columns lineage extract - AppendData/OverwriteByExpression")
   ```
   
   
   ### Kyuubi Server Configurations
   
   _No response_
   
   ### Kyuubi Engine Configurations
   
   _No response_
   
   ### Additional context
   
   By uddating the logic when
   
   ### case p if p.children.isEmpty
   we should return the parentColumnLineage instead of empty ListMap[Attribute, AttributeSet]()
   
   
   ### Are you willing to submit PR?
   
   - [X] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix.
   - [ ] No. I cannot submit a PR at this time.


-- 
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: notifications-unsubscribe@kyuubi.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [I] [Bug] Lineage is empty when logical plan has no child [kyuubi]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6706:
URL: https://github.com/apache/kyuubi/issues/6706#issuecomment-2360927535

   Hello @vinayakmalik95,
   Thanks for finding the time to report the issue!
   We really appreciate the community's efforts to improve Apache Kyuubi.


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [I] [Bug] Lineage is empty when logical plan has no child [kyuubi]

Posted by "iodone (via GitHub)" <gi...@apache.org>.
iodone commented on issue #6706:
URL: https://github.com/apache/kyuubi/issues/6706#issuecomment-2375553627

    @Vinayakmalik95 You can try to fix it if the problem has been located.


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [I] [Bug] Lineage is empty when logical plan has no child [kyuubi]

Posted by "vinayakmalik95 (via GitHub)" <gi...@apache.org>.
vinayakmalik95 commented on issue #6706:
URL: https://github.com/apache/kyuubi/issues/6706#issuecomment-2360930133

   This is present in all release since the inception of lineage in kyuubi.
   
   @iodone let me know so I can raise the PR


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [I] [Bug] Lineage is empty when logical plan has no child [kyuubi]

Posted by "vinayakmalik95 (via GitHub)" <gi...@apache.org>.
vinayakmalik95 commented on issue #6706:
URL: https://github.com/apache/kyuubi/issues/6706#issuecomment-2374580014

   yes it fails with current unit test
   
   @iodone 


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [I] [Bug] Lineage is empty when logical plan has no child [kyuubi]

Posted by "iodone (via GitHub)" <gi...@apache.org>.
iodone commented on issue #6706:
URL: https://github.com/apache/kyuubi/issues/6706#issuecomment-2373148113

   > This is present in all releases since the inception of lineage in kyuubi.
   >
   > @iodone @zwangsheng @bowenliang123 @cfmcgrady let me know so I can raise the PR
   
   Can you run the unit test with your specific error case?


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [I] [Bug] Lineage is empty when logical plan has no child [kyuubi]

Posted by "vinayakmalik95 (via GitHub)" <gi...@apache.org>.
vinayakmalik95 commented on issue #6706:
URL: https://github.com/apache/kyuubi/issues/6706#issuecomment-2375798454

   I have already provided  the solution in the comments above, let me open the PR for the same.


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org