pan3793 commented on code in PR #3185:
URL: https://github.com/apache/incubator-kyuubi/pull/3185#discussion_r951035041
##########
externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/events/handler/SparkJsonLoggingEventHandlerSuite.scala:
##########
@@ -128,4 +138,30 @@ class SparkJsonLoggingEventHandlerSuite extends
WithSparkSQLEngine with HiveJDBC
}
}
}
+
+ test("operation lineage event loggin: for execute sql") {
+ val statementEventPath = Paths.get(
+ logRoot,
+ "operation_lineage",
+ s"day=$currentDate",
+ spark.sparkContext.applicationId + ".json")
+ val table = statementEventPath.getParent
+
+ withTable("test_table0") { _ =>
+ spark.sql("create table test_table0(a string, b string)")
+ spark.sql("select a as col0, b as col1 from test_table0").collect()
+
+ val result = spark.sql(s"select * from `json`.`$table`")
+ val expected =
+ "WrappedArray(WrappedArray(col0, [\"default.test_table0.a\"]), " +
+ "WrappedArray(col1, [\"default.test_table0.b\"]))"
+
+ assert(result.select("lineage")
+ .collect().last
+ .getStruct(0)
+ .getAs("columnLineage")
+ .toString == expected)
Review Comment:
compare case class directly?
--
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]