Grouping of partitioned dataframes

0

I have a large dataset (table) with >1e9 records (rows) in Glue. The tables are partitioned by column A, which is a n-letters subtring of column B. For example:

A (partition key)B...
abcabc123......
abcabc123......
abcabc456......
abcabc456......
abcabc456......
abcabc789......
abcabc789......
.........
xyzxyz123......
xyzxyz123......
xyzxyz123......
xyzxyz456......
xyzxyz456......
xyzxyz456......
xyzxyz789......
xyzxyz789......

There are >1e6 possible different values of column B and correspondingly significantly less for column A (maybe 1e3). Now I need to group records/rows by column B and the assumption is that it could be advantageous if the table was partitioned by column A, as it would be sufficient to load dataframes from single partitions for grouping instead of running the operation on the entire table. (Partitioning by column B would lead to unreasonably large numbers partitions.) Is my assumption right? How would I tell my Glue job the link between column A and B and profit from the partitioning?

Alternatively I could handle the 1e3 dataframes (one for each partition) separately in my Glue job and merge them lateron. But this looks a bit complicated to me.

This question is a follow-up question to https://repost.aws/questions/QUwxdl4EwTQcKBuL8MKCU0EQ/are-partitions-advantageous-for-groupby-operations-in-glue-jobs.

1개 답변
0

Hello,

Partitioning by column A could be advantageous in your use case and then groupBy column B in order to limit the number of partitions. You can create a dynamic frame and refer to partitions in it with predicate pushdown. Do you want to create multiple dynamic frames for multiple partitions and then combine them using join operator ? If you have any sample code you are using on a sample dataset, please share it with us on a support case and we can assist you by getting on a screen-share.

AWS
지원 엔지니어
답변함 2년 전

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

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

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

관련 콘텐츠