yanlin-Lynn 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_r334801677
##########
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:
hi, @amaliujia I'm not quite sure what do you want to ask, and I guess you
were asking the implementation of `EnumerableIntersect` and `EnumerableMinus`.
They are are in
[EnumerableIntersect](https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableIntersect.java#L45)
and
[EnumerableMinus](https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMinus.java#L45)
I update the logic of these to support `all`.
----------------------------------------------------------------
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