dongjoon-hyun commented on a change in pull request #23609: [SPARK-26379][SS]
Fix issue on adding current_timestamp/current_date to streaming query
URL: https://github.com/apache/spark/pull/23609#discussion_r251191048
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala
##########
@@ -1079,6 +1080,51 @@ class StreamSuite extends StreamTest {
assert(query.exception.isEmpty)
}
}
+
+ test("SPARK-26379 Structured Streaming - Exception on adding
current_timestamp / current_date" +
+ " to Dataset - use v2 sink") {
+ testCurrentTimestampOnStreamingQuery(useV2Sink = true)
+ }
+
+ test("SPARK-26379 Structured Streaming - Exception on adding
current_timestamp / current_date" +
+ " to Dataset - use v1 sink") {
+ testCurrentTimestampOnStreamingQuery(useV2Sink = false)
+ }
+
+ private def testCurrentTimestampOnStreamingQuery(useV2Sink: Boolean): Unit =
{
+ val input = MemoryStream[Int]
+ val df = input.toDS()
+ .withColumn("cur_timestamp", lit(current_timestamp()))
+ .withColumn("cur_date", lit(current_date()))
Review comment:
Currently, this hides `current_timestamp` and makes this test case succeeds
always.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]