Azure / Azure/Azure-DataFactory

ADF mapping data flow postgres error column is of type jsonb

Open
#623 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
529
Forks
623
PR merge metrics
No merged PRs in 30d

Description

**Azure Mapping dataflow**

**Describe the bug**

I tried to insert the null value into Jsonb column in PostgreSQL database table through mapping dataflow I got the error mentioned in my [SO thread](https://stackoverflow.com/questions/77333797/adf-mapping-data-flow-postgres-error-column-is-of-type-jsonb)

**To Reproduce**

When I tried to copy data from a Postgres SQL table with null values in the name column to another table using mapped data flow, I got the same error as shown below:

![enter image description here](https://i.imgur.com/5K9suJG.png)

This may be a bug in data flow. I have tried the following workaround:

I added a derived transformation to the source and modified the column with null values using the expression below:

iif(isNull(), '{"value": null}', )

![enter image description here](https://i.imgur.com/5aGF8l9.png)

Data preview of the derived column transformation:

![enter image description here](https://i.imgur.com/MPWZugX.png)

I added the following script as a post-copy script to the sink in the sink settings tab:

update set name = NULL where = '{
"value": null
}'

![enter image description here](https://i.imgur.com/1wjXw5p.png)

When I ran the data flow activity with the reference of the data flow below, the table data copied successfully as shown:

![enter image description here](https://i.imgur.com/NtiQXm7.png)

But when inserting null value into Jsonb type column in PostgreSQL database table with `insert into ` sql script it is working well.It might be a bug.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.