SGITLOGIN opened a new issue, #12268:
URL: https://github.com/apache/iceberg/issues/12268
### Apache Iceberg version
1.6.1
### Query engine
Spark
### Please describe the bug 🐞
### Create table
spark.sql("""
CREATE TABLE test.iceberg_impression_log_05 (
`motype` string,
`third` string,
`logdate` string,
`dt` string)
USING iceberg
PARTITIONED BY (dt)
LOCATION
'oss://huan-bigdata-test/test/changguowei/iceberg_impression_log_05/'
TBLPROPERTIES (
'write.format.default' = 'orc',
'write.metadata.delete-after-commit.enabled' = 'true',
'write.metadata.previous-versions-max' = '2',
'write.target-file-size-bytes' = '134217728',
'write.orc.compression-codec' = 'zlib')
""").show()
### Add sort field
spark.sql("""
ALTER TABLE test.iceberg_impression_log_05 WRITE ORDERED BY logdate ASC
NULLS FIRST
""").show(false)
### Insert
spark.sql("""
INSERT overwrite table test.iceberg_impression_log_05
partition(dt='2024-06-10')
select
motype ,
third ,
logdate
FROM test.hive_impression_log
where dt = '2024-06-10'
""").show(false)
### Spark execution process
<img width="1678" alt="Image"
src="https://github.com/user-attachments/assets/7503f200-1a88-4fbb-945f-d8e06a446a8b"
/>
<img width="1674" alt="Image"
src="https://github.com/user-attachments/assets/4c4a021e-9c4c-4473-9474-ab4c63e7a071"
/>
### Question
1. After WRITE ORDERED BY is set in the Iceberg table, Spark will generate
an additional layer of Job tasks and no shuffle is generated, this will cause
the data to be read one more time and the scan time to double. Is this a bug?
### Willingness to contribute
- [x] I can contribute a fix for this bug independently
- [x] I would be willing to contribute a fix for this bug with guidance from
the Iceberg community
- [x] I cannot contribute a fix for this bug at this time
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]