xglv1985 opened a new pull request, #6911:
URL: https://github.com/apache/kyuubi/pull/6911

   ### Why are the changes needed?
   The changes in this PR will avoid a runtime exception when generating the 
instance of org.apache.kyuubi.plugin.lineage.Lineage, in the certain case as 
follows:
   step 1: create a temporary view from a file
   step 2: insert into a table by selecting from the temporary view in step 1
   step 3: generate the lineage when executing the insert statement in step 2
   
   Without the changes, a None org.apache.kyuubi.plugin.lineage.Lineage object 
will be generated due to "try-catch" self-protection, in the above case. This 
None object will lead to problems in the following 2 scenes:
   1.In Unit Test, when the code runs here a "None.get" exception will be 
raised:
   <img width="682" alt="image" 
src="https://github.com/user-attachments/assets/102dc9bd-294f-4b1e-b1c6-01b6fee50fed";
 />
   
   2. Due this Lineage object is None, a wrong value, it cannot be used in the 
production environment. The right content of the Lineage instance in the above 
case should be:
   inputTables(List())
   outputTables(List(spark_catalog.test_db.test_table_from_dir))
   
columnLineage(List(ColumnLineage(spark_catalog.test_db.test_table_from_dir.a0,Set()),
 ColumnLineage(spark_catalog.test_db.test_table_from_dir.b0,Set())))
   
   a newly added test case(test directory to table) passed after this issue is 
fixed.
   
   
   ### How was this patch tested?
   1.by adding a new test case in UT code and make sure it passes
   2.by submitting a Spark application including the SQL of this case in the 
production environment, and make sure a right Lineage instance is generated, 
instead of a None object
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No
   
   


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