AbsaOSS / AbsaOSS/pramen

Add an ability to format info date and insert date expression into JDBC SQL queries

Đang mở
#360 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
DS enhancement Pramen-Scala
Ngôn ngữ chính
Scala
Star
31
Fork
4
Merge trung bình
1 ngày 10 phút
Pull request đã merge (30 ngày)
4

Mô tả

## Background
Users want to customize SQL queries with information date based dates as part of an expression, including table names.
For example:
```
SELECT * FROM my_table_202402
```
where `202402` is `yyyyMM` part of the information date.

## Feature
Add an ability to format info date and insert date expression into JDBC SQL queries .

## Example
```hocon
input.sql = "SELECT * FROM my_table_${formatDate(beginOfMonth(@infoDate), 'yyyyMM)'}"
```

## Proposed Solution
1. Introduce `formatDate()` that can be used like this: `formatDate(@infoDate, 'yyyyMM)'` => `202402`
2. Allow date expressions in SQL queries, for example using `${}` escaping (see the example above).

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.