delta icon indicating copy to clipboard operation
delta copied to clipboard

[Feature Request][Kernel] Add assertions on types to prevent misuses

Open emkornfield opened this issue 5 months ago • 0 comments

Feature request

Which Delta project/connector is this regarding?

  • [ ] Spark
  • [ ] Standalone
  • [ ] Flink
  • [x] Kernel
  • [ ] Other (fill in here)

Overview

Today the DataType/StructField object model is fairly loose, which allows for bugs like https://github.com/delta-io/delta/issues/4535 to creep in. We should add some assertions to the model to help catch bugs like this earlier. Specific business rules proposed:

  1. StructField's in Map/Array should not contain FieldMetadata.
  2. StructField's in Map should always have the name "key" and "value"
  3. StructField in Array should always have the value "element".

Motivation

Reduce future bugs.

Further details

N/A

Willingness to contribute

The Delta Lake Community encourages new feature contributions. Would you or another member of your organization be willing to contribute an implementation of this feature?

  • [x] Yes. I can contribute this feature independently.
  • [ ] Yes. I would be willing to contribute this feature with guidance from the Delta Lake community.
  • [ ] No. I cannot contribute this feature at this time.

emkornfield avatar May 19 '25 17:05 emkornfield