From 7081f0a707d6bf9a7982c3d57fdbf7222130d09b Mon Sep 17 00:00:00 2001 From: "Anton Bryzgalov @ CoinStats" Date: Fri, 1 Jul 2022 15:44:50 +0400 Subject: [PATCH] schemas/aws/parquet: updated to reflect BigQuery schema Sponsored by CoinStats.app --- schemas/aws/parquet/parquet_blocks.sql | 7 +++---- .../aws/parquet/parquet_token_transfers.sql | 8 ++++---- schemas/aws/parquet/parquet_transactions.sql | 19 +++++++++++++------ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/schemas/aws/parquet/parquet_blocks.sql b/schemas/aws/parquet/parquet_blocks.sql index 755cf882a..ec6af11c1 100644 --- a/schemas/aws/parquet/parquet_blocks.sql +++ b/schemas/aws/parquet/parquet_blocks.sql @@ -1,4 +1,5 @@ CREATE EXTERNAL TABLE IF NOT EXISTS parquet_blocks ( + timestamp TIMESTAMP, number BIGINT, hash STRING, parent_hash STRING, @@ -15,11 +16,9 @@ CREATE EXTERNAL TABLE IF NOT EXISTS parquet_blocks ( extra_data STRING, gas_limit BIGINT, gas_used BIGINT, - timestamp BIGINT, - transaction_count BIGINT + transaction_count BIGINT, + base_fee_per_gas BIGINT ) PARTITIONED BY (start_block BIGINT, end_block BIGINT) STORED AS PARQUET LOCATION 's3:///ethereumetl/parquet/blocks'; - -MSCK REPAIR TABLE parquet_blocks; \ No newline at end of file diff --git a/schemas/aws/parquet/parquet_token_transfers.sql b/schemas/aws/parquet/parquet_token_transfers.sql index 02d709c18..cdbce8c30 100644 --- a/schemas/aws/parquet/parquet_token_transfers.sql +++ b/schemas/aws/parquet/parquet_token_transfers.sql @@ -2,13 +2,13 @@ CREATE EXTERNAL TABLE IF NOT EXISTS parquet_token_transfers ( token_address STRING, from_address STRING, to_address STRING, - value DECIMAL(38,0), + value STRING, transaction_hash STRING, log_index BIGINT, - block_number BIGINT + block_timestamp TIMESTAMP, + block_number BIGINT, + block_hash STRING ) PARTITIONED BY (start_block BIGINT, end_block BIGINT) STORED AS PARQUET LOCATION 's3:///ethereumetl/parquet/token_transfers'; - -MSCK REPAIR TABLE parquet_token_transfers; \ No newline at end of file diff --git a/schemas/aws/parquet/parquet_transactions.sql b/schemas/aws/parquet/parquet_transactions.sql index e1b43511b..4637bb695 100644 --- a/schemas/aws/parquet/parquet_transactions.sql +++ b/schemas/aws/parquet/parquet_transactions.sql @@ -1,18 +1,25 @@ CREATE EXTERNAL TABLE IF NOT EXISTS parquet_transactions ( hash STRING, nonce BIGINT, - block_hash STRING, - block_number BIGINT, transaction_index BIGINT, from_address STRING, to_address STRING, value DECIMAL(38,0), gas BIGINT, gas_price BIGINT, - input STRING + input STRING, + receipt_cumulative_gas_used BIGINT, + receipt_gas_used BIGINT, + receipt_contract_address STRING, + receipt_root STRING, + receipt_status BIGINT, + block_timestamp TIMESTAMP, + block_number INTEGER, + block_hash STRING, + max_fee_per_gas BIGINT, + max_priority_fee_per_gas BIGINT, + transaction_type BIGINT, + receipt_effective_gas_price BIGINT ) -PARTITIONED BY (start_block BIGINT, end_block BIGINT) STORED AS PARQUET LOCATION 's3:///ethereumetl/parquet/transactions'; - -MSCK REPAIR TABLE parquet_transactions; \ No newline at end of file