AbsaOSS / AbsaOSS/pramen

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

Offen
#360 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
DS enhancement Pramen-Scala
Vorherrschende Sprache
Scala
Sterne
31
Forks
4
Ø Merge
1 T. 10 Min.
Gemergte PRs (30 T.)
4

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.