Skip to content

Commit 0abf77c

Browse files
chore: scripts to created goldky tables
1 parent 8333953 commit 0abf77c

7 files changed

+187
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
CREATE OR REPLACE EXTERNAL TABLE
2+
`mezo-portal-data.raw_goldsky.raw_goldsky_borrower_operations_mezo__trove_updated` (
3+
-- The block number in which this event occurred.
4+
`block` INTEGER,
5+
-- The block number as a high-precision numeric value.
6+
`block_number` BIGNUMERIC,
7+
-- The timestamp of the block as a Unix timestamp.
8+
`timestamp` BIGNUMERIC,
9+
-- The hash of the transaction that emitted this event.
10+
`transaction_hash` STRING,
11+
-- The address of the contract that emitted the event.
12+
`contract_id` STRING,
13+
-- The address of the borrower.
14+
`borrower` STRING,
15+
-- The principal debt amount.
16+
`principal` BIGNUMERIC,
17+
-- The interest amount.
18+
`interest` BIGNUMERIC,
19+
-- The collateral amount.
20+
`coll` BIGNUMERIC,
21+
-- The stake amount.
22+
`stake` BIGNUMERIC,
23+
-- The interest rate for the trove.
24+
`interest_rate` BIGNUMERIC,
25+
-- The timestamp of the last interest update.
26+
`last_interest_update_time` BIGNUMERIC,
27+
-- The type of operation performed.
28+
`operation` STRING,
29+
-- The chain where the event originated, e.g., 'mezo'.
30+
`_gs_chain` STRING,
31+
-- The unique identifier from Goldsky for the event.
32+
`_gs_gid` STRING
33+
)
34+
WITH PARTITION COLUMNS (
35+
-- The table is partitioned by the date of the event.
36+
`event_date` DATE
37+
)
38+
OPTIONS (
39+
format = 'PARQUET',
40+
-- The prefix for the hive-style partitions in Google Cloud Storage.
41+
hive_partition_uri_prefix = 'gs://mezo-prod-dp-dwh-lnd-goldsky-cs-0/borrower_operations_mezo/event_type=trove_updated',
42+
-- The URIs pointing to the Parquet files in Google Cloud Storage.
43+
uris = ["gs://mezo-prod-dp-dwh-lnd-goldsky-cs-0/borrower_operations_mezo/event_type=trove_updated/*"]
44+
);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
CREATE OR REPLACE EXTERNAL TABLE
2+
`mezo-portal-data.raw_goldsky.raw_goldsky_market_mezo__donated` (
3+
-- The block number in which this event occurred.
4+
`block` INTEGER,
5+
-- The block number as a high-precision numeric value.
6+
`block_number` BIGNUMERIC,
7+
-- The timestamp of the block as a Unix timestamp.
8+
`timestamp` BIGNUMERIC,
9+
-- The hash of the transaction that emitted this event.
10+
`transaction_hash` STRING,
11+
-- The address of the contract that emitted the event.
12+
`contract_id` STRING,
13+
-- The address of the donor.
14+
`donor` STRING,
15+
-- The ID of the beneficiary.
16+
`beneficiary_id` STRING,
17+
-- The address of the recipient.
18+
`recipient` STRING,
19+
-- The amount that was donated.
20+
`amount` BIGNUMERIC,
21+
-- The chain where the event originated, e.g., 'mezo'.
22+
`_gs_chain` STRING,
23+
-- The unique identifier from Goldsky for the event.
24+
`_gs_gid` STRING
25+
)
26+
WITH PARTITION COLUMNS (
27+
-- The table is partitioned by the date of the event.
28+
`event_date` DATE
29+
)
30+
OPTIONS (
31+
format = 'PARQUET',
32+
-- The prefix for the hive-style partitions in Google Cloud Storage.
33+
hive_partition_uri_prefix = 'gs://mezo-prod-dp-dwh-lnd-goldsky-cs-0/market_mezo/event_type=donated',
34+
-- The URIs pointing to the Parquet files in Google Cloud Storage.
35+
uris = ["gs://mezo-prod-dp-dwh-lnd-goldsky-cs-0/market_mezo/event_type=donated/*"]
36+
);
37+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
CREATE OR REPLACE EXTERNAL TABLE
2+
`mezo-portal-data.raw_goldsky.raw_goldsky_market_mezo__order_placedmezo-portal-data.raw_goldsky.raw_goldsky_market_mezo__order_placed` (
3+
-- The block number in which this event occurred.
4+
`block` INTEGER,
5+
-- The block number as a high-precision numeric value.
6+
`block_number` BIGNUMERIC,
7+
-- The timestamp of the block as a Unix timestamp.
8+
`timestamp` BIGNUMERIC,
9+
-- The hash of the transaction that emitted this event.
10+
`transaction_hash` STRING,
11+
-- The address of the contract that emitted the event.
12+
`contract_id` STRING,
13+
-- The unique identifier for the order.
14+
`order_id` STRING,
15+
-- The address of the customer who placed the order.
16+
`customer` STRING,
17+
-- The identifier for the product that was ordered.
18+
`product_id` STRING,
19+
-- The price of the order.
20+
`price` BIGNUMERIC,
21+
-- The chain where the event originated, e.g., 'mezo'.
22+
`_gs_chain` STRING,
23+
-- The unique identifier from Goldsky for the event.
24+
`_gs_gid` STRING
25+
)
26+
WITH PARTITION COLUMNS (
27+
-- The table is partitioned by the date of the event.
28+
`event_date` DATE
29+
)
30+
OPTIONS (
31+
format = 'PARQUET',
32+
-- The prefix for the hive-style partitions in Google Cloud Storage.
33+
hive_partition_uri_prefix = 'gs://mezo-prod-dp-dwh-lnd-goldsky-cs-0/market_mezo/event_type=order_placed',
34+
-- The URIs pointing to the Parquet files in Google Cloud Storage.
35+
uris = ["gs://mezo-prod-dp-dwh-lnd-goldsky-cs-0/market_mezo/event_type=order_placed/*"]
36+
);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
CREATE OR REPLACE EXTERNAL TABLE
2+
`mezo-portal-data.raw_goldsky.raw_goldsky_mezo_bridge_mainnet__assets_locked` (
3+
-- The block number in which this event occurred.
4+
`block` INTEGER,
5+
-- The block number as a high-precision numeric value.
6+
`block_number` BIGNUMERIC,
7+
-- The timestamp of the block as a Unix timestamp.
8+
`timestamp` BIGNUMERIC,
9+
-- The hash of the transaction that emitted this event.
10+
`transaction_hash` STRING,
11+
-- The address of the contract that emitted the event.
12+
`contract_id` STRING,
13+
-- The sequence number for the lock event.
14+
`sequence_number` BIGNUMERIC,
15+
-- The address of the asset recipient.
16+
`recipient` STRING,
17+
-- The address of the token contract.
18+
`token` STRING,
19+
-- The amount of tokens locked.
20+
`amount` BIGNUMERIC,
21+
-- The chain where the event originated, e.g., 'mainnet'.
22+
`_gs_chain` STRING,
23+
-- The unique identifier from Goldsky for the event.
24+
`_gs_gid` STRING
25+
)
26+
WITH PARTITION COLUMNS (
27+
-- The table is partitioned by the date of the event.
28+
`event_date` DATE
29+
)
30+
OPTIONS (
31+
format = 'PARQUET',
32+
-- The prefix for the hive-style partitions in Google Cloud Storage.
33+
hive_partition_uri_prefix = 'gs://mezo-prod-dp-dwh-lnd-goldsky-cs-0/mezo_bridge_mainnet/event_type=assets_locked',
34+
-- The URIs pointing to the Parquet files in Google Cloud Storage.
35+
uris = ["gs://mezo-prod-dp-dwh-lnd-goldsky-cs-0/mezo_bridge_mainnet/event_type=assets_locked/*"]
36+
);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
CREATE OR REPLACE EXTERNAL TABLE
2+
`mezo-portal-data.raw_goldsky.raw_goldsky_mezo_vaults_mezo__transfer` (
3+
-- The block number in which this event occurred.
4+
`block` INTEGER,
5+
-- The block number as a high-precision numeric value.
6+
`block_number` BIGNUMERIC,
7+
-- The timestamp of the block as a Unix timestamp.
8+
`timestamp` BIGNUMERIC,
9+
-- The hash of the transaction that emitted this event.
10+
`transaction_hash` STRING,
11+
-- The address of the contract that emitted the event.
12+
`contract_id` STRING,
13+
-- The address of the sender.
14+
`from` STRING,
15+
-- The address of the recipient.
16+
`to` STRING,
17+
-- The amount that was transferred.
18+
`value` BIGNUMERIC,
19+
-- The chain where the event originated, e.g., 'mezo'.
20+
`_gs_chain` STRING,
21+
-- The unique identifier from Goldsky for the event.
22+
`_gs_gid` STRING
23+
)
24+
WITH PARTITION COLUMNS (
25+
-- The table is partitioned by the date of the event.
26+
`event_date` DATE
27+
)
28+
OPTIONS (
29+
format = 'PARQUET',
30+
-- The prefix for the hive-style partitions in Google Cloud Storage.
31+
hive_partition_uri_prefix = 'gs://mezo-prod-dp-dwh-lnd-goldsky-cs-0/mezo_vaults_mezo/event_type=transfer',
32+
-- The URIs pointing to the Parquet files in Google Cloud Storage.
33+
uris = ["gs://mezo-prod-dp-dwh-lnd-goldsky-cs-0/mezo_vaults_mezo/event_type=transfer/*"]
34+
);
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)