emkornfield commented on code in PR #48345:
URL: https://github.com/apache/arrow/pull/48345#discussion_r2723661127


##########
cpp/src/arrow/util/alp/alp_constants.h:
##########
@@ -0,0 +1,256 @@
+// 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.
+
+// Constants and type traits for ALP compression
+
+#pragma once
+
+#include <cstdint>
+
+#include "arrow/util/logging.h"
+
+namespace arrow {
+namespace util {
+namespace alp {
+
+// ----------------------------------------------------------------------
+// AlpConstants
+
+/// \brief Constants used throughout ALP compression
+class AlpConstants {
+ public:
+  /// Number of elements compressed together as a unit. Fixed for 
compatibility.
+  static constexpr uint64_t kAlpVectorSize = 1024;
+
+  /// Number of elements to use when determining sampling parameters.
+  static constexpr uint64_t kSamplerVectorSize = 4096;
+
+  /// Total number of elements in a rowgroup for sampling purposes.
+  static constexpr uint64_t kSamplerRowgroupSize = 122880;
+
+  /// Number of samples to collect per vector during the sampling phase.
+  static constexpr uint64_t kSamplerSamplesPerVector = 256;
+
+  /// Number of sample vectors to collect per rowgroup.
+  static constexpr uint64_t kSamplerSampleVectorsPerRowgroup = 8;
+
+  /// Version number for the ALP compression format.
+  static constexpr uint8_t kAlpVersion = 1;
+
+  /// Type used to store exception positions within a compressed vector.
+  using PositionType = uint16_t;
+
+  /// Threshold for early exit during sampling when compression quality is 
poor.
+  static constexpr uint8_t kSamplingEarlyExitThreshold = 4;
+
+  /// Maximum number of exponent-factor combinations to try during compression.
+  static constexpr uint8_t kMaxCombinations = 5;

Review Comment:
   this this be a function of `kSamplingEarlyExitThreshold`?



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

Reply via email to