Copy activity convert NUMBER to DOUBLE format

Zhu, Yueli YZ [NC] 280 Reputation points
2025-06-09T19:59:31.38+00:00

Hi

we use the ADF copy activity to copy data from an oracle source to azure gen2 container as parquet file. The source data contain data type NUMBER, but the copy activity converts it to DOUBLE format. Could you please provide a solution for this one?

Thanks,

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

1 answer

Sort by: Most helpful
  1. Chandra Boorla 14,585 Reputation points Microsoft External Staff Moderator
    2025-06-09T20:36:33.1666667+00:00

    @Zhu, Yueli YZ [NC]

    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.

    User's image

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.