This is an automated email from the ASF dual-hosted git repository.
vinoth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new e807bb8 [HUDI-1487] fix unit test testCopyOnWriteStorage random
failed (#2364)
e807bb8 is described below
commit e807bb895e5a31a40f51b2c2bd9b732d26bebd46
Author: lw0090 <[email protected]>
AuthorDate: Sat Dec 26 01:54:23 2020 +0800
[HUDI-1487] fix unit test testCopyOnWriteStorage random failed (#2364)
---
.../scala/org/apache/hudi/functional/TestCOWDataSource.scala | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestCOWDataSource.scala
b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestCOWDataSource.scala
index dd83bf8..0386f20 100644
---
a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestCOWDataSource.scala
+++
b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestCOWDataSource.scala
@@ -107,6 +107,7 @@ class TestCOWDataSource extends HoodieClientTestBase {
.options(commonOpts)
.mode(SaveMode.Append)
.save(basePath)
+ val commitInstantTime2 = HoodieDataSourceHelpers.latestCommit(fs, basePath)
val snapshotDF2 = spark.read.format("hudi").load(basePath + "/*/*/*/*")
assertEquals(100, snapshotDF2.count())
@@ -122,7 +123,7 @@ class TestCOWDataSource extends HoodieClientTestBase {
.mode(SaveMode.Append)
.save(basePath)
- val commitInstantTime2 = HoodieDataSourceHelpers.latestCommit(fs, basePath)
+ val commitInstantTime3 = HoodieDataSourceHelpers.latestCommit(fs, basePath)
assertEquals(3, HoodieDataSourceHelpers.listCommitsSince(fs, basePath,
"000").size())
// Snapshot Query
@@ -154,18 +155,18 @@ class TestCOWDataSource extends HoodieClientTestBase {
// pull the latest commit
val hoodieIncViewDF2 = spark.read.format("org.apache.hudi")
.option(DataSourceReadOptions.QUERY_TYPE_OPT_KEY,
DataSourceReadOptions.QUERY_TYPE_INCREMENTAL_OPT_VAL)
- .option(DataSourceReadOptions.BEGIN_INSTANTTIME_OPT_KEY,
commitInstantTime1)
+ .option(DataSourceReadOptions.BEGIN_INSTANTTIME_OPT_KEY,
commitInstantTime2)
.load(basePath)
assertEquals(uniqueKeyCnt, hoodieIncViewDF2.count()) // 100 records must
be pulled
countsPerCommit =
hoodieIncViewDF2.groupBy("_hoodie_commit_time").count().collect()
assertEquals(1, countsPerCommit.length)
- assertEquals(commitInstantTime2, countsPerCommit(0).get(0))
+ assertEquals(commitInstantTime3, countsPerCommit(0).get(0))
// pull the latest commit within certain partitions
val hoodieIncViewDF3 = spark.read.format("org.apache.hudi")
.option(DataSourceReadOptions.QUERY_TYPE_OPT_KEY,
DataSourceReadOptions.QUERY_TYPE_INCREMENTAL_OPT_VAL)
- .option(DataSourceReadOptions.BEGIN_INSTANTTIME_OPT_KEY,
commitInstantTime1)
+ .option(DataSourceReadOptions.BEGIN_INSTANTTIME_OPT_KEY,
commitInstantTime2)
.option(DataSourceReadOptions.INCR_PATH_GLOB_OPT_KEY, "/2016/*/*/*")
.load(basePath)
assertEquals(hoodieIncViewDF2.filter(col("_hoodie_partition_path").contains("2016")).count(),
hoodieIncViewDF3.count())