Reputation: 21
I need to port recipes from dataprep recipe into data fusion pipeline wrangler.
derive type: single value: LEFT(column3, 3) as: 'column3'
When I enter custom transform it gives me an error:
io.cdap.wrangler.expression.EL.compile@1:6 unsolvable function/method 'LEFT'
Upvotes: 1
Views: 991
Reputation: 806
The equivalent to LEFT() in Cloud Data Fusion and CDAP is the following Directives called "cut-character".
Here is the syntax:
cut-character <source> <destination> <type> <range|indexes>
Here is a sample snippet that takes the first three characters from the SKU column values and transposes it to a new column named NewSKu:
cut-character SKU NewSku 1-3
This also can be achieved through the UI, by selecting Extract fields - using positions
Reference docs: https://docs.cask.co/cdap/current/en/user-guide/data-preparation/directives/cut-character.html
Upvotes: 4