Skip to content

Commit

Permalink
remove null constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
rtso committed Jan 10, 2025
1 parent 66cbed1 commit 4317a23
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 21 deletions.
6 changes: 3 additions & 3 deletions rust/integration-tests/src/models/user_transactions_models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct UserTransaction {
pub entry_function_id_str: String,
pub inserted_at: chrono::NaiveDateTime,
pub epoch: i64,
pub entry_function_contract_address: String,
pub entry_function_module_name: String,
pub entry_function_function_name: String,
pub entry_function_contract_address: Option<String>,
pub entry_function_module_name: Option<String>,
pub entry_function_function_name: Option<String>,
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Your SQL goes here
ALTER TABLE user_transactions
ADD COLUMN entry_function_contract_address VARCHAR(66) NOT NULL,
ADD COLUMN entry_function_module_name VARCHAR(255) NOT NULL,
ADD COLUMN entry_function_function_name VARCHAR(255) NOT NULL;
ADD COLUMN entry_function_contract_address VARCHAR(66),
ADD COLUMN entry_function_module_name VARCHAR(255),
ADD COLUMN entry_function_function_name VARCHAR(255);
CREATE INDEX IF NOT EXISTS user_transactions_contract_info_index ON user_transactions (entry_function_contract_address, entry_function_module_name, entry_function_function_name);
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ pub struct UserTransaction {
pub timestamp: chrono::NaiveDateTime,
pub entry_function_id_str: String,
pub epoch: i64,
pub entry_function_contract_address: String,
pub entry_function_module_name: String,
pub entry_function_function_name: String,
pub entry_function_contract_address: Option<String>,
pub entry_function_module_name: Option<String>,
pub entry_function_function_name: Option<String>,
}

impl UserTransaction {
Expand Down Expand Up @@ -84,17 +84,18 @@ impl UserTransaction {
entry_function_id_str: get_entry_function_from_user_request(user_request)
.unwrap_or_default(),
epoch,
entry_function_contract_address:
entry_function_contract_address: Some(
get_entry_function_contract_address_from_user_request(user_request)
.unwrap_or_default(),
entry_function_module_name: get_entry_function_module_name_from_user_request(
user_request,
)
.unwrap_or_default(),
entry_function_function_name: get_entry_function_function_name_from_user_request(
user_request,
)
.unwrap_or_default(),
),
entry_function_module_name: Some(
get_entry_function_module_name_from_user_request(user_request)
.unwrap_or_default(),
),
entry_function_function_name: Some(
get_entry_function_function_name_from_user_request(user_request)
.unwrap_or_default(),
),
},
Self::get_signatures(user_request, version, block_height),
)
Expand Down
6 changes: 3 additions & 3 deletions rust/processor/src/db/postgres/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1266,11 +1266,11 @@ diesel::table! {
inserted_at -> Timestamp,
epoch -> Int8,
#[max_length = 66]
entry_function_contract_address -> Varchar,
entry_function_contract_address -> Nullable<Varchar>,
#[max_length = 255]
entry_function_module_name -> Varchar,
entry_function_module_name -> Nullable<Varchar>,
#[max_length = 255]
entry_function_function_name -> Varchar,
entry_function_function_name -> Nullable<Varchar>,
}
}

Expand Down
28 changes: 28 additions & 0 deletions rust/sdk-processor/parquet_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
health_check_port: 8085
server_config:
processor_config:
type: "parquet_ans_processor"
channel_size: 100
max_buffer_size: 1000
upload_interval: 10
# backfill_table: [ANS_PRIMARY_NAME_V2, CURRENT_ANS_PRIMARY_NAME_V2]

ans_v1_primary_names_table_handle: "0x1d5f57aa505a2fa463b7a46341913b65757e3177c46a5e483a29d953627bee62"
ans_v1_name_records_table_handle: "0x21a0fd41330f3a0a38173c7c0e4ac59cd51505f0594f64d3d637c12425c3c155"
ans_v2_contract_address: "0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c"

transaction_stream_config:
starting_version: 1056780409
indexer_grpc_data_service_address: "https://grpc.mainnet.aptoslabs.com:443"
auth_token: "aptoslabs_RBjvZ3eXfue_H77nhLmLDBLmdBFFbC49kEq7muj88UPzX"
request_name_header: "parquet_ans_processor"

db_config:
type: parquet_config
connection_string: postgresql://postgres:@localhost:5432/example
bucket_name: "aptos-indexer-data-etl-yuunnet"
bucket_root: "yuun-airflow-continue8"


# backfill_config:
# backfill_alias: "backfill_parquet_default_processor_move_resources"

0 comments on commit 4317a23

Please sign in to comment.