[AWS Glue] Insert-Update to Postgre Table

0

Hi folks!

I want to ask can we do insert-update in AWS Glue Visual ETL Job? I want to use Postgre as DB target and will do insert-update.

Prefers use Visual ETL Job...

Ivan
질문됨 4달 전372회 조회
1개 답변
0

Not out of the box at this time, the way to do it is a custom code node that writes into a Postgres temporary table and then issue a SQL command to do the upsert/merge into the final table (using JDBC, the psycopg2 library or similar).

profile pictureAWS
전문가
답변함 4달 전
  • can we use 'Custom Transform' to make it? or do i have use in seperate to do it?

  • Yes you can, despite the name "transform" you can put any code, including writing

  • sorry sir, i'm new at here. I think I get your idea, but I want to confirm a few things. This means that after I perform transformations on my data, I have to create a script to perform an upsert query into my table. My next question is whether I can set the connection/target table directly from the script? this is a simple flow image that I have created, and I want to make sure that we line up this 'custom transform' can be used for the script code requirements above.

    https://ibb.co/C64kp2q

  • Your custom transform node has to be part of the graph, it should be the last node and you do the writing/updating there. That's it

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠