vlsi commented on a change in pull request #2329: URL: https://github.com/apache/calcite/pull/2329#discussion_r565275001
########## File path: linq4j/src/main/java/org/apache/calcite/linq4j/MergeUnionEnumerator.java ########## @@ -0,0 +1,198 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.calcite.linq4j; + +import org.apache.calcite.linq4j.function.EqualityComparer; +import org.apache.calcite.linq4j.function.Function1; + +import org.checkerframework.checker.initialization.qual.UnknownInitialization; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.checkerframework.checker.nullness.qual.RequiresNonNull; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Set; + +/** + * Performs a union (or union all) of all its inputs (which must be already sorted), + * respecting the order. + * @param <TSource> record type + * @param <TKey> sort key + */ +final class MergeUnionEnumerator<TSource, TKey> implements Enumerator<TSource> { + private final List<Enumerator<TSource>> inputs; + private final TSource[] currentInputsValues; Review comment: Should the data types be aligned? For instance, `everything stored as arrays` or `everything stored as lists`. ---------------------------------------------------------------- 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]
