Get inserted rows IDs in aws glue to use in child table

0

Hello. I have an aws glue that inserts data into a postgres table. Is it possible to have this same job fetch the db-generated IDs of the inserted rows and use them to insert data into a child table that has an FK to the first table's rows? or this has to be done ina different table?

質問済み 9ヶ月前222ビュー
1回答
0
承認された回答

You can but you would need a separate read and a join.
So you would insert into the table, then read the table with t he generated ids, then join with the child data and finally insert into the child table using the generated ids.

profile pictureAWS
エキスパート
回答済み 9ヶ月前
  • Thanks. I'm ok with having a separate read. But it doesn't seem the aws glue visual editor allows me to add child nodes to the data target "postgres" node in which I'm doing the first insertion. How would I achieve this?

  • Yes, that's a visual job limitation, you would need to either have two visual jobs in workflow or use a custom code node to write and read again (you could copy the code generated from the original sink/source)

  • Good advice. Thanks a lot

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ