1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
In order to extract this information you need to look into system tables. You can call Redshift Data API to run a query against system tables from boto3.
Create a query to extract time & query text from STL_QUERY + STL_QUERYTEXT (Provisioned) or SYS_QUERY_HISTORY (Serverless).
Your query would look like SELECT * FROM ... WHERE text LIKE '%INSERT%' AND text LIKE '%mytable%'
.
Note that in the example above, mytable may not be the target of INSERT so you need to check the extracted query text manually. If you need full automation, parse the query text in Python using SQL parser library like below. https://github.com/macbre/sql-metadata
답변함 일 년 전
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 3년 전