[ 
https://issues.apache.org/jira/browse/HUDI-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17400430#comment-17400430
 ] 

ASF GitHub Bot commented on HUDI-1674:
--------------------------------------

wangxianghu commented on a change in pull request #3488:
URL: https://github.com/apache/hudi/pull/3488#discussion_r690429555



##########
File path: 
hudi-examples/src/main/scala/org/apache/hudi/examples/spark/HoodieDataSourceExample.scala
##########
@@ -129,6 +130,43 @@ object HoodieDataSourceExample {
         save(tablePath)
   }
 
+  /**
+   * Deleta data based in data information
+   */
+  def delete(spark: SparkSession, tablePath: String, tableName: String): Unit 
= {
+
+    val roViewDF = spark.read.format("org.apache.hudi").load(tablePath + 
"/*/*/*/*")
+    roViewDF.createOrReplaceTempView("hudi_ro_table")
+    val df = spark.sql("select uuid, partitionpath, ts from  hudi_ro_table 
limit 2")
+
+    df.write.format("org.apache.hudi").
+      options(getQuickstartWriteConfigs).
+      option(PRECOMBINE_FIELD.key, "ts").
+      option(RECORDKEY_FIELD.key, "uuid").
+      option(PARTITIONPATH_FIELD.key, "partitionpath").
+      option(TABLE_NAME.key, tableName).
+      option(OPERATION.key, DELETE_OPERATION_OPT_VAL).
+      mode(Append).
+      save(tablePath)
+  }
+
+  /**
+   *  Delete the data of a single or multiple partitions

Review comment:
       same here




-- 
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-unsubscr...@hudi.apache.org

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


> add partition level delete DOC or example
> -----------------------------------------
>
>                 Key: HUDI-1674
>                 URL: https://issues.apache.org/jira/browse/HUDI-1674
>             Project: Apache Hudi
>          Issue Type: Sub-task
>            Reporter: liwei
>            Assignee: liujinhui
>            Priority: Minor
>              Labels: docs, pull-request-available, user-support-issues
>         Attachments: image-2021-03-08-09-57-05-768.png
>
>
> !image-2021-03-08-09-57-05-768.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to