Comments (6)
cc. @lzlfred @harperjiang
from delta.
@vkorukanti @lzlfred @harperjiang Could you let me know whether this is incorrect documentation or implementation bug?
from delta.
@ebyhr the document said that
If the table is on Writer Version 5 or 6: write a metaData action to add the delta.columnMapping.mode table property;
If the table is on Writer Version 7:
write a protocol action to add the feature columnMapping to both readerFeatures and writerFeatures
I believe the behavior you observed is just as described in the doc when we have writer version 5/6, and thus don't consider it a bug.
from delta.
The writer version is 7 and it mentions "add the feature columnMapping to both readerFeatures and writerFeatures".
{"protocol":{"minReaderVersion":2,"minWriterVersion":7,"writerFeatures":["columnMapping","icebergCompatV1"]}}
Then, I would recommend updating the protocol. I expect readerFeatures always have columnMapping
when it exists in writerFeatures from the current sentence.
from delta.
The writer version is 7 and it mentions "add the feature columnMapping to both readerFeatures and writerFeatures".
{"protocol":{"minReaderVersion":2,"minWriterVersion":7,"writerFeatures":["columnMapping","icebergCompatV1"]}}
Then, I would recommend updating the protocol. I expect readerFeatures always have
columnMapping
when it exists in writerFeatures from the current sentence.
I think we need to update the protocol to make that paragraph clearer.
When reader version is 2 the readerFeatures doesn't exist, and if it does, it would break the protocol:
For new tables, when a new table is created with a Reader Version up to 2 and Writer Version 7, its protocol action must only contain writerFeatures.
from delta.
Actually, after running some experiment I realized Spark Delta doesn't allow you to enable column mapping if reader is version 2 and writer is version 7.
But it allows you to create it, so it is inconsistent, I can't say what is the correct behavior, my guess is supporting reader 2 + writer 7 (with columnMapping writerFeatures)
should be the considered compliant with spec.
ALTER TABLE Test SET TBLPROPERTIES (
'delta.minReaderVersion' = '2',
'delta.minWriterVersion' = '7'
);
This fails:
ALTER TABLE Test SET TBLPROPERTIES (
'delta.columnMapping.mode' = 'name'
)
Your current table protocol version does not support changing column mapping modes
using delta.columnMapping.mode.
Required Delta protocol version for column mapping:
Protocol(3,7,[columnMapping],[columnMapping])
Your table's current Delta protocol version:
Protocol(2,7,None,[appendOnly,invariants])
Please enable Column Mapping on your Delta table with mapping mode 'name'.
You can use one of the following commands.
If your table is already on the required protocol version:
ALTER TABLE table_name SET TBLPROPERTIES ('delta.columnMapping.mode' = 'name')
If your table is not on the required protocol version and requires a protocol upgrade:
ALTER TABLE table_name SET TBLPROPERTIES (
'delta.columnMapping.mode' = 'name',
'delta.minReaderVersion' = '3',
'delta.minWriterVersion' = '7')
This works:
CREATE TABLE Test (Id INT) USING DELTA TBLPROPERTIES ('delta.minWriterVersion' = '7', 'delta.columnMapping.mode' = 'name');
from delta.
Related Issues (20)
- [BUG][Spark] Reliability issues when upserting data to ADLS using Delta in Synapse Analytics
- [PROTOCOL] Per-file statistics documentation in protocol is ambiguous HOT 2
- [BUG] Can not instantiate `LogStore` class: io.delta.storage.HDFSLogStore HOT 1
- [BUG] Failed to create delta table when catalog name is not spark_catalog HOT 1
- [QUESTION] How to add compression codes for a delta table?
- [BUG][Spark] DELTA_TRUNCATED_TRANSACTION_LOG issue while working with Databricks HOT 1
- [Feature Request] Does the kernel lib support iceberg uniform feature?
- [BUG][Spark] A merge executed with a generated column requires the source to have the generated column HOT 1
- [Kernel][Feature Request] Improvement of ICT Read
- [BUG][Spark] Unable to run Spark Connect 3.5.1 with Delta 3.2.0 HOT 2
- [BUG][Spark] issue when merge using autoMerge property HOT 2
- [BUG][SPARK] Errors with icebergShaded while setting up Delta on local machine HOT 1
- [Feature Request][Delta][Spark] SQL syntax for PRIMARY KEY constraint in OSS (informational purpose only)
- [QUESTION] How do I read Databricks Catalog tables (delta) with delta kernel?
- [Feature Request] Dynamic spark.databricks.delta.snapshotPartitions based on size of snapshot HOT 3
- [BUG][SPARK] Compile performed for files that have been changed being discarded HOT 1
- [BUG] delta-iceberg JAR does not shade caffeine dependencies
- [doc] NOT NULL in ALTER TABLE ADD COLUMNS is not mentioned in the doc HOT 3
- [BUG] HOT 2
- [BUG]write_delta({'custom_metadata':str}) cannot be converted. str to pyDict error (0.18.2_DeltaPython/Windows10)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delta.