julianhyde/optiq — pull request #271 by amansinha100 (2014-05-03 23:09:31+00:00)
Title: Enhance changeTraitsUsingConverters such that it uses previously converted RelNode

The motivation for this code change was to address the following issue:
When planning for MergeJoin in Drill, we were trying to generate 2 plans as part of the rule's onMatch : (1) hash distribute both children of the join, followed by sort both children and (2) broadcast right child followed by a sort right child, only sort the left child (i.e leave the left side's distribution as-is since we don't care about it if the right side is being broadcast). During this process, we encountered the following assert in VolcanoPlanner.ensureRegistered() method:
"Same set, different subsets means rel and equivRel have different traits, and that's an error"