ankitsultana commented on code in PR #15764: URL: https://github.com/apache/pinot/pull/15764#discussion_r2085422500
########## pinot-tools/src/main/java/org/apache/pinot/tools/ColocatedJoinQuickStart.java: ########## @@ -0,0 +1,145 @@ +/** + * 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.tools; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.pinot.spi.utils.CommonConstants; +import org.apache.pinot.tools.admin.PinotAdministrator; +import org.apache.pinot.tools.admin.command.QuickstartRunner; + + +public class ColocatedJoinQuickStart extends MultistageEngineQuickStart { + private static final String QUICKSTART_IDENTIFIER = "COLOCATED_JOIN"; + private static final String[] COLOCATED_JOIN_DIRECTORIES = new String[]{ + "examples/batch/colocated/userAttributes", "examples/batch/colocated/userGroups" + }; + + private static final String EXPLICIT = "SELECT COUNT(*) " + + "FROM userAttributes /*+ tableOptions(partition_key='userUUID', partition_size='2') */ ua " + + "JOIN userGroups /*+ tableOptions(partition_key='userUUID', partition_size='2') */ ug " + + "ON ua.userUUID = ug.userUUID"; + + private static final String IMPLICIT = "SET inferPartitionHint = true; " + + "SELECT COUNT(*) " + + "FROM userAttributes ua " + + "JOIN userGroups ug " + + "ON ua.userUUID = ug.userUUID"; + + private static final String PARTITION_PARALLELISM = "SET inferPartitionHint = true; " + + "SELECT COUNT(*) " + + "FROM userAttributes /*+ tableOptions(partition_parallelism='2') */ ua " + + "JOIN userGroups /*+ tableOptions(partition_parallelism='2') */ ug " + + "ON ua.userUUID = ug.userUUID"; + + private static final String MULTIPLE_PARTITIONS_PER_WORKER = "SET inferPartitionHint = true; " + + "SELECT COUNT(*) " + + "FROM userAttributes /*+ tableOptions(partition_size='2') */ ua " + + "JOIN userGroups /*+ tableOptions(partition_size='2') */ ug " + + "ON ua.userUUID = ug.userUUID"; + + private static final String MULTIPLE_PARTITIONS_PER_WORKER_AND_PARALLELISM = "SET inferPartitionHint = true; " + + "SELECT COUNT(*) " + + "FROM userAttributes /*+ tableOptions(partition_size='2', partition_parallelism='2') */ ua " + + "JOIN userGroups /*+ tableOptions(partition_size='2', partition_parallelism='2') */ ug " Review Comment: related: how are `partition_parallelism` and `stageParallelism` different? Could we consolidate to a single config? It was a big challenge to wrap my head around what these two are semantically supposed to do. These are quite hard to explain to users too. -- 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