git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Delete and Update projecting unnecessary columns


Hi,

Before I start just want to say thanks again for Calcite,  such a useful piece of software.

We are getting RA from calcite for a query engine.  We are using the Planner interface.

When we generate UPDATE or DELETE queries we get a lot of unnecessary columns included, it basically project every column in the table.

example

|CREATE TABLE CUSTOMER ( i1 INTEGER, i2 INTEGER) |

with delete

|delete from CUSTOMER |

result remainded the same with extra projection

|{ "rels": [ { "id": "0", "relOp": "EnumerableTableScan", "fieldNames": [ "i1", "i2", "rowid" ], "table": [ "mapd", "CUSTOMER" ], "inputs": [] }, { "id": "1", "relOp": "LogicalProject", "fields": [ "i1", "i2", "rowid" ], "exprs": [ { "input": 0 }, { "input": 1 }, { "input": 2 } ] }, { "id": "2", "relOp": "LogicalTableModify", "table": [ "mapd", "CUSTOMER" ], "operation": "DELETE", "flattened": true } ] } |


Note: We tried adding

|.withTrimUnusedFields(true) |

in the Planner but it did not seem to make any difference.

Is there some easy way to remove these extra project columns with calcite or do we have to do it after we get the relational algebra.

Regards