AbsaOSS / AbsaOSS/pramen

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

未关闭
#360 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
DS enhancement Pramen-Scala
主要语言
Scala
星标
31
派生
4
平均合并
1 天 10 分钟
30 天内合并 PR
4

描述

## 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).

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。