-
Notifications
You must be signed in to change notification settings - Fork 1
Description
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:
ivm-extension/ivm_extension.cpp
Line 102 in e968d05
| 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:
ivm-extension/include/ivm_rewrite_rule.hpp
Line 328 in e968d05
| 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.