pan3793 commented on code in PR #6911:
URL: https://github.com/apache/kyuubi/pull/6911#discussion_r1950577762


##########
extensions/spark/kyuubi-spark-lineage/src/test/scala/org/apache/kyuubi/plugin/lineage/helper/SparkSQLLineageParserHelperSuite.scala:
##########
@@ -1442,6 +1448,39 @@ class SparkSQLLineageParserHelperSuite extends 
KyuubiFunSuite
     }
   }
 
+  test("test directory to table") {
+    val inputFile = getClass.getResource("/").getPath + "input_file"
+    val sourceFile = File(inputFile).createFile()
+    spark.sql(
+      s"""
+         | CREATE OR REPLACE TEMPORARY VIEW temp_view
+         |(
+         | `a` STRING COMMENT '',
+         | `b` STRING COMMENT ''
+         |)
+         |USING csv OPTIONS(
+         |    sep='\t',
+         |    path='${sourceFile.path}'
+         |);
+         |""".stripMargin).collect()
+
+    val ret0 = extractLineageWithoutExecuting(
+      s"""
+         |insert overwrite table test_db.test_table_from_dir
+         |SELECT
+         | `a`,
+         | `b`
+         |FROM temp_view
+         |""".stripMargin)

Review Comment:
   nit: use UPPER CASE for SQL keywords, and format the SQL in a short readable 
way
   
   ```suggestion
         s"""
            |INSERT OVERWRITE TABLE test_db.test_table_from_dir
            |SELECT `a`, `b` FROM temp_view
            |""".stripMargin)
   ```



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