pmak-852 opened a new issue, #8989:
URL: https://github.com/apache/hudi/issues/8989
**Describe the problem you faced**
I am exploring hudi locally with spark. It takes unexpectedly long time to
upsert small dataframe when using more cores.
The upsert time is doubled when I am using **local[*]** instead of
**local[1]**.
Want to ask for advice on the hudi configuration
**To Reproduce**
Below is the notebook script I used
from faker import Faker
```
builder = (
SparkSession.builder
.appName("sample_writer")
.config("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
.config("spark.sql.extensions",
"org.apache.spark.sql.hudi.HoodieSparkSessionExtension")
.config('spark.jars.packages',
'org.apache.hudi:hudi-spark3.3-bundle_2.12:0.13.0')
.master('local[1]')
)
spark = builder.getOrCreate()
fake = Faker()
rs = []
for i in range(0,2000):
record = {}
record['id'] = i
record['name'] = fake.name()
record['date'] = fake.date_this_month()
record['partition_year'] = record['date'].year
record['lat'] = fake.latitude()
record['log']= fake.longitude()
record['value1'] = fake.random_digit()
record['value2'] = fake.random_digit()
record['value3'] = fake.random_digit()
record['value4'] = fake.random_digit()
record['value5'] = fake.random_digit()
rs.append(record)
df = spark.createDataFrame(rs)
hudi_options = {
'hoodie.table.name': 'sample_df',
'hoodie.index.type': 'BLOOM',
'hoodie.datasource.write.operation': 'upsert',
'hoodie.datasource.write.table.name': 'sample_df',
'hoodie.datasource.write.table.type': 'COPY_ON_WRITE',
'hoodie.datasource.write.recordkey.field': "date,name",
'hoodie.datasource.write.partitionpath.field': "partition_year",
'hoodie.datasource.write.drop.partition.columns': "true",
'hoodie.datasource.write.precombine.field': "date",
'hoodie.parquet.compression.codec': 'snappy',
'hoodie.cleaner.policy': 'KEEP_LATEST_COMMITS',
}
df.write.format('hudi').mode('append').options(**hudi_options).save('/ws/benchmark')
```
A clear and concise description of what you expected to happen.
**Environment Description**
* Hudi version :
* Spark version :
* Hive version :
* Hadoop version :
* Storage (HDFS/S3/GCS..) :
* Running on Docker? (yes/no) : no
**Additional context**
The upsert should mainly be inserting (90%).
--
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]