npawar commented on a change in pull request #4798: Decouple Key from Record URL: https://github.com/apache/incubator-pinot/pull/4798#discussion_r343410846
########## File path: pinot-core/src/main/java/org/apache/pinot/core/data/table/BaseTable.java ########## @@ -0,0 +1,93 @@ +/** + * 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.pinot.core.data.table; + +import java.util.Iterator; +import java.util.List; +import org.apache.commons.collections.CollectionUtils; +import org.apache.pinot.common.request.AggregationInfo; +import org.apache.pinot.common.request.SelectionSort; +import org.apache.pinot.common.utils.DataSchema; +import org.apache.pinot.core.query.aggregation.function.AggregationFunction; +import org.apache.pinot.core.query.aggregation.function.AggregationFunctionUtils; + + +/** + * Base abstract implementation of Table + */ +public abstract class BaseTable implements Table { + + AggregationFunction[] _aggregationFunctions; + int _numAggregations; + DataSchema _dataSchema; + int _numColumns; + + // the capacity we need to trim to + int _capacity; + // the capacity with added buffer, in order to collect more records than capacity for better precision + int _maxCapacity; + + boolean _isOrderBy; + TableResizer _tableResizer; + + /** + * Initializes the variables and comparators needed for the table + */ + BaseTable(DataSchema dataSchema, List<AggregationInfo> aggregationInfos, List<SelectionSort> orderBy, int capacity) { Review comment: Every Table implementation will extend BaseTable. IndexedTable is the one which will be used only by AggregationGroupBy. We can rename that. But I would like that to be done in the future changes, once we have at least one more implementation (which should be soon in @siddharthteotia 's DISTINCT related changes). At that time, we could revisit the Constructor of BaseTable, to remove irrelevant things (potentially keep only dataSchema and capacity). ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
