1

I'm using wrangler component of cloud data fusion. I want to set new column with current date.

set-column :current_date new("java.time.LocalDateTime.now()");

Throws "The preview of the pipeline "test" has failed. Please check the logs for more information." error for me and many similar code doesn't work too. Logs show nothing code related, only messages like "Failed to add file to Spark environment" or "Aborting task". I'm sure that problem is in JEXL expression because without it or with simple expression like:

var a = 5+5; a

it works fine.

Is it possible to set column with current date?

Arty
  • 139
  • 9

1 Answers1

3

To add a column with current date, you can use the Add Field transform plugin. It is available from the Hub > Field Adder Transform. For the Field Value property, you can set it as:

${logicalStartTime(yyyy-MM-dd'T'HH-mm-ss)}

On what's possible with Wrangler, here is a cheat sheet blog post.

Edwin Elia
  • 399
  • 3
  • 5
  • I can't find Add Field transform plugin, can you tell me more specific where to find it please. Then I just make `set-column :current_date ${logicalStartTime(yyyy-MM-dd'T'HH-mm-ss)}` in wrangler directives it throw same error too and logs show "Caused by: java.lang.NullPointerException: null" – Arty Jun 02 '20 at 08:16
  • You can find Field Adder Transform from Hub. Click on Hub from the right corner of the navigation top bar. Then you can search for Field Adder Transform. – Edwin Elia Jun 02 '20 at 16:53