snleee commented on a change in pull request #7180:
URL: https://github.com/apache/incubator-pinot/pull/7180#discussion_r673577406
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/segment/processing/framework/SegmentConfig.java
##########
@@ -30,7 +30,7 @@
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class SegmentConfig {
- private static final int DEFAULT_MAX_NUM_RECORDS_PER_SEGMENT = 5_000_000;
+ public static final int DEFAULT_MAX_NUM_RECORDS_PER_SEGMENT = 5_000_000;
Review comment:
1M maybe a better default num?
##########
File path:
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/MergeTaskUtils.java
##########
@@ -0,0 +1,147 @@
+/**
+ * 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.plugin.minion.tasks;
+
+import com.google.common.base.Preconditions;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Nullable;
+import org.apache.pinot.core.common.MinionConstants.MergeTask;
+import org.apache.pinot.core.segment.processing.framework.MergeType;
+import org.apache.pinot.core.segment.processing.framework.SegmentConfig;
+import org.apache.pinot.core.segment.processing.partitioner.PartitionerConfig;
+import org.apache.pinot.core.segment.processing.partitioner.PartitionerFactory;
+import org.apache.pinot.core.segment.processing.timehandler.TimeHandler;
+import org.apache.pinot.core.segment.processing.timehandler.TimeHandlerConfig;
+import org.apache.pinot.segment.spi.AggregationFunctionType;
+import org.apache.pinot.spi.config.table.ColumnPartitionConfig;
+import org.apache.pinot.spi.config.table.SegmentPartitionConfig;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.data.DateTimeFieldSpec;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.utils.TimeUtils;
+
+
+/**
+ * Common utils for segment merge tasks.
+ */
+public class MergeTaskUtils {
+ private MergeTaskUtils() {
+ }
+
+ private static final int AGGREGATION_TYPE_KEY_SUFFIX_LENGTH =
MergeTask.AGGREGATION_TYPE_KEY_SUFFIX.length();
+
+ /**
+ * Creates the time handler config based on the given table config, schema
and task config. Returns {@code null} if
+ * the table does not have a time column.
+ */
+ @Nullable
+ public static TimeHandlerConfig getTimeHandlerConfig(TableConfig
tableConfig, Schema schema,
+ Map<String, String> taskConfig) {
+ String timeColumn = tableConfig.getValidationConfig().getTimeColumnName();
+ if (timeColumn == null) {
+ return null;
+ }
+ DateTimeFieldSpec fieldSpec = schema.getSpecForTimeColumn(timeColumn);
+ Preconditions
+ .checkState(fieldSpec != null, "No valid spec found for time column:
%s in schema for table: %s", timeColumn,
+ tableConfig.getTableName());
+
+ TimeHandlerConfig.Builder timeHandlerConfigBuilder = new
TimeHandlerConfig.Builder(TimeHandler.Type.EPOCH);
+
+ String windowStartMs = taskConfig.get(MergeTask.WINDOW_START_MS_KEY);
Review comment:
Resolved offline. We decided not to pass the `start/end` time and the
executor won't be depending on the current window to decide whether to mark the
custom map in the SegmentZKMetadata. The executor will always mark the merged
segments.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]