Skip to content

SELECT * FROM DoIVM(...) in PRAGMA fails, but INSERT into delta_view SELECT * FROM DoIVM(...) succeeds #8

@kriti-sc

Description

@kriti-sc

The PRAGMA generates a series of SQL queries that perform IVM on view and insert the result into delta_view.
This is the IVM query that is executed:

string ivm_query = "INSERT INTO delta_"+view_name+" SELECT * from DoIVM('"+view_catalog_name+"','"+view_schema_name+"','"+view_name+"');";

Internally, from this query, the view is fetched and the definition/base query of the view is obtained. The optimized logical plan for this query is generated and modified to operate on delta_basetable. At the end, and INSERT node is generated and placed at the top of the plan:

AddInsertNode(context, optimized_plan, table_index, view, view_catalog, view_schema);

Thus, it does not matter if the IVM query is SELECT * FROM DoIVM(...) or INSERT INTO delta_view SELECT * FROM DoIVM(...). But, for some reason, the former fails with the following error and the latter succeeds.

Error: INTERNAL Error: Assertion triggered in file "/Users/kriti/Projects/duckdb/src/common/types/column/column_data_collection.cpp" on line 716: types == input.GetTypes()

Debug details on printing out types and input.GetTypes():

Types: HUGEINT | Types: BIGINT | Types: INTEGER | Types: BOOLEAN | 
Input get types: BIGINT |

This is minor but good to figure out why this is happening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions