hudi-agent commented on code in PR #19657:
URL: https://github.com/apache/hudi/pull/19657#discussion_r4043921327
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestCOWDataSource.scala:
##########
@@ -1450,6 +1450,47 @@ class TestCOWDataSource extends
HoodieSparkClientTestBase with ScalaAssertionSup
assertTrue(recordsReadDF.filter(col("_hoodie_partition_path") =!=
udf_date_format(col("current_ts"))).count() == 0)
}
+ @ParameterizedTest
+ @EnumSource(value = classOf[HoodieRecordType], names = Array("AVRO",
"SPARK"))
+ def testTimestampBasedKeyGeneratorWithVariousConfigurations(recordType:
HoodieRecordType) {
+ val (writeOpts, readOpts) =
getWriterReaderOptsLessPartitionPath(recordType)
+
+ val records = recordsToStrings(dataGen.generateInserts("000",
2)).asScala.toList
+ val inputDF = spark.read.json(spark.sparkContext.parallelize(records, 1))
+ .withColumn("current_date_string", lit("2009-02-14 07:31:30"))
+ .withColumn("current_ts_micros", lit(1234596690123456L))
+
+ case class TestCase(partitionCol: String, tsType: String,
Review Comment:
🤖 nit: the multi-line case class declaration has inconsistent indentation on
the wrapped parameters — might be worth reformatting to line up under the
opening paren.
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]