AbsaOSS / AbsaOSS/fixed-width

Detect unrecognized data source options

Đang mở
#9 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Scala
Star
4
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Background
Options are passed to Spark data sources as key-value pairs. It is very easy to make a typo in an option name. If the data source has a default behaviour for this option (e.g. the option is not mandatory), the passed option will be unrecognized and therefore ignored.

It would be very useful if the data source would detect unrecognized options.

## Feature
1. Detect unrecognized options and log them as warnings.
2. Add `.option("pedantic", true)`, which, when enabled, will fail the Spark Application if there is at least one unrecognized option passed to the source.

## Additional context
As an inspiration for possible implementation, Cobrix uses a wrapper that takes incoming options. All configuration is read from that wrapper instead of the original configuration. The wrapper records which options are queried at least once. At any given point it allows getting the list of options that haven't been used.
An advantage of such implementation is that if there are dependencies between options, e.g. a particular option is only used if some other option is enabled, it is tracked automatically.

https://github.com/AbsaOSS/cobrix/blob/master/spark-cobol/src/main/scala/za/co/absa/cobrix/spark/cobol/parameters/Parameters.scala

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.