Hi Team,
I have tried to assign a dynamic prefix for file name, which contains datetime components. The Problem is Job always takes initial datetime when job first starts and never refreshes later. How can I get dynamic current datetime in filename at sink time ? .withPartPrefix (ZonedDateTime.now.withZoneSameInstant(ZoneId.of("UTC")).format(DateTimeFormatter.ofPattern("yyyy-MM-dd-HH-mm-ss-SSS")))
|
Hi Vijayendra,
Use like this val outputFileConfig:OutputFileConfig = new DynamicOutputFileConfig() Regards, Ravi On Tue, Oct 13, 2020 at 6:05 AM Vijayendra Yadav <[hidden email]> wrote:
DynamicOutputFileConfig.scala (1K) Download Attachment |
Thanks Ravi. I got following Error: [ERROR] DynamicOutputFileConfig.scala:21: error: method getPartPrefix overrides nothing [ERROR] override def getPartPrefix: String = if(partPrefixFunction == null) partPrefix else partPrefixFunction.apply() [ERROR] ^ [ERROR] DynamicOutputFileConfig.scala:26: error: method getPartSuffix overrides nothing [ERROR] override def getPartSuffix: String = if(partSuffixFunction == null) partSuffix else partSuffixFunction.apply() On Tue, Oct 13, 2020 at 7:29 AM Ravi Bhushan Ratnakar <[hidden email]> wrote:
|
Hi Yadav, What Flink version are you using? `getPartPrefix` and `getPartSufix` methods were not public before 1.10.1/1.11.0, which might be causing this problem for you. Other than that, if you are already using Flink 1.10.1 (or newer), maybe please double check what class are you extending? The example provided by Ravi seems to be working for me. Piotrek wt., 13 paź 2020 o 19:02 Vijayendra Yadav <[hidden email]> napisał(a):
|
Hi Piotrek, That is correct I was still in 1.10, I am upgrading to 1.11. Regards, Vijay On Wed, Oct 14, 2020 at 6:12 AM Piotr Nowojski <[hidden email]> wrote:
|
Great! Please let us know if it solves the issue or not. Best, Piotrek śr., 14 paź 2020 o 17:46 Vijayendra Yadav <[hidden email]> napisał(a):
|
Free forum by Nabble | Edit this page |