Use json column in Database for postgreSQL as sink

Javier Nieto 26 Reputation points
2021-11-08T08:59:54.527+00:00

When trying to use a derived json field to fill a json column in Azure Database for postgreSQL I'm getting the error below at validation, is there a way to feed a json column using Data factory activities or do I need to create a service or FaaS to do the job?

147198-image.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
Azure Database for PostgreSQL
{count} votes

Answer accepted by question author
  1. svijay-MSFT 5,256 Reputation points Microsoft Employee Moderator
    2021-11-15T15:17:09.997+00:00

    Hello @Javier Nieto ,

    I have further checked with my engineering team on your request and got the response which I have explained below .

    The complex datatype in Azure Data flow is of type - Object/Array?Map. PostgreSQL supports array - but not Object/Map. It can’t be supported directly.

    Having said that PostgreSQL, supports JSON columns.

    To that end, you could convert/transform this complex datatype(derived column) to a JSON String at the ADF end and write it as a JSON column PostgreSQL.

    **Note : ** This is slightly different from what I suggested earlier. In this scenario, you are writing the data as a string directly to JSON Column at the PostgreSQL.

    You could converted the complex datatype to a json a string using a toString function.

    149370-image.png

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    1 person found this answer helpful.
    0 comments No comments

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.