Skip to content

Inconsistent type inference #127

@fleupold

Description

@fleupold

We have two table with the exact scheme in Postgres:

solver_slippage=> \d+ batch_data_gnosis_2024_12
                                            Table "public.batch_data_gnosis_2024_12"
        Column        |       Type       | Collation | Nullable | Default | Storage  | Compression | Stats target | Description 
----------------------+------------------+-----------+----------+---------+----------+-------------+--------------+-------------
 environment          | text             |           |          |         | extended |             |              | 
 auction_id           | bigint           |           |          |         | plain    |             |              | 
 block_number         | bigint           |           |          |         | plain    |             |              | 
 block_deadline       | bigint           |           |          |         | plain    |             |              | 
 tx_hash              | text             |           |          |         | extended |             |              | 
 solver               | text             |           |          |         | extended |             |              | 
 execution_cost       | double precision |           |          |         | plain    |             |              | 
 surplus              | double precision |           |          |         | plain    |             |              | 
 protocol_fee         | double precision |           |          |         | plain    |             |              | 
 network_fee          | double precision |           |          |         | plain    |             |              | 
 uncapped_payment_eth | double precision |           |          |         | plain    |             |              | 
 capped_payment       | double precision |           |          |         | plain    |             |              | 
 winning_score        | double precision |           |          |         | plain    |             |              | 
 reference_score      | double precision |           |          |         | plain    |             |              | 
Access method: heap

solver_slippage=> \d+ batch_data_ethereum_2024_12
                                           Table "public.batch_data_ethereum_2024_12"
        Column        |       Type       | Collation | Nullable | Default | Storage  | Compression | Stats target | Description 
----------------------+------------------+-----------+----------+---------+----------+-------------+--------------+-------------
 environment          | text             |           |          |         | extended |             |              | 
 auction_id           | bigint           |           |          |         | plain    |             |              | 
 block_number         | bigint           |           |          |         | plain    |             |              | 
 block_deadline       | bigint           |           |          |         | plain    |             |              | 
 tx_hash              | text             |           |          |         | extended |             |              | 
 solver               | text             |           |          |         | extended |             |              | 
 execution_cost       | double precision |           |          |         | plain    |             |              | 
 surplus              | double precision |           |          |         | plain    |             |              | 
 protocol_fee         | double precision |           |          |         | plain    |             |              | 
 network_fee          | double precision |           |          |         | plain    |             |              | 
 uncapped_payment_eth | double precision |           |          |         | plain    |             |              | 
 capped_payment       | double precision |           |          |         | plain    |             |              | 
 winning_score        | double precision |           |          |         | plain    |             |              | 
 reference_score      | double precision |           |          |         | plain    |             |              | 
Access method: heap

which both get synced to dune with the same dune-sync config file (select * from <table>) in the same way.

Yet the dune tables (dataset_batch_data_gnosis_2024_12, dataset_batch_data_ethereum_2024_12) result in different schemas:

image
image

Note, in particular the different data type for execution_cost (varchar vs double).

This makes it impossible to later on union those tables together in a convenient way.

Would it be possible to use the underlying SQL datatypes to infer what types the upload should have?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions