You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "wangxianghu (Jira)" <ji...@apache.org> on 2020/12/22 03:15:00 UTC
[jira] [Created] (HUDI-1485) Fix Deletes issued without any prior
commits exception
wangxianghu created HUDI-1485:
---------------------------------
Summary: Fix Deletes issued without any prior commits exception
Key: HUDI-1485
URL: https://issues.apache.org/jira/browse/HUDI-1485
Project: Apache Hudi
Issue Type: Bug
Reporter: wangxianghu
Assignee: wangxianghu
use the delete demo in quickstart
```
// spark-shell
// fetch total records count
spark.sql("select uuid, partitionpath from hudi_trips_snapshot").count()
// fetch two records to be deleted
val ds = spark.sql("select uuid, partitionpath from hudi_trips_snapshot").limit(2)
// issue deletes
val deletes = dataGen.generateDeletes(ds.collectAsList())
val df = spark.read.json(spark.sparkContext.parallelize(deletes, 2))
df.write.format("hudi").
options(getQuickstartWriteConfigs).
option(OPERATION_OPT_KEY,"delete").
option(PRECOMBINE_FIELD_OPT_KEY, "ts").
option(RECORDKEY_FIELD_OPT_KEY, "uuid").
option(PARTITIONPATH_FIELD_OPT_KEY, "partitionpath").
option(TABLE_NAME, tableName).
mode(Append).
save(basePath)
```
--
This message was sent by Atlassian Jira
(v8.3.4#803005)