ankitsultana commented on code in PR #13885: URL: https://github.com/apache/pinot/pull/13885#discussion_r1750027760
########## pinot-timeseries/pinot-timeseries-spi/src/main/java/org/apache/pinot/tsdb/spi/RangeTimeSeriesRequest.java: ########## @@ -0,0 +1,99 @@ +/** + * 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.tsdb.spi; + +import java.time.Duration; + + +/** + * A time-series request received by the Pinot Broker. This is passed to the {@link TimeSeriesLogicalPlanner} so + * each query language can parse and plan the query based on their spec. + * <br/> + * <br/> + * <b>Notes:</b> + * <ul> + * <li>[start, end] are both inclusive.</li> + * <li> + * The result can contain time values outside [start, end], though we generally recommend to keep your results + * within the requested range. This decision is left to the time-series query language implementations. In some + * cases, returning data outside the requested time-range can help (e.g. for debugging purposes when you are + * computing moving 1d sum but are only looking at data for the last 12 hours). + * </li> + * <li>stepSeconds is used to define the default resolution for the query</li> + * <li> + * Some query languages allow users to change the resolution via a function, and in those cases the returned + * time-series may have a resolution different than stepSeconds + * </li> + * <li> + * The query execution may scan and process data outside of the time-range [start, end]. The actual data scanned + * and processed is defined by the {@link TimeBuckets} used by the operator. + * </li> + * </ul> + */ +public class RangeTimeSeriesRequest { + /** Engine allows a Pinot cluster to support multiple Time-Series Query Languages. */ + private final String _engine; + /** Query is the raw query sent by the caller. */ + private final String _query; + /** Start time of the time-window being queried. */ + private final long _startSeconds; Review Comment: The granularity here controls the minimum granularity of the response and the query execution. I don't think we will ever support granularity of less than a second. I had kept this compliant with Prometheus and other time-series systems (our M3 system at Uber also uses seconds for specifying range). -- 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]
