Handle distinct nodes as inputs for SetPlanNodes
Added one more test case
merge ScottDugas: handle distinct as on left or right side of set plan node

Merge pull request #1553 from ScottDugas/sql-layer/class-cast-distinct
https://github.com/FoundationDB/sql-layer/pull/1553