Hello,

I'm trying to generate SQL for a trigger that requires a little rewrite of a RelNode structure and I wanted to know if anyone could help me figure out how to do a few things

 * I need to swap left and right of a LogicalJoin. Doing that messes up
   predicates and projections though. Is there a utility I could use or
   how would I do that?
 * I need to introduce an "alias" like "NEW" into a RelNode for which I
   want to create a RexNode "NEW.key1" for. I want to add a WHERE
   condition based on the NEW alias. Not sure how I would do that
   though. On SqlNode level only maybe?
 * Can I somehow determine what columns of a table are unique or part
   of the primary key? I want to create a predicate like (NEW.key1,
   NEW.key2) = (existing.key1, existing.key2)

Thanks in advance!

Regards,

Christian

Reply via email to