ankitsultana commented on code in PR #9873: URL: https://github.com/apache/pinot/pull/9873#discussion_r1071027499
########## pinot-query-planner/src/main/java/org/apache/pinot/query/planner/physical/colocated/ColocationKey.java: ########## @@ -0,0 +1,96 @@ +/** + * 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.query.planner.physical.colocated; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import org.apache.calcite.rex.RexInputRef; + + +/** + * ColocationKey describes how data is distributed in a given stage. It consists of a list of columns which are stored + * as a list of {@link RexInputRef#getIndex()}, the number of partitions and the hash-algorithm used. A given stage may + * have more than 1 ColocationKey, in which case one may use a {@link java.util.Set< ColocationKey >} to represent this Review Comment: A TableScan stage is expected to have only 1 Colocation key. Other stages may have more than 1 colocation key. Such a state may be described as: data is partitioned by both colocationKeyA and colocationKeyB. Some examples where this may happen: 1. Join-stage. If there's a join on A.col1 and B.col2, then the join-stage is considered to have the colocation key {[A.col1], [B.col2]}, indicating that the data is partitioned by both A.col1 and B.col2. 2. Ancestors of a join-stage, assuming there's no shuffling done and the colocation key sustains. -- 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. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org