Facing issue while using rest post api using a data flow in azure data factory

Pratisti Satardekar 130 Reputation points
2023-09-29T08:18:52.85+00:00

Hi,
I have created a Rest link service and wanted to create a dataflow using it.
As its a Post method i have added the request body too.
Imported the schema also.

But on preview im getting this error :-
Spark job failed: { "text/plain": "{"runId":"98e23c11-99b8-4a4a-9b1e-d89f628fa38d","sessionId":"30208535-f3d2-45f9-99ee-4f429d2f9ced","status":"Failed","payload":{"statusCode":400,"shortMessage":"DF-SRC_025 at Source 'Product'(Line 1/Col 0): Integral type has be one of integer, short or long\nDF-SRC_026 at Source 'Product'(Line 1/Col 0): Fractional type has be one of double, float or decimal","detailedMessage":"Failure 2023-09-29 08:01:54.669 failed DebugManager.processJob, run=98e23c11-99b8-4a4a-9b1e-d89f628fa38d, errorMessage=DF-SRC_025 at Source 'Product'(Line 1/Col 0): Integral type has be one of integer, short or long\nDF-SRC_026 at Source 'Product'(Line 1/Col 0): Fractional type has be one of double, float or decimal"}}\n" } - RunId: 98e23c11-99b8-4a4a-9b1e-d89f628fa38d

I'm not able to figure out a solution for the above error.
Can you please guide on resolving the issue?

the following is the setup done.
User's image

User's image

User's image

Not sure why body and headers are added here. inside the body is the actual data.
User's image

User's image

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Anonymous
    2023-09-30T09:18:57.6033333+00:00

    @Pratisti Satardekar

    Thanks for Approaching MicrosoftQ&A

    The error message suggests that there is an issue with the schema of the source data. Specifically, the error message states that "Integral type has to be one of integer, short or long" and "Fractional type has to be one of double, float or decimal". This indicates that the schema of the source data may not be compatible with the schema of the target data.To resolve this issue, you may need to modify the schema of the source data to match the schema of the target data. You can do this by using a Select transformation in the Data Flow to select only the columns that are needed and to cast the data types to the appropriate types. For example, if the source data has an integer column that needs to be cast to a long, you can use the following expression in the Select transformation:

     

    toLong(MyIntegerColumn)
    

     

    Similarly, if the source data has a decimal column that needs to be cast to a double, you can use the following expression:

     

    toDouble(MyDecimalColumn)
    

     

    Once you have modified the schema of the source data, you can preview the data again to ensure that there are no more errors. If there are still errors, you may need to further modify the schema or investigate other potential issues with the data. It is also worth noting that the error message mentions that the issue is with the source 'Product' (Line 1/Col 0). This suggests that the issue may be with the first row of data in the source. You may want to investigate this row specifically to see if there are any issues with the data in this row that are causing the error.

    if issue persists please let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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