AbsaOSS / AbsaOSS/enceladus

Support output column on a different level

Đang mở
#1,279 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Conformance feature priority: medium
Ngôn ngữ chính
Scala
Star
33
Fork
16
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Background
Currently, conformance rules require that output columns be at the same level as input columns (e.g. casting rule). This seems like a too strict limitation.

## Feature
Output columns can be at different struct levels as long as the array boundary is not crossed.

## Example [Optional]
Here is an example schema:
```
root
|-- id: long (nullable = true)
|-- key1: long (nullable = true)
|-- key2: long (nullable = true)
|-- struct1: struct (nullable = true)
| |-- key3: integer (nullable = true)
| |-- key4: integer (nullable = true)
|-- array1: array (nullable = true)
| |-- element: struct
| | |-- key7: long (nullable = true)
| | |-- key8: long (nullable = true)
| | |-- skey2: string (nullable = true)
```

- Currently you *can't* use the casting tole to convert `struct.key3` from to `string` and save it to `key3_String`. The output column should be at the same level, e.g. `struct1.key3_String`. This should be *allowed*.
- Converting `array1.key7` to `string` and saving it to `key7_String` should be *disallowed* since it crosses the array boundary. The conversion can only be allowed if the output column is also inside the array, e.g. `array1.key7_String`.

## Proposed Solution [Optional]
`spark-hats` allows a unified way of accessing columns from arbitrary levels of nesting as long as array boundaries are not crossed. We can utilize that in conformance rules. This is similar to how it is done for the broadcasting mapping rule strategy.

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

Mở hướng dẫn đóng góp

Đá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.