AbsaOSS / AbsaOSS/enceladus

define variables in oozie templates with starting and ending char

Aperta
#1,033 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Menas priority: medium refactoring
Lingua principale
Scala
Stelle
33
Fork
16
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Background
Currently, oozie variables for the template are just left bound but not right bound, eg. `$Variable` which then allows matching this even to `$Variable2`. If we make these left and right bound we lose this problem, eg. `${Variable}`

## Feature
Change oozie template variables from `$variable` to `${variable}`

## Proposed Solution [Optional]
1. Replace the strings in template
2. Use a simple function to which we provide a map of keys/values
```scala
def richFormat(string: String, replacement: Map[String, String]): String =
replacement.foldLeft(string)((res, entry) => res.replaceAll(s"\\{${entry._1}\\}", entry._2))
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.