[BUG] Fix DeltaTableBuilder metadata configuration
See original GitHub issueBug
Describe the problem
Currently, when DeltaTableBuilder
is given a property that does not start with a delta.
prefix, then that property is written to the table metadata in all lowercase.
Steps to reproduce
io.delta.tables.DeltaTable.create()
.addColumn("bar", StringType)
.property("dataSkippingNumIndexedCols", "33")
.tableName("my_table")
.execute()
Observed results
This will incorrectly write dataskippingnumindexedcols
to the delta log metadata.
Expected results
We want to preserve the case of table properties. dataSkippingNumIndexedCols
should be written to the metadata.
Implementation Requirement
In addition to fixing the above issue, we also need to be backwards compatible and be able to read older tables with these invalid properties.
As well, you need to include a flag that can be enabled to roll back to this previous behaviour.
After you fix this issue, please update the test and test output table here: https://github.com/delta-io/delta/blob/master/core/src/test/scala/org/apache/spark/sql/delta/DeltaWriteConfigsSuite.scala#L316
Also, please add tests with the feature flag enabled/disabled, as well as by reading an “older” table with these invalid delta properties (this should go into EvolvabilitySuite).
Issue Analytics
- State:
- Created a year ago
- Comments:7 (6 by maintainers)
As this API is for setting table properties rather than options, we should allow arbitrary table properties. What we should fix is making it preserve the case.
@edmondo1984 done. Thanks for offering the help!