You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/06/29 14:38:30 UTC

[GitHub] [hudi] garyli1019 commented on a change in pull request #3182: [HUDI-2089]fix the bug that metatable cannot support non_partition table

garyli1019 commented on a change in pull request #3182:
URL: https://github.com/apache/hudi/pull/3182#discussion_r660684007



##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java
##########
@@ -318,7 +318,12 @@ private void bootstrapFromFilesystem(HoodieEngineContext engineContext, HoodieTa
             createInstantTime);
       }).forEach(status -> {
         HoodieWriteStat writeStat = new HoodieWriteStat();
-        writeStat.setPath(partition + Path.SEPARATOR + status.getPath().getName());
+        // deal Non-partition table

Review comment:
       nit: deal with

##########
File path: hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestMORDataSource.scala
##########
@@ -677,4 +677,40 @@ class TestMORDataSource extends HoodieClientTestBase {
 
     assertEquals(partitionCounts("2021/03/03"), count7)
   }
+
+  @Test
+  def testNonPartitionTableWithMetaTableEnabled(): Unit = {
+    val df = spark.range(0, 10).toDF("keyid")
+      .withColumn("col3", expr("keyid"))
+      .withColumn("age", expr("keyid + 1000"))
+
+    df.write.format("hudi").
+      option(DataSourceWriteOptions.TABLE_TYPE_OPT_KEY, DataSourceWriteOptions.MOR_TABLE_TYPE_OPT_VAL).

Review comment:
       use `.option` to keep the style consistent?




-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org