Jackie-Jiang commented on code in PR #19305:
URL: https://github.com/apache/pinot/pull/19305#discussion_r3856033680


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/codec/DeltaDeltaCodecDefinition.java:
##########
@@ -0,0 +1,209 @@
+/**
+ * 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.segment.local.io.codec;
+
+import java.nio.ByteBuffer;
+import java.util.List;
+
+
+/// Transform codec that computes delta-of-delta values between successive 
values before the
+/// compression stage (if any). Useful for data where the differences between 
consecutive values
+/// are approximately constant (e.g. timestamps with regular intervals).
+///
+/// DSL form: `DELTADELTA` (no arguments)
+///
+/// Supported stored types: `INT`, `LONG`.
+///
+/// Stateless and thread-safe; the [#INSTANCE] singleton is shared across all 
columns.
+///
+/// Wire format (header-less passthrough — element type from the column 
context, value count from
+/// the buffer length, so the output is a same-width typed value array a 
following transform can
+/// consume):
+/// ```
+///   [element_size bytes: first value verbatim]
+///   [element_size bytes: first delta (second - first), if count > 1]
+///   [(count-2) * element_size bytes: delta-of-deltas, if count > 2]
+/// ```
+final class DeltaDeltaCodecDefinition

Review Comment:
   Do we need DELTADELTA, or just chain 2 DELTA?
   What is the pros and cons of both approaches?



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