This question is a follow up on the StackOverflow answer that described how to create a
LogicalTableModify node for DML operations: stackoverflow.com/a/45364366/13036362
I’m wondering what are the steps needed to execute a
LogicalTableModify node on a JDBC data source. I’ve created a
LogicalTableModify through the
JdbcTable.toModificationRel method, but I’m not sure how to execute it.
Here is the code I’ve attempted, where I try to insert a row into a JDBC table and execute it using
RelNode values = relBuilder.values(rowType, "4", "D", "firstname.lastname@example.org").build(); TableModify modify = jdbcTable.toModificationRel(cluster, relOptTable, catalogReader, values , TableModify.Operation.INSERT, null, null, true); PreparedStatement ps = RelRunners.run(modify); ps.execute();
I encountered a stack overflow error after running this piece of code due to
NoneToBindableConverterRule rule being applied indefinitely. So I’m wondering what is the right way to execute
LogicalTableModify. Thank you.
Read more here: Source link