Skip to content

bug: non-incremental sql error returned for column not found error #1514

@shiyasmohd

Description

@shiyasmohd

When registering a dataset using ampctl, if the sql query contains column that doesn't exist, the returned error is

Manifest validation error: Table 'blocks' contains non-incremental SQL: planning error

It happens here, For non non-incremental sql errors, its wrapped in NonIncrementalSql error.

This works correctly in typescript cli, amp register command, since ts cli calls the /schema endpoint first and fails there first with correct error where as in ampctl datasets register, directly calls the /register endpoint.

Manifest to reproduce

{
    "kind": "manifest",
    "dependencies": {
        "mainnet": "shiyasmohd/[email protected]"
    },
    "tables": {
        "blocks": {
            "input": {
                "sql": "\n        SELECT block_nums FROM mainnet.blocks\n      "
            },
            "schema": {
                "arrow": {
                    "fields": [
                        {
                            "name": "_block_num",
                            "type": "UInt64",
                            "nullable": false
                        },
                        {
                            "name": "block_num",
                            "type": "UInt64",
                            "nullable": false
                        }
                    ]
                }
            },
            "network": "mainnet"
        }
    },
    "functions": {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions