skip to Main Content

I am facing very simple problem of not able to change the datatype of additional column in copy activity in ADF pipeline from String to Datetime

Screenshot of copy activity

I am trying to change source datatype for additional column in mapping using JSON but still it doesn’t work with polybase cmd

enter image description here

When I run my pipeline it gives same error

enter image description here

Is it not possible to change datatype of additional column, by default it takes string only

3

Answers


  1. Dynamic columns return string.

    Try to put the value [Ex. utcnow()] in the dynamic content of query and cast it to the required target datatype.

    Otherwise you can use data-flow-derived-column :
    https://learn.microsoft.com/en-us/azure/data-factory/data-flow-derived-column

    Login or Signup to reply.
  2. Since your source is a query, you can choose to bring current date in source SQL query itself in the desired format rather than adding it in the additional column.

    Thanks

    Login or Signup to reply.
  3. Try to use formatDateTime as shown below and define the desired Date format:

    enter image description here

    Here since format given is ‘yyyy-dd-MM’, the result will look as below:

    enter image description here

    Note: The output here will be of string format only as in Copy activity we could not cast data type as of the date.
    We could either create current date in the Source sql query or use above way so that the data would load into the sink in expected format.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search