Repository: prestodb/presto
Issue: Duplicate DistinctLimitNode in query plan

When explain distinct limit query, the plan looks like below
There are duplicate DistinctLimit in the plan.

```
presto:orc> explain select distinct l_orderkey from lineitem limit 10;
                                                                                Query Plan                                                                                 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 - Output[l_orderkey] => [l_orderkey:bigint]                                                                                                                               
     - DistinctLimit[10] => [l_orderkey:bigint, $hashvalue:bigint]                                                                                                         
         - Exchange[GATHER] => l_orderkey:bigint, $hashvalue:bigint                                                                                                        
             - DistinctLimit[10] => [l_orderkey:bigint, $hashvalue:bigint]                                                                                                 
                 - DistinctLimit[10] => [l_orderkey:bigint, $hashvalue:bigint]                                                                                             
                     - Project => [l_orderkey:bigint, $hashvalue:bigint]                                                                                                   
                             $hashvalue := "combine_hash"(0, COALESCE("$operator$hash_code"("l_orderkey"), 0))                                                             
                         - TableScan[hive:hive:orc:lineitem, originalConstraint = true] => [l_orderkey:bigint]                                                             
                                 LAYOUT: hive                                                                                                                              
                                 l_orderkey := HiveColumnHandle{clientId=hive, name=l_orderkey, ordinalPosition=0, hiveType=bigint, hiveColumnIndex=0, partitionKey=false}
```


Changed files:
presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java

diff --git a/presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java b/presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java
index 90beffb26c..ae565e188e 100644
--- a/presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java
+++ b/presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java
@@ -545,10 +545,6 @@ public class AddExchanges
             PlanWithProperties child = planChild(node, context.withPreferredProperties(PreferredProperties.any()));
 
             if (child.getProperties().isDistributed()) {
-                child = withDerivedProperties(
-                        new DistinctLimitNode(idAllocator.getNextId(), child.getNode(), node.getLimit(), node.getHashSymbol()),
-                        child.getProperties());
-
                 child = withDerivedProperties(
                         gatheringExchange(
                                 idAllocator.getNextId(),