Azure / Azure/Azure-DataFactory

ADF mapping data flow postgres error column is of type jsonb

Aperta
#623 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
PowerShell
Stelle
529
Fork
623
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la riproduzione del Azure Mapping data flow descritta qui e confronta la gestione dei valori null da parte di JSONB di PostgreSQL con il report di Stack Overflow collegato. Il lavoro è completato quando un valore sorgente null viene copiato correttamente in una colonna JSONB di PostgreSQL senza il workaround derived-column e post-copy-script.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, postgresql
Ambito
cloud, databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.