ankitsultana commented on code in PR #13885:
URL: https://github.com/apache/pinot/pull/13885#discussion_r1735403159


##########
pinot-timeseries/pinot-timeseries-spi/src/main/java/org/apache/pinot/tsdb/spi/series/SeriesBlock.java:
##########
@@ -0,0 +1,48 @@
+/**
+ * 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.series;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.pinot.tsdb.spi.TimeBuckets;
+
+
+/**
+ * Block used by time series operators. We store the series data in a map 
keyed by the series' ID. The value is a
+ * list of series, because some query languages support "union" operations 
which allow series with the same tags/labels
+ * to exist either in the query response or temporarily during execution 
before some n-ary series function
+ * is applied.
+ */
+public class SeriesBlock {
+  private final TimeBuckets _timeBuckets;
+  private final Map<Long, List<Series>> _seriesMap;

Review Comment:
   Efficiency. String comparisons and copies are costly (interning might help 
but there's a lot of nuance to it).
   
   When a series is built for the first time, we will convert the string id of 
the series to a Long hash and use that from there on. You can refer to this 
operator in the full working code: 
https://github.com/ankitsultana/pinot/pull/35/files#diff-8e88071ce9fc459e5fa8f4ade8f6ab9598d4edf7909ad054fd537804348944a6
   
   Also, note that we will likely optimize this pretty soon and this 
representation may change significantly.



-- 
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]

Reply via email to