Why CDM inline dataset only get 2 digits fraction?

Achates Chen 21 Reputation points
2022-04-23T02:03:41.33+00:00

I am getting data by CDM inline dataset. I have some columns for cost which have fraction with decimals more that 2 digits. In infer drift column types setting, I tried decimal, float and double, but I always get 2 digits decimal only. How can I overcome this?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
7,139 questions
{count} votes

2 answers

Sort by: Most helpful
  1. MarkKromer-MSFT 5,156 Reputation points Microsoft Employee
    2022-04-24T21:49:40.303+00:00

    Rather than try to infer the type in the source, leave it as string and then cast it in a Derived Column using toDecimal()


  2. ShaikMaheer-MSFT 31,626 Reputation points Microsoft Employee
    2022-05-02T10:03:41.86+00:00

    Hi @Achates Chen , You can have plan to convert your data to string and then back to decimal. While converting decimal you use toDecimal() function to control how may fractional values to get after dot. Please check below screenshot for better idea.
    198117-image.png

    Please let us know how it goes. Thank you.