I see you're encountering an issue where the Azure Data Factory Copy Activity is converting Oracle NUMBER
data types into DOUBLE
when writing to Parquet files in Azure Data Lake Gen2.
By default, Azure Data Factory maps Oracle's NUMBER
data type to DOUBLE
when writing to Parquet format. This is because NUMBER
in Oracle is a flexible type and ADF chooses the closest general-purpose match, which is DOUBLE
. However, this can result in precision loss, especially for financial or high-precision numeric data.
For details, please refer: Data type mapping for Oracle
To preserve the exact precision and scale, here are a few suggestions to address this:
Explicit casting in source query
To avoid unwanted conversions, you can modify your source query to explicitly cast the NUMBER
column to a more appropriate data type:
SELECT CAST(ColA AS NUMBER(18,2)) AS ColA FROM TableA
Alternatively, for scientific or floating-point values:
SELECT CAST(ColA AS BINARY_DOUBLE) AS ColA FROM TableA
Note - Choose precision (p
) and scale (s
) based on your data range. For example, NUMBER(18,2)
supports up to 16 digits before the decimal and 2 digits after.
Review Data Type Mappings
Review the Oracle-to-Parquet data type mappings in ADF. A NUMBER
without precision/scale may default to DOUBLE
. Specifying precision/scale in your query helps ADF preserve the correct format in the Parquet sink.
Validate Output
After applying the cast, test your query output in ADF and check the resulting Parquet file to ensure values are stored correctly without loss of precision.
I hope this information helps. Please do let us know if you have any further queries.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.
Thank you.