Is it possible to create a binary matrix in AWS Athena from a table. For example we have the following table:
name | product |
---|---|
John | Bike |
John | Shirt |
John | Ball |
Blake | Shirt |
Mike | Ball |
Mike | Hat |
To be converted to the following:
name | Bike | Shirt | Ball | Hat |
---|---|---|---|---|
John | 1 | 1 | 1 | 0 |
Blake | 0 | 1 | 0 | 0 |
Mike | 0 | 0 | 1 | 1 |