From 678f76e1af4679b959801ceb11247a9bb2681a58 Mon Sep 17 00:00:00 2001 From: xiuy001 Date: Mon, 2 Oct 2023 17:43:04 -0400 Subject: [PATCH] update the request data format --- .../core/realtime/streamline__blocks_realtime.sql | 2 +- .../core/realtime/streamline__transactions_realtime.sql | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/models/streamline/core/realtime/streamline__blocks_realtime.sql b/models/streamline/core/realtime/streamline__blocks_realtime.sql index a1d5359..a76fbc8 100644 --- a/models/streamline/core/realtime/streamline__blocks_realtime.sql +++ b/models/streamline/core/realtime/streamline__blocks_realtime.sql @@ -1,7 +1,7 @@ {{ config ( materialized = "view", post_hook = if_data_call_function( - func = "{{this.schema}}.udf_bulk_json_rpc(object_construct('sql_source', '{{this.identifier}}', 'external_table', 'blocks', 'sql_limit', {{var('sql_limit','2000000')}}, 'producer_batch_size', {{var('producer_batch_size','1000')}}, 'worker_batch_size', {{var('worker_batch_size','100')}}, 'batch_call_limit', {{var('batch_call_limit','10')}}, 'call_type', 'batch'))", + func = "{{this.schema}}.udf_bulk_json_rpc(object_construct('sql_source', '{{this.identifier}}', 'external_table', 'blocks', 'sql_limit', {{var('sql_limit','1000')}}, 'producer_batch_size', {{var('producer_batch_size','1000')}}, 'worker_batch_size', {{var('worker_batch_size','100')}}, 'batch_call_limit', {{var('batch_call_limit','10')}}, 'call_type', 'batch'))", target = "{{this.schema}}.{{this.identifier}}" ) ) }} diff --git a/models/streamline/core/realtime/streamline__transactions_realtime.sql b/models/streamline/core/realtime/streamline__transactions_realtime.sql index 871fefd..a36c77e 100644 --- a/models/streamline/core/realtime/streamline__transactions_realtime.sql +++ b/models/streamline/core/realtime/streamline__transactions_realtime.sql @@ -77,10 +77,11 @@ numbers AS ( 'GET', '/cosmos/tx/v1beta1/txs', PARSE_JSON('{}'), - PARSE_JSON(CONCAT('{"params":{', '"events":"tx.height=', block_number :: STRING, '",', '"pagination.limit":"100"', ',', '"pagination.offset":"', pagination_offset, '"},"id":"', block_number :: STRING, '"}')), - '' + PARSE_JSON(CONCAT('{', '"events":"tx.height=', block_number :: STRING, '",', '"pagination.limit":"100"', ',', '"pagination.offset":"', pagination_offset, '"}')), + PARSE_JSON(CONCAT('{', '"id":"', block_number :: STRING, '"}')) ) AS request FROM blocks_with_page_numbers_to_read + WHERE block_number = 1313641 ORDER BY - block_number DESC \ No newline at end of file + block_number DESC