This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT changelog.product_id, | |
changelog.name, | |
changelog.price, | |
changelog._change_type, | |
changelog._commit_snapshot_id, | |
snapshots.committed_at | |
FROM "apache_iceberg_showcase"."products_changelog" AS changelog | |
INNER JOIN "apache_iceberg_showcase"."products$snapshots" as snapshots | |
ON changelog._commit_snapshot_id = snapshots.snapshot_id | |
WHERE "name" = 'Product A' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from awsglue.transforms import * | |
from awsglue.utils import getResolvedOptions | |
from pyspark.context import SparkContext | |
from awsglue.context import GlueContext | |
from awsglue.job import Job | |
# Initialize Spark and Glue context | |
sc = SparkContext() | |
glueContext = GlueContext(sc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM "apache_iceberg_showcase"."products" | |
FOR TIMESTAMP AS OF TIMESTAMP '2023-06-14 13:51:00 UTC' | |
WHERE name = 'Product A'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM "apache_iceberg_showcase"."products" | |
FOR TIMESTAMP AS OF TIMESTAMP '2023-06-14 13:49:00 UTC' | |
WHERE name = 'Product A'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM "apache_iceberg_showcase"."products$history"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"product_id": "29e17633-8d1e-4d63-8291-7a34fd79a4e5", | |
"name": "Product A", | |
"category": "Electronics", | |
"variants": [ | |
{ | |
"color": "black", | |
"size": "M", | |
"stock": 100 | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curated-zone/ | |
└── products/ | |
├── data/ | |
│ └── 00000-(...)-00001.parquet | |
└── metadata/ | |
├── 00000-(...)-7c99bf9d1216.metadata.json | |
├── 5b9bf671-(...)-06c3dd2fe777.avro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import boto3 | |
from pyspark.sql.functions import concat_ws, lpad | |
from awsglue.transforms import * | |
from awsglue.utils import getResolvedOptions | |
from pyspark.context import SparkContext | |
from awsglue.context import GlueContext | |
from awsglue.job import Job | |
# Initialize Spark and Glue context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raw-zone/ | |
└── products/ | |
└── year=2023/ | |
└── month=05/ | |
├── day=01/ | |
| └── data.json | |
├── day=02/ | |
| └── data.json | |
└── (...) | |
└── (...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"product_id": "29e17633-8d1e-4d63-8291-7a34fd79a4e5", | |
"name": "Product A", | |
"category": "Electronics", | |
"variants": [ | |
{ | |
"color": "black", | |
"size": "M", | |
"stock": 100 | |
}, |
NewerOlder