+1 for converting that assert to exception with the relevant text. https://issues.apache.org/jira/browse/CALCITE-1890 would probably help there to identify the relation in question (Enumerable.toString can be added to exception message).
On the other hand, I don't think we should enable expensive checks by default. Vladimir
