amaliujia commented on a change in pull request #1503: [CALCITE-3408] Add 
support for enumerable intersect/minus all
URL: https://github.com/apache/calcite/pull/1503#discussion_r335120242
 
 

 ##########
 File path: 
linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java
 ##########
 @@ -532,15 +533,19 @@ public void remove() {
    * by Enumerable.)
    */
   public static <TSource> Enumerable<TSource> except(
-      Enumerable<TSource> source0, Enumerable<TSource> source1) {
+      Enumerable<TSource> source0, Enumerable<TSource> source1, boolean all) {
     Set<TSource> set = new HashSet<>();
-    source0.into(set);
-    try (Enumerator<TSource> os = source1.enumerator()) {
+    Collection<TSource> resultCollection = all ? HashMultiset.create() : new 
HashSet<>();
 
 Review comment:
   Thank Yanlin. 
   
   I was looking for some preciously definition of the set op "ALL" 
implementation (like comments). 
   
   Basically either something like:
   ```
   // Say for Row R, there are m instances on left and n instances on right,
   // INTERSECT ALL outputs MIN(m, n) instances of R.
   ```
   
   Or 
   ```
   Calcite implementation follows XX DB's implementation. See their doc(link)
   ```
   
   If there is no such thing I will just read code.
    

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to