Browse Source

Restoring authorship annotation for Artem Zuikov <chertus@gmail.com>. Commit 1 of 2.

Artem Zuikov 3 years ago
parent
commit
d23c9e2333

+ 19 - 19
contrib/libs/apache/arrow/.yandex_meta/devtools.licenses.report

@@ -1308,25 +1308,25 @@ BELONGS ya.make
         cpp/src/arrow/compute/util_internal.h [1:16]
         cpp/src/arrow/config.cc [1:16]
         cpp/src/arrow/config.h [1:16]
-        cpp/src/arrow/csv/api.h [1:16]
-        cpp/src/arrow/csv/chunker.cc [1:16]
-        cpp/src/arrow/csv/chunker.h [1:16]
-        cpp/src/arrow/csv/column_builder.cc [1:16]
-        cpp/src/arrow/csv/column_builder.h [1:16]
-        cpp/src/arrow/csv/column_decoder.cc [1:16]
-        cpp/src/arrow/csv/column_decoder.h [1:16]
-        cpp/src/arrow/csv/converter.cc [1:16]
-        cpp/src/arrow/csv/converter.h [1:16]
-        cpp/src/arrow/csv/inference_internal.h [1:16]
-        cpp/src/arrow/csv/options.cc [1:16]
-        cpp/src/arrow/csv/options.h [1:16]
-        cpp/src/arrow/csv/parser.cc [1:16]
-        cpp/src/arrow/csv/parser.h [1:16]
-        cpp/src/arrow/csv/reader.cc [1:16]
-        cpp/src/arrow/csv/reader.h [1:16]
-        cpp/src/arrow/csv/type_fwd.h [1:16]
-        cpp/src/arrow/csv/writer.cc [1:16]
-        cpp/src/arrow/csv/writer.h [1:16]
+        cpp/src/arrow/csv/api.h [1:16] 
+        cpp/src/arrow/csv/chunker.cc [1:16] 
+        cpp/src/arrow/csv/chunker.h [1:16] 
+        cpp/src/arrow/csv/column_builder.cc [1:16] 
+        cpp/src/arrow/csv/column_builder.h [1:16] 
+        cpp/src/arrow/csv/column_decoder.cc [1:16] 
+        cpp/src/arrow/csv/column_decoder.h [1:16] 
+        cpp/src/arrow/csv/converter.cc [1:16] 
+        cpp/src/arrow/csv/converter.h [1:16] 
+        cpp/src/arrow/csv/inference_internal.h [1:16] 
+        cpp/src/arrow/csv/options.cc [1:16] 
+        cpp/src/arrow/csv/options.h [1:16] 
+        cpp/src/arrow/csv/parser.cc [1:16] 
+        cpp/src/arrow/csv/parser.h [1:16] 
+        cpp/src/arrow/csv/reader.cc [1:16] 
+        cpp/src/arrow/csv/reader.h [1:16] 
+        cpp/src/arrow/csv/type_fwd.h [1:16] 
+        cpp/src/arrow/csv/writer.cc [1:16] 
+        cpp/src/arrow/csv/writer.h [1:16] 
         cpp/src/arrow/datum.cc [1:16]
         cpp/src/arrow/datum.h [1:16]
         cpp/src/arrow/device.cc [1:16]

+ 44 - 44
contrib/libs/apache/arrow/cpp/src/arrow/api.h

@@ -1,44 +1,44 @@
-// 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.
-
-// Coarse public API while the library is in development
-
-#pragma once
-
-#include "arrow/array.h"                    // IYWU pragma: export
-#include "arrow/array/concatenate.h"        // IYWU pragma: export
-#include "arrow/buffer.h"                   // IYWU pragma: export
-#include "arrow/builder.h"                  // IYWU pragma: export
-#include "arrow/chunked_array.h"            // IYWU pragma: export
-#include "arrow/compare.h"                  // IYWU pragma: export
-#include "arrow/config.h"                   // IYWU pragma: export
-#include "arrow/datum.h"                    // IYWU pragma: export
-#include "arrow/extension_type.h"           // IYWU pragma: export
-#include "arrow/memory_pool.h"              // IYWU pragma: export
-#include "arrow/pretty_print.h"             // IYWU pragma: export
-#include "arrow/record_batch.h"             // IYWU pragma: export
-#include "arrow/result.h"                   // IYWU pragma: export
-#include "arrow/status.h"                   // IYWU pragma: export
-#include "arrow/table.h"                    // IYWU pragma: export
-#include "arrow/table_builder.h"            // IYWU pragma: export
-#include "arrow/tensor.h"                   // IYWU pragma: export
-#include "arrow/type.h"                     // IYWU pragma: export
-#include "arrow/util/key_value_metadata.h"  // IWYU pragma: export
-#include "arrow/visitor.h"                  // IYWU pragma: export
-
-/// \brief Top-level namespace for Apache Arrow C++ API
-namespace arrow {}
+// 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. 
+ 
+// Coarse public API while the library is in development 
+ 
+#pragma once 
+ 
+#include "arrow/array.h"                    // IYWU pragma: export 
+#include "arrow/array/concatenate.h"        // IYWU pragma: export 
+#include "arrow/buffer.h"                   // IYWU pragma: export 
+#include "arrow/builder.h"                  // IYWU pragma: export 
+#include "arrow/chunked_array.h"            // IYWU pragma: export 
+#include "arrow/compare.h"                  // IYWU pragma: export 
+#include "arrow/config.h"                   // IYWU pragma: export 
+#include "arrow/datum.h"                    // IYWU pragma: export 
+#include "arrow/extension_type.h"           // IYWU pragma: export 
+#include "arrow/memory_pool.h"              // IYWU pragma: export 
+#include "arrow/pretty_print.h"             // IYWU pragma: export 
+#include "arrow/record_batch.h"             // IYWU pragma: export 
+#include "arrow/result.h"                   // IYWU pragma: export 
+#include "arrow/status.h"                   // IYWU pragma: export 
+#include "arrow/table.h"                    // IYWU pragma: export 
+#include "arrow/table_builder.h"            // IYWU pragma: export 
+#include "arrow/tensor.h"                   // IYWU pragma: export 
+#include "arrow/type.h"                     // IYWU pragma: export 
+#include "arrow/util/key_value_metadata.h"  // IWYU pragma: export 
+#include "arrow/visitor.h"                  // IYWU pragma: export 
+ 
+/// \brief Top-level namespace for Apache Arrow C++ API 
+namespace arrow {} 

+ 1 - 1
contrib/libs/apache/arrow/cpp/src/arrow/array/builder_binary.h

@@ -53,7 +53,7 @@ class BaseBinaryBuilder : public ArrayBuilder {
   explicit BaseBinaryBuilder(MemoryPool* pool = default_memory_pool())
       : ArrayBuilder(pool), offsets_builder_(pool), value_data_builder_(pool) {}
 
-  BaseBinaryBuilder(const std::shared_ptr<DataType>& /*type*/, MemoryPool* pool)
+  BaseBinaryBuilder(const std::shared_ptr<DataType>& /*type*/, MemoryPool* pool) 
       : BaseBinaryBuilder(pool) {}
 
   Status Append(const uint8_t* value, offset_type length) {

+ 3 - 3
contrib/libs/apache/arrow/cpp/src/arrow/array/builder_dict.h

@@ -421,11 +421,11 @@ class DictionaryBuilderBase<BuilderType, NullType> : public ArrayBuilder {
   DictionaryBuilderBase(
       enable_if_t<std::is_base_of<AdaptiveIntBuilderBase, B>::value, uint8_t>
           start_int_size,
-      const std::shared_ptr<DataType>& /*value_type*/,
+      const std::shared_ptr<DataType>& /*value_type*/, 
       MemoryPool* pool = default_memory_pool())
       : ArrayBuilder(pool), indices_builder_(start_int_size, pool) {}
 
-  explicit DictionaryBuilderBase(const std::shared_ptr<DataType>& /*value_type*/,
+  explicit DictionaryBuilderBase(const std::shared_ptr<DataType>& /*value_type*/, 
                                  MemoryPool* pool = default_memory_pool())
       : ArrayBuilder(pool), indices_builder_(pool) {}
 
@@ -439,7 +439,7 @@ class DictionaryBuilderBase<BuilderType, NullType> : public ArrayBuilder {
   explicit DictionaryBuilderBase(MemoryPool* pool = default_memory_pool())
       : ArrayBuilder(pool), indices_builder_(pool) {}
 
-  explicit DictionaryBuilderBase(const std::shared_ptr<Array>& /*dictionary*/,
+  explicit DictionaryBuilderBase(const std::shared_ptr<Array>& /*dictionary*/, 
                                  MemoryPool* pool = default_memory_pool())
       : ArrayBuilder(pool), indices_builder_(pool) {}
 

+ 1 - 1
contrib/libs/apache/arrow/cpp/src/arrow/array/builder_primitive.h

@@ -32,7 +32,7 @@ namespace arrow {
 class ARROW_EXPORT NullBuilder : public ArrayBuilder {
  public:
   explicit NullBuilder(MemoryPool* pool = default_memory_pool()) : ArrayBuilder(pool) {}
-  explicit NullBuilder(const std::shared_ptr<DataType>& /*type*/,
+  explicit NullBuilder(const std::shared_ptr<DataType>& /*type*/, 
                        MemoryPool* pool = default_memory_pool())
       : NullBuilder(pool) {}
 

+ 35 - 35
contrib/libs/apache/arrow/cpp/src/arrow/compute/api.h

@@ -1,35 +1,35 @@
-// 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.
-
-// NOTE: API is EXPERIMENTAL and will change without going through a
-// deprecation cycle
-
-#pragma once
-
-/// \defgroup compute-concrete-options Concrete option classes for compute functions
-/// @{
-/// @}
-
-#include "arrow/compute/api_aggregate.h"  // IWYU pragma: export
-#include "arrow/compute/api_scalar.h"     // IWYU pragma: export
-#include "arrow/compute/api_vector.h"     // IWYU pragma: export
-#include "arrow/compute/cast.h"           // IWYU pragma: export
-#include "arrow/compute/exec.h"           // IWYU pragma: export
-#include "arrow/compute/function.h"       // IWYU pragma: export
-#include "arrow/compute/kernel.h"         // IWYU pragma: export
-#include "arrow/compute/registry.h"       // IWYU pragma: export
-#include "arrow/datum.h"                  // IWYU pragma: export
+// 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. 
+ 
+// NOTE: API is EXPERIMENTAL and will change without going through a 
+// deprecation cycle 
+ 
+#pragma once 
+ 
+/// \defgroup compute-concrete-options Concrete option classes for compute functions 
+/// @{ 
+/// @} 
+ 
+#include "arrow/compute/api_aggregate.h"  // IWYU pragma: export 
+#include "arrow/compute/api_scalar.h"     // IWYU pragma: export 
+#include "arrow/compute/api_vector.h"     // IWYU pragma: export 
+#include "arrow/compute/cast.h"           // IWYU pragma: export 
+#include "arrow/compute/exec.h"           // IWYU pragma: export 
+#include "arrow/compute/function.h"       // IWYU pragma: export 
+#include "arrow/compute/kernel.h"         // IWYU pragma: export 
+#include "arrow/compute/registry.h"       // IWYU pragma: export 
+#include "arrow/datum.h"                  // IWYU pragma: export 

+ 51 - 51
contrib/libs/apache/arrow/cpp/src/arrow/compute/api_aggregate.cc

@@ -1,30 +1,30 @@
-// 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.
-
-#include "arrow/compute/api_aggregate.h"
-
-#include "arrow/compute/exec.h"
+// 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. 
+ 
+#include "arrow/compute/api_aggregate.h" 
+ 
+#include "arrow/compute/exec.h" 
 #include "arrow/compute/function_internal.h"
 #include "arrow/compute/registry.h"
 #include "arrow/compute/util_internal.h"
 #include "arrow/util/checked_cast.h"
 #include "arrow/util/logging.h"
-
-namespace arrow {
+ 
+namespace arrow { 
 
 namespace internal {
 template <>
@@ -52,9 +52,9 @@ struct EnumTraits<compute::QuantileOptions::Interpolation>
 };
 }  // namespace internal
 
-namespace compute {
-
-// ----------------------------------------------------------------------
+namespace compute { 
+ 
+// ---------------------------------------------------------------------- 
 // Function options
 
 using ::arrow::internal::checked_cast;
@@ -133,33 +133,33 @@ void RegisterAggregateOptions(FunctionRegistry* registry) {
 }  // namespace internal
 
 // ----------------------------------------------------------------------
-// Scalar aggregates
-
+// Scalar aggregates 
+ 
 Result<Datum> Count(const Datum& value, const ScalarAggregateOptions& options,
                     ExecContext* ctx) {
-  return CallFunction("count", {value}, &options, ctx);
-}
-
+  return CallFunction("count", {value}, &options, ctx); 
+} 
+ 
 Result<Datum> Mean(const Datum& value, const ScalarAggregateOptions& options,
                    ExecContext* ctx) {
   return CallFunction("mean", {value}, &options, ctx);
-}
-
+} 
+ 
 Result<Datum> Sum(const Datum& value, const ScalarAggregateOptions& options,
                   ExecContext* ctx) {
   return CallFunction("sum", {value}, &options, ctx);
-}
-
+} 
+ 
 Result<Datum> MinMax(const Datum& value, const ScalarAggregateOptions& options,
                      ExecContext* ctx) {
-  return CallFunction("min_max", {value}, &options, ctx);
-}
-
+  return CallFunction("min_max", {value}, &options, ctx); 
+} 
+ 
 Result<Datum> Any(const Datum& value, const ScalarAggregateOptions& options,
                   ExecContext* ctx) {
   return CallFunction("any", {value}, &options, ctx);
-}
-
+} 
+ 
 Result<Datum> All(const Datum& value, const ScalarAggregateOptions& options,
                   ExecContext* ctx) {
   return CallFunction("all", {value}, &options, ctx);
@@ -169,16 +169,16 @@ Result<Datum> Mode(const Datum& value, const ModeOptions& options, ExecContext*
   return CallFunction("mode", {value}, &options, ctx);
 }
 
-Result<Datum> Stddev(const Datum& value, const VarianceOptions& options,
-                     ExecContext* ctx) {
-  return CallFunction("stddev", {value}, &options, ctx);
-}
-
-Result<Datum> Variance(const Datum& value, const VarianceOptions& options,
-                       ExecContext* ctx) {
-  return CallFunction("variance", {value}, &options, ctx);
-}
-
+Result<Datum> Stddev(const Datum& value, const VarianceOptions& options, 
+                     ExecContext* ctx) { 
+  return CallFunction("stddev", {value}, &options, ctx); 
+} 
+ 
+Result<Datum> Variance(const Datum& value, const VarianceOptions& options, 
+                       ExecContext* ctx) { 
+  return CallFunction("variance", {value}, &options, ctx); 
+} 
+ 
 Result<Datum> Quantile(const Datum& value, const QuantileOptions& options,
                        ExecContext* ctx) {
   return CallFunction("quantile", {value}, &options, ctx);
@@ -193,5 +193,5 @@ Result<Datum> Index(const Datum& value, const IndexOptions& options, ExecContext
   return CallFunction("index", {value}, &options, ctx);
 }
 
-}  // namespace compute
-}  // namespace arrow
+}  // namespace compute 
+}  // namespace arrow 

+ 145 - 145
contrib/libs/apache/arrow/cpp/src/arrow/compute/api_aggregate.h

@@ -1,58 +1,58 @@
-// 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.
-
-// Eager evaluation convenience APIs for invoking common functions, including
-// necessary memory allocations
-
-#pragma once
-
-#include "arrow/compute/function.h"
-#include "arrow/datum.h"
-#include "arrow/result.h"
-#include "arrow/util/macros.h"
-#include "arrow/util/visibility.h"
-
-namespace arrow {
-
-class Array;
-
-namespace compute {
-
-class ExecContext;
-
-// ----------------------------------------------------------------------
-// Aggregate functions
-
-/// \addtogroup compute-concrete-options
-/// @{
-
+// 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. 
+ 
+// Eager evaluation convenience APIs for invoking common functions, including 
+// necessary memory allocations 
+ 
+#pragma once 
+ 
+#include "arrow/compute/function.h" 
+#include "arrow/datum.h" 
+#include "arrow/result.h" 
+#include "arrow/util/macros.h" 
+#include "arrow/util/visibility.h" 
+ 
+namespace arrow { 
+ 
+class Array; 
+ 
+namespace compute { 
+ 
+class ExecContext; 
+ 
+// ---------------------------------------------------------------------- 
+// Aggregate functions 
+ 
+/// \addtogroup compute-concrete-options 
+/// @{ 
+ 
 /// \brief Control general scalar aggregate kernel behavior
-///
+/// 
 /// By default, null values are ignored
 class ARROW_EXPORT ScalarAggregateOptions : public FunctionOptions {
  public:
   explicit ScalarAggregateOptions(bool skip_nulls = true, uint32_t min_count = 1);
   constexpr static char const kTypeName[] = "ScalarAggregateOptions";
   static ScalarAggregateOptions Defaults() { return ScalarAggregateOptions{}; }
-
+ 
   bool skip_nulls;
   uint32_t min_count;
 };
-
+ 
 /// \brief Control Mode kernel behavior
 ///
 /// Returns top-n common values and counts.
@@ -62,12 +62,12 @@ class ARROW_EXPORT ModeOptions : public FunctionOptions {
   explicit ModeOptions(int64_t n = 1);
   constexpr static char const kTypeName[] = "ModeOptions";
   static ModeOptions Defaults() { return ModeOptions{}; }
-
+ 
   int64_t n = 1;
-};
-
+}; 
+ 
 /// \brief Control Delta Degrees of Freedom (ddof) of Variance and Stddev kernel
-///
+/// 
 /// The divisor used in calculations is N - ddof, where N is the number of elements.
 /// By default, ddof is zero, and population variance or stddev is returned.
 class ARROW_EXPORT VarianceOptions : public FunctionOptions {
@@ -91,23 +91,23 @@ class ARROW_EXPORT QuantileOptions : public FunctionOptions {
     HIGHER,
     NEAREST,
     MIDPOINT,
-  };
-
+  }; 
+ 
   explicit QuantileOptions(double q = 0.5, enum Interpolation interpolation = LINEAR);
-
+ 
   explicit QuantileOptions(std::vector<double> q,
                            enum Interpolation interpolation = LINEAR);
-
+ 
   constexpr static char const kTypeName[] = "QuantileOptions";
   static QuantileOptions Defaults() { return QuantileOptions{}; }
 
   /// quantile must be between 0 and 1 inclusive
   std::vector<double> q;
   enum Interpolation interpolation;
-};
-
+}; 
+ 
 /// \brief Control TDigest approximate quantile kernel behavior
-///
+/// 
 /// By default, returns the median value.
 class ARROW_EXPORT TDigestOptions : public FunctionOptions {
  public:
@@ -117,7 +117,7 @@ class ARROW_EXPORT TDigestOptions : public FunctionOptions {
                           uint32_t buffer_size = 500);
   constexpr static char const kTypeName[] = "TDigestOptions";
   static TDigestOptions Defaults() { return TDigestOptions{}; }
-
+ 
   /// quantile must be between 0 and 1 inclusive
   std::vector<double> q;
   /// compression parameter, default 100
@@ -125,7 +125,7 @@ class ARROW_EXPORT TDigestOptions : public FunctionOptions {
   /// input buffer size, default 500
   uint32_t buffer_size;
 };
-
+ 
 /// \brief Control Index kernel behavior
 class ARROW_EXPORT IndexOptions : public FunctionOptions {
  public:
@@ -135,73 +135,73 @@ class ARROW_EXPORT IndexOptions : public FunctionOptions {
   constexpr static char const kTypeName[] = "IndexOptions";
 
   std::shared_ptr<Scalar> value;
-};
-
-/// @}
-
-/// \brief Count non-null (or null) values in an array.
-///
+}; 
+ 
+/// @} 
+ 
+/// \brief Count non-null (or null) values in an array. 
+/// 
 /// \param[in] options counting options, see ScalarAggregateOptions for more information
-/// \param[in] datum to count
-/// \param[in] ctx the function execution context, optional
-/// \return out resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
+/// \param[in] datum to count 
+/// \param[in] ctx the function execution context, optional 
+/// \return out resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
 Result<Datum> Count(
     const Datum& datum,
     const ScalarAggregateOptions& options = ScalarAggregateOptions::Defaults(),
     ExecContext* ctx = NULLPTR);
-
-/// \brief Compute the mean of a numeric array.
-///
-/// \param[in] value datum to compute the mean, expecting Array
+ 
+/// \brief Compute the mean of a numeric array. 
+/// 
+/// \param[in] value datum to compute the mean, expecting Array 
 /// \param[in] options see ScalarAggregateOptions for more information
-/// \param[in] ctx the function execution context, optional
-/// \return datum of the computed mean as a DoubleScalar
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
+/// \param[in] ctx the function execution context, optional 
+/// \return datum of the computed mean as a DoubleScalar 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
 Result<Datum> Mean(
     const Datum& value,
     const ScalarAggregateOptions& options = ScalarAggregateOptions::Defaults(),
     ExecContext* ctx = NULLPTR);
-
-/// \brief Sum values of a numeric array.
-///
-/// \param[in] value datum to sum, expecting Array or ChunkedArray
+ 
+/// \brief Sum values of a numeric array. 
+/// 
+/// \param[in] value datum to sum, expecting Array or ChunkedArray 
 /// \param[in] options see ScalarAggregateOptions for more information
-/// \param[in] ctx the function execution context, optional
-/// \return datum of the computed sum as a Scalar
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
+/// \param[in] ctx the function execution context, optional 
+/// \return datum of the computed sum as a Scalar 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
 Result<Datum> Sum(
     const Datum& value,
     const ScalarAggregateOptions& options = ScalarAggregateOptions::Defaults(),
     ExecContext* ctx = NULLPTR);
-
-/// \brief Calculate the min / max of a numeric array
-///
-/// This function returns both the min and max as a struct scalar, with type
-/// struct<min: T, max: T>, where T is the input type
-///
-/// \param[in] value input datum, expecting Array or ChunkedArray
+ 
+/// \brief Calculate the min / max of a numeric array 
+/// 
+/// This function returns both the min and max as a struct scalar, with type 
+/// struct<min: T, max: T>, where T is the input type 
+/// 
+/// \param[in] value input datum, expecting Array or ChunkedArray 
 /// \param[in] options see ScalarAggregateOptions for more information
-/// \param[in] ctx the function execution context, optional
-/// \return resulting datum as a struct<min: T, max: T> scalar
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
+/// \param[in] ctx the function execution context, optional 
+/// \return resulting datum as a struct<min: T, max: T> scalar 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
 Result<Datum> MinMax(
     const Datum& value,
     const ScalarAggregateOptions& options = ScalarAggregateOptions::Defaults(),
     ExecContext* ctx = NULLPTR);
-
+ 
 /// \brief Test whether any element in a boolean array evaluates to true.
 ///
 /// This function returns true if any of the elements in the array evaluates
@@ -244,53 +244,53 @@ Result<Datum> All(
     const ScalarAggregateOptions& options = ScalarAggregateOptions::Defaults(),
     ExecContext* ctx = NULLPTR);
 
-/// \brief Calculate the modal (most common) value of a numeric array
-///
+/// \brief Calculate the modal (most common) value of a numeric array 
+/// 
 /// This function returns top-n most common values and number of times they occur as
 /// an array of `struct<mode: T, count: int64>`, where T is the input type.
 /// Values with larger counts are returned before smaller ones.
 /// If there are more than one values with same count, smaller value is returned first.
-///
-/// \param[in] value input datum, expecting Array or ChunkedArray
+/// 
+/// \param[in] value input datum, expecting Array or ChunkedArray 
 /// \param[in] options see ModeOptions for more information
-/// \param[in] ctx the function execution context, optional
+/// \param[in] ctx the function execution context, optional 
 /// \return resulting datum as an array of struct<mode: T, count: int64>
-///
-/// \since 2.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
+/// 
+/// \since 2.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
 Result<Datum> Mode(const Datum& value,
                    const ModeOptions& options = ModeOptions::Defaults(),
                    ExecContext* ctx = NULLPTR);
-
-/// \brief Calculate the standard deviation of a numeric array
-///
-/// \param[in] value input datum, expecting Array or ChunkedArray
-/// \param[in] options see VarianceOptions for more information
-/// \param[in] ctx the function execution context, optional
-/// \return datum of the computed standard deviation as a DoubleScalar
-///
-/// \since 2.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> Stddev(const Datum& value,
-                     const VarianceOptions& options = VarianceOptions::Defaults(),
-                     ExecContext* ctx = NULLPTR);
-
-/// \brief Calculate the variance of a numeric array
-///
-/// \param[in] value input datum, expecting Array or ChunkedArray
-/// \param[in] options see VarianceOptions for more information
-/// \param[in] ctx the function execution context, optional
-/// \return datum of the computed variance as a DoubleScalar
-///
-/// \since 2.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> Variance(const Datum& value,
-                       const VarianceOptions& options = VarianceOptions::Defaults(),
-                       ExecContext* ctx = NULLPTR);
-
+ 
+/// \brief Calculate the standard deviation of a numeric array 
+/// 
+/// \param[in] value input datum, expecting Array or ChunkedArray 
+/// \param[in] options see VarianceOptions for more information 
+/// \param[in] ctx the function execution context, optional 
+/// \return datum of the computed standard deviation as a DoubleScalar 
+/// 
+/// \since 2.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> Stddev(const Datum& value, 
+                     const VarianceOptions& options = VarianceOptions::Defaults(), 
+                     ExecContext* ctx = NULLPTR); 
+ 
+/// \brief Calculate the variance of a numeric array 
+/// 
+/// \param[in] value input datum, expecting Array or ChunkedArray 
+/// \param[in] options see VarianceOptions for more information 
+/// \param[in] ctx the function execution context, optional 
+/// \return datum of the computed variance as a DoubleScalar 
+/// 
+/// \since 2.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> Variance(const Datum& value, 
+                       const VarianceOptions& options = VarianceOptions::Defaults(), 
+                       ExecContext* ctx = NULLPTR); 
+ 
 /// \brief Calculate the quantiles of a numeric array
 ///
 /// \param[in] value input datum, expecting Array or ChunkedArray
@@ -429,5 +429,5 @@ Result<Datum> GroupBy(const std::vector<Datum>& arguments, const std::vector<Dat
                       ExecContext* ctx = default_exec_context());
 
 }  // namespace internal
-}  // namespace compute
-}  // namespace arrow
+}  // namespace compute 
+}  // namespace arrow 

+ 123 - 123
contrib/libs/apache/arrow/cpp/src/arrow/compute/api_scalar.cc

@@ -1,37 +1,37 @@
-// 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.
-
-#include "arrow/compute/api_scalar.h"
-
-#include <memory>
-#include <sstream>
-#include <string>
-
+// 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. 
+ 
+#include "arrow/compute/api_scalar.h" 
+ 
+#include <memory> 
+#include <sstream> 
+#include <string> 
+ 
 #include "arrow/array/array_base.h"
-#include "arrow/compute/exec.h"
+#include "arrow/compute/exec.h" 
 #include "arrow/compute/function_internal.h"
 #include "arrow/compute/registry.h"
 #include "arrow/compute/util_internal.h"
-#include "arrow/status.h"
-#include "arrow/type.h"
+#include "arrow/status.h" 
+#include "arrow/type.h" 
 #include "arrow/util/checked_cast.h"
 #include "arrow/util/logging.h"
-
-namespace arrow {
+ 
+namespace arrow { 
 
 namespace internal {
 template <>
@@ -100,8 +100,8 @@ struct EnumTraits<compute::CompareOperator>
 };
 }  // namespace internal
 
-namespace compute {
-
+namespace compute { 
+ 
 // ----------------------------------------------------------------------
 // Function options
 
@@ -302,19 +302,19 @@ void RegisterScalarOptions(FunctionRegistry* registry) {
 }
 }  // namespace internal
 
-#define SCALAR_EAGER_UNARY(NAME, REGISTRY_NAME)              \
-  Result<Datum> NAME(const Datum& value, ExecContext* ctx) { \
-    return CallFunction(REGISTRY_NAME, {value}, ctx);        \
-  }
-
-#define SCALAR_EAGER_BINARY(NAME, REGISTRY_NAME)                                \
-  Result<Datum> NAME(const Datum& left, const Datum& right, ExecContext* ctx) { \
-    return CallFunction(REGISTRY_NAME, {left, right}, ctx);                     \
-  }
-
-// ----------------------------------------------------------------------
-// Arithmetic
-
+#define SCALAR_EAGER_UNARY(NAME, REGISTRY_NAME)              \ 
+  Result<Datum> NAME(const Datum& value, ExecContext* ctx) { \ 
+    return CallFunction(REGISTRY_NAME, {value}, ctx);        \ 
+  } 
+ 
+#define SCALAR_EAGER_BINARY(NAME, REGISTRY_NAME)                                \ 
+  Result<Datum> NAME(const Datum& left, const Datum& right, ExecContext* ctx) { \ 
+    return CallFunction(REGISTRY_NAME, {left, right}, ctx);                     \ 
+  } 
+ 
+// ---------------------------------------------------------------------- 
+// Arithmetic 
+ 
 #define SCALAR_ARITHMETIC_UNARY(NAME, REGISTRY_NAME, REGISTRY_CHECKED_NAME)            \
   Result<Datum> NAME(const Datum& arg, ArithmeticOptions options, ExecContext* ctx) {  \
     auto func_name = (options.check_overflow) ? REGISTRY_CHECKED_NAME : REGISTRY_NAME; \
@@ -335,17 +335,17 @@ SCALAR_ARITHMETIC_UNARY(Log10, "log10", "log10_checked")
 SCALAR_ARITHMETIC_UNARY(Log2, "log2", "log2_checked")
 SCALAR_ARITHMETIC_UNARY(Log1p, "log1p", "log1p_checked")
 
-#define SCALAR_ARITHMETIC_BINARY(NAME, REGISTRY_NAME, REGISTRY_CHECKED_NAME)           \
-  Result<Datum> NAME(const Datum& left, const Datum& right, ArithmeticOptions options, \
-                     ExecContext* ctx) {                                               \
-    auto func_name = (options.check_overflow) ? REGISTRY_CHECKED_NAME : REGISTRY_NAME; \
-    return CallFunction(func_name, {left, right}, ctx);                                \
-  }
-
-SCALAR_ARITHMETIC_BINARY(Add, "add", "add_checked")
-SCALAR_ARITHMETIC_BINARY(Subtract, "subtract", "subtract_checked")
-SCALAR_ARITHMETIC_BINARY(Multiply, "multiply", "multiply_checked")
-SCALAR_ARITHMETIC_BINARY(Divide, "divide", "divide_checked")
+#define SCALAR_ARITHMETIC_BINARY(NAME, REGISTRY_NAME, REGISTRY_CHECKED_NAME)           \ 
+  Result<Datum> NAME(const Datum& left, const Datum& right, ArithmeticOptions options, \ 
+                     ExecContext* ctx) {                                               \ 
+    auto func_name = (options.check_overflow) ? REGISTRY_CHECKED_NAME : REGISTRY_NAME; \ 
+    return CallFunction(func_name, {left, right}, ctx);                                \ 
+  } 
+ 
+SCALAR_ARITHMETIC_BINARY(Add, "add", "add_checked") 
+SCALAR_ARITHMETIC_BINARY(Subtract, "subtract", "subtract_checked") 
+SCALAR_ARITHMETIC_BINARY(Multiply, "multiply", "multiply_checked") 
+SCALAR_ARITHMETIC_BINARY(Divide, "divide", "divide_checked") 
 SCALAR_ARITHMETIC_BINARY(Power, "power", "power_checked")
 SCALAR_ARITHMETIC_BINARY(ShiftLeft, "shift_left", "shift_left_checked")
 SCALAR_ARITHMETIC_BINARY(ShiftRight, "shift_right", "shift_right_checked")
@@ -353,7 +353,7 @@ SCALAR_EAGER_BINARY(Atan2, "atan2")
 SCALAR_EAGER_UNARY(Floor, "floor")
 SCALAR_EAGER_UNARY(Ceil, "ceil")
 SCALAR_EAGER_UNARY(Trunc, "trunc")
-
+ 
 Result<Datum> MaxElementWise(const std::vector<Datum>& args,
                              ElementWiseAggregateOptions options, ExecContext* ctx) {
   return CallFunction("max_element_wise", args, &options, ctx);
@@ -364,14 +364,14 @@ Result<Datum> MinElementWise(const std::vector<Datum>& args,
   return CallFunction("min_element_wise", args, &options, ctx);
 }
 
-// ----------------------------------------------------------------------
-// Set-related operations
-
-static Result<Datum> ExecSetLookup(const std::string& func_name, const Datum& data,
+// ---------------------------------------------------------------------- 
+// Set-related operations 
+ 
+static Result<Datum> ExecSetLookup(const std::string& func_name, const Datum& data, 
                                    const SetLookupOptions& options, ExecContext* ctx) {
   if (!options.value_set.is_arraylike()) {
-    return Status::Invalid("Set lookup value set must be Array or ChunkedArray");
-  }
+    return Status::Invalid("Set lookup value set must be Array or ChunkedArray"); 
+  } 
   std::shared_ptr<DataType> data_type;
   if (data.type()->id() == Type::DICTIONARY) {
     data_type =
@@ -379,85 +379,85 @@ static Result<Datum> ExecSetLookup(const std::string& func_name, const Datum& da
   } else {
     data_type = data.type();
   }
-
+ 
   if (options.value_set.length() > 0 && !data_type->Equals(options.value_set.type())) {
-    std::stringstream ss;
+    std::stringstream ss; 
     ss << "Array type didn't match type of values set: " << data_type->ToString()
        << " vs " << options.value_set.type()->ToString();
-    return Status::Invalid(ss.str());
-  }
-  return CallFunction(func_name, {data}, &options, ctx);
-}
-
+    return Status::Invalid(ss.str()); 
+  } 
+  return CallFunction(func_name, {data}, &options, ctx); 
+} 
+ 
 Result<Datum> IsIn(const Datum& values, const SetLookupOptions& options,
                    ExecContext* ctx) {
   return ExecSetLookup("is_in", values, options, ctx);
 }
 
-Result<Datum> IsIn(const Datum& values, const Datum& value_set, ExecContext* ctx) {
+Result<Datum> IsIn(const Datum& values, const Datum& value_set, ExecContext* ctx) { 
   return ExecSetLookup("is_in", values, SetLookupOptions{value_set}, ctx);
-}
-
+} 
+ 
 Result<Datum> IndexIn(const Datum& values, const SetLookupOptions& options,
                       ExecContext* ctx) {
   return ExecSetLookup("index_in", values, options, ctx);
 }
 
-Result<Datum> IndexIn(const Datum& values, const Datum& value_set, ExecContext* ctx) {
+Result<Datum> IndexIn(const Datum& values, const Datum& value_set, ExecContext* ctx) { 
   return ExecSetLookup("index_in", values, SetLookupOptions{value_set}, ctx);
-}
-
-// ----------------------------------------------------------------------
-// Boolean functions
-
-SCALAR_EAGER_UNARY(Invert, "invert")
-SCALAR_EAGER_BINARY(And, "and")
-SCALAR_EAGER_BINARY(KleeneAnd, "and_kleene")
-SCALAR_EAGER_BINARY(Or, "or")
-SCALAR_EAGER_BINARY(KleeneOr, "or_kleene")
-SCALAR_EAGER_BINARY(Xor, "xor")
+} 
+ 
+// ---------------------------------------------------------------------- 
+// Boolean functions 
+ 
+SCALAR_EAGER_UNARY(Invert, "invert") 
+SCALAR_EAGER_BINARY(And, "and") 
+SCALAR_EAGER_BINARY(KleeneAnd, "and_kleene") 
+SCALAR_EAGER_BINARY(Or, "or") 
+SCALAR_EAGER_BINARY(KleeneOr, "or_kleene") 
+SCALAR_EAGER_BINARY(Xor, "xor") 
 SCALAR_EAGER_BINARY(AndNot, "and_not")
 SCALAR_EAGER_BINARY(KleeneAndNot, "and_not_kleene")
-
-// ----------------------------------------------------------------------
-
-Result<Datum> Compare(const Datum& left, const Datum& right, CompareOptions options,
-                      ExecContext* ctx) {
-  std::string func_name;
-  switch (options.op) {
-    case CompareOperator::EQUAL:
-      func_name = "equal";
-      break;
-    case CompareOperator::NOT_EQUAL:
-      func_name = "not_equal";
-      break;
-    case CompareOperator::GREATER:
-      func_name = "greater";
-      break;
-    case CompareOperator::GREATER_EQUAL:
-      func_name = "greater_equal";
-      break;
-    case CompareOperator::LESS:
-      func_name = "less";
-      break;
-    case CompareOperator::LESS_EQUAL:
-      func_name = "less_equal";
-      break;
-  }
+ 
+// ---------------------------------------------------------------------- 
+ 
+Result<Datum> Compare(const Datum& left, const Datum& right, CompareOptions options, 
+                      ExecContext* ctx) { 
+  std::string func_name; 
+  switch (options.op) { 
+    case CompareOperator::EQUAL: 
+      func_name = "equal"; 
+      break; 
+    case CompareOperator::NOT_EQUAL: 
+      func_name = "not_equal"; 
+      break; 
+    case CompareOperator::GREATER: 
+      func_name = "greater"; 
+      break; 
+    case CompareOperator::GREATER_EQUAL: 
+      func_name = "greater_equal"; 
+      break; 
+    case CompareOperator::LESS: 
+      func_name = "less"; 
+      break; 
+    case CompareOperator::LESS_EQUAL: 
+      func_name = "less_equal"; 
+      break; 
+  } 
   return CallFunction(func_name, {left, right}, nullptr, ctx);
-}
-
-// ----------------------------------------------------------------------
-// Validity functions
-
-SCALAR_EAGER_UNARY(IsValid, "is_valid")
-SCALAR_EAGER_UNARY(IsNull, "is_null")
+} 
+ 
+// ---------------------------------------------------------------------- 
+// Validity functions 
+ 
+SCALAR_EAGER_UNARY(IsValid, "is_valid") 
+SCALAR_EAGER_UNARY(IsNull, "is_null") 
 SCALAR_EAGER_UNARY(IsNan, "is_nan")
-
-Result<Datum> FillNull(const Datum& values, const Datum& fill_value, ExecContext* ctx) {
-  return CallFunction("fill_null", {values, fill_value}, ctx);
-}
-
+ 
+Result<Datum> FillNull(const Datum& values, const Datum& fill_value, ExecContext* ctx) { 
+  return CallFunction("fill_null", {values, fill_value}, ctx); 
+} 
+ 
 Result<Datum> IfElse(const Datum& cond, const Datum& if_true, const Datum& if_false,
                      ExecContext* ctx) {
   return CallFunction("if_else", {cond, if_true, if_false}, ctx);
@@ -494,5 +494,5 @@ Result<Datum> DayOfWeek(const Datum& arg, DayOfWeekOptions options, ExecContext*
   return CallFunction("day_of_week", {arg}, &options, ctx);
 }
 
-}  // namespace compute
-}  // namespace arrow
+}  // namespace compute 
+}  // namespace arrow 

+ 285 - 285
contrib/libs/apache/arrow/cpp/src/arrow/compute/api_scalar.h

@@ -1,55 +1,55 @@
-// 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.
-
-// Eager evaluation convenience APIs for invoking common functions, including
-// necessary memory allocations
-
-#pragma once
-
-#include <string>
-#include <utility>
-
-#include "arrow/compute/exec.h"  // IWYU pragma: keep
-#include "arrow/compute/function.h"
-#include "arrow/datum.h"
-#include "arrow/result.h"
-#include "arrow/util/macros.h"
-#include "arrow/util/visibility.h"
-
-namespace arrow {
-namespace compute {
-
-/// \addtogroup compute-concrete-options
-///
-/// @{
-
+// 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. 
+ 
+// Eager evaluation convenience APIs for invoking common functions, including 
+// necessary memory allocations 
+ 
+#pragma once 
+ 
+#include <string> 
+#include <utility> 
+ 
+#include "arrow/compute/exec.h"  // IWYU pragma: keep 
+#include "arrow/compute/function.h" 
+#include "arrow/datum.h" 
+#include "arrow/result.h" 
+#include "arrow/util/macros.h" 
+#include "arrow/util/visibility.h" 
+ 
+namespace arrow { 
+namespace compute { 
+ 
+/// \addtogroup compute-concrete-options 
+/// 
+/// @{ 
+ 
 class ARROW_EXPORT ArithmeticOptions : public FunctionOptions {
  public:
   explicit ArithmeticOptions(bool check_overflow = false);
   constexpr static char const kTypeName[] = "ArithmeticOptions";
-  bool check_overflow;
-};
-
+  bool check_overflow; 
+}; 
+ 
 class ARROW_EXPORT ElementWiseAggregateOptions : public FunctionOptions {
  public:
   explicit ElementWiseAggregateOptions(bool skip_nulls = true);
   constexpr static char const kTypeName[] = "ElementWiseAggregateOptions";
   static ElementWiseAggregateOptions Defaults() { return ElementWiseAggregateOptions{}; }
-
+ 
   bool skip_nulls;
 };
 
@@ -80,11 +80,11 @@ class ARROW_EXPORT MatchSubstringOptions : public FunctionOptions {
   constexpr static char const kTypeName[] = "MatchSubstringOptions";
 
   /// The exact substring (or regex, depending on kernel) to look for inside input values.
-  std::string pattern;
+  std::string pattern; 
   /// Whether to perform a case-insensitive match.
   bool ignore_case = false;
-};
-
+}; 
+ 
 class ARROW_EXPORT SplitOptions : public FunctionOptions {
  public:
   explicit SplitOptions(int64_t max_splits = -1, bool reverse = false);
@@ -150,34 +150,34 @@ class ARROW_EXPORT ExtractRegexOptions : public FunctionOptions {
   std::string pattern;
 };
 
-/// Options for IsIn and IndexIn functions
+/// Options for IsIn and IndexIn functions 
 class ARROW_EXPORT SetLookupOptions : public FunctionOptions {
  public:
   explicit SetLookupOptions(Datum value_set, bool skip_nulls = false);
   SetLookupOptions();
   constexpr static char const kTypeName[] = "SetLookupOptions";
-
-  /// The set of values to look up input values into.
-  Datum value_set;
-  /// Whether nulls in `value_set` count for lookup.
-  ///
-  /// If true, any null in `value_set` is ignored and nulls in the input
-  /// produce null (IndexIn) or false (IsIn) values in the output.
-  /// If false, any null in `value_set` is successfully matched in
-  /// the input.
-  bool skip_nulls;
-};
-
+ 
+  /// The set of values to look up input values into. 
+  Datum value_set; 
+  /// Whether nulls in `value_set` count for lookup. 
+  /// 
+  /// If true, any null in `value_set` is ignored and nulls in the input 
+  /// produce null (IndexIn) or false (IsIn) values in the output. 
+  /// If false, any null in `value_set` is successfully matched in 
+  /// the input. 
+  bool skip_nulls; 
+}; 
+ 
 class ARROW_EXPORT StrptimeOptions : public FunctionOptions {
  public:
   explicit StrptimeOptions(std::string format, TimeUnit::type unit);
   StrptimeOptions();
   constexpr static char const kTypeName[] = "StrptimeOptions";
-
-  std::string format;
-  TimeUnit::type unit;
-};
-
+ 
+  std::string format; 
+  TimeUnit::type unit; 
+}; 
+ 
 class ARROW_EXPORT PadOptions : public FunctionOptions {
  public:
   explicit PadOptions(int64_t width, std::string padding = " ");
@@ -209,21 +209,21 @@ class ARROW_EXPORT SliceOptions : public FunctionOptions {
   int64_t start, stop, step;
 };
 
-enum CompareOperator : int8_t {
-  EQUAL,
-  NOT_EQUAL,
-  GREATER,
-  GREATER_EQUAL,
-  LESS,
-  LESS_EQUAL,
-};
-
+enum CompareOperator : int8_t { 
+  EQUAL, 
+  NOT_EQUAL, 
+  GREATER, 
+  GREATER_EQUAL, 
+  LESS, 
+  LESS_EQUAL, 
+}; 
+ 
 struct ARROW_EXPORT CompareOptions {
-  explicit CompareOptions(CompareOperator op) : op(op) {}
+  explicit CompareOptions(CompareOperator op) : op(op) {} 
   CompareOptions() : CompareOptions(CompareOperator::EQUAL) {}
-  enum CompareOperator op;
-};
-
+  enum CompareOperator op; 
+}; 
+ 
 class ARROW_EXPORT MakeStructOptions : public FunctionOptions {
  public:
   MakeStructOptions(std::vector<std::string> n, std::vector<bool> r,
@@ -254,8 +254,8 @@ struct ARROW_EXPORT DayOfWeekOptions : public FunctionOptions {
   uint32_t week_start;
 };
 
-/// @}
-
+/// @} 
+ 
 /// \brief Get the absolute value of a value.
 ///
 /// If argument is null the result will be null.
@@ -269,59 +269,59 @@ Result<Datum> AbsoluteValue(const Datum& arg,
                             ArithmeticOptions options = ArithmeticOptions(),
                             ExecContext* ctx = NULLPTR);
 
-/// \brief Add two values together. Array values must be the same length. If
-/// either addend is null the result will be null.
-///
-/// \param[in] left the first addend
-/// \param[in] right the second addend
-/// \param[in] options arithmetic options (overflow handling), optional
-/// \param[in] ctx the function execution context, optional
-/// \return the elementwise sum
-ARROW_EXPORT
-Result<Datum> Add(const Datum& left, const Datum& right,
-                  ArithmeticOptions options = ArithmeticOptions(),
-                  ExecContext* ctx = NULLPTR);
-
-/// \brief Subtract two values. Array values must be the same length. If the
-/// minuend or subtrahend is null the result will be null.
-///
-/// \param[in] left the value subtracted from (minuend)
-/// \param[in] right the value by which the minuend is reduced (subtrahend)
-/// \param[in] options arithmetic options (overflow handling), optional
-/// \param[in] ctx the function execution context, optional
-/// \return the elementwise difference
-ARROW_EXPORT
-Result<Datum> Subtract(const Datum& left, const Datum& right,
-                       ArithmeticOptions options = ArithmeticOptions(),
-                       ExecContext* ctx = NULLPTR);
-
-/// \brief Multiply two values. Array values must be the same length. If either
-/// factor is null the result will be null.
-///
-/// \param[in] left the first factor
-/// \param[in] right the second factor
-/// \param[in] options arithmetic options (overflow handling), optional
-/// \param[in] ctx the function execution context, optional
-/// \return the elementwise product
-ARROW_EXPORT
-Result<Datum> Multiply(const Datum& left, const Datum& right,
-                       ArithmeticOptions options = ArithmeticOptions(),
-                       ExecContext* ctx = NULLPTR);
-
-/// \brief Divide two values. Array values must be the same length. If either
-/// argument is null the result will be null. For integer types, if there is
-/// a zero divisor, an error will be raised.
-///
-/// \param[in] left the dividend
-/// \param[in] right the divisor
-/// \param[in] options arithmetic options (enable/disable overflow checking), optional
-/// \param[in] ctx the function execution context, optional
-/// \return the elementwise quotient
-ARROW_EXPORT
-Result<Datum> Divide(const Datum& left, const Datum& right,
-                     ArithmeticOptions options = ArithmeticOptions(),
-                     ExecContext* ctx = NULLPTR);
-
+/// \brief Add two values together. Array values must be the same length. If 
+/// either addend is null the result will be null. 
+/// 
+/// \param[in] left the first addend 
+/// \param[in] right the second addend 
+/// \param[in] options arithmetic options (overflow handling), optional 
+/// \param[in] ctx the function execution context, optional 
+/// \return the elementwise sum 
+ARROW_EXPORT 
+Result<Datum> Add(const Datum& left, const Datum& right, 
+                  ArithmeticOptions options = ArithmeticOptions(), 
+                  ExecContext* ctx = NULLPTR); 
+ 
+/// \brief Subtract two values. Array values must be the same length. If the 
+/// minuend or subtrahend is null the result will be null. 
+/// 
+/// \param[in] left the value subtracted from (minuend) 
+/// \param[in] right the value by which the minuend is reduced (subtrahend) 
+/// \param[in] options arithmetic options (overflow handling), optional 
+/// \param[in] ctx the function execution context, optional 
+/// \return the elementwise difference 
+ARROW_EXPORT 
+Result<Datum> Subtract(const Datum& left, const Datum& right, 
+                       ArithmeticOptions options = ArithmeticOptions(), 
+                       ExecContext* ctx = NULLPTR); 
+ 
+/// \brief Multiply two values. Array values must be the same length. If either 
+/// factor is null the result will be null. 
+/// 
+/// \param[in] left the first factor 
+/// \param[in] right the second factor 
+/// \param[in] options arithmetic options (overflow handling), optional 
+/// \param[in] ctx the function execution context, optional 
+/// \return the elementwise product 
+ARROW_EXPORT 
+Result<Datum> Multiply(const Datum& left, const Datum& right, 
+                       ArithmeticOptions options = ArithmeticOptions(), 
+                       ExecContext* ctx = NULLPTR); 
+ 
+/// \brief Divide two values. Array values must be the same length. If either 
+/// argument is null the result will be null. For integer types, if there is 
+/// a zero divisor, an error will be raised. 
+/// 
+/// \param[in] left the dividend 
+/// \param[in] right the divisor 
+/// \param[in] options arithmetic options (enable/disable overflow checking), optional 
+/// \param[in] ctx the function execution context, optional 
+/// \return the elementwise quotient 
+ARROW_EXPORT 
+Result<Datum> Divide(const Datum& left, const Datum& right, 
+                     ArithmeticOptions options = ArithmeticOptions(), 
+                     ExecContext* ctx = NULLPTR); 
+ 
 /// \brief Negate values.
 ///
 /// If argument is null the result will be null.
@@ -549,98 +549,98 @@ Result<Datum> MinElementWise(
 ARROW_EXPORT
 Result<Datum> Sign(const Datum& arg, ExecContext* ctx = NULLPTR);
 
-/// \brief Compare a numeric array with a scalar.
-///
-/// \param[in] left datum to compare, must be an Array
-/// \param[in] right datum to compare, must be a Scalar of the same type than
-///            left Datum.
-/// \param[in] options compare options
-/// \param[in] ctx the function execution context, optional
-/// \return resulting datum
-///
-/// Note on floating point arrays, this uses ieee-754 compare semantics.
-///
-/// \since 1.0.0
-/// \note API not yet finalized
+/// \brief Compare a numeric array with a scalar. 
+/// 
+/// \param[in] left datum to compare, must be an Array 
+/// \param[in] right datum to compare, must be a Scalar of the same type than 
+///            left Datum. 
+/// \param[in] options compare options 
+/// \param[in] ctx the function execution context, optional 
+/// \return resulting datum 
+/// 
+/// Note on floating point arrays, this uses ieee-754 compare semantics. 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
 ARROW_DEPRECATED("Deprecated in 5.0.0. Use each compare function directly")
-ARROW_EXPORT
+ARROW_EXPORT 
 Result<Datum> Compare(const Datum& left, const Datum& right, CompareOptions options,
                       ExecContext* ctx = NULLPTR);
-
-/// \brief Invert the values of a boolean datum
-/// \param[in] value datum to invert
-/// \param[in] ctx the function execution context, optional
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> Invert(const Datum& value, ExecContext* ctx = NULLPTR);
-
-/// \brief Element-wise AND of two boolean datums which always propagates nulls
-/// (null and false is null).
-///
+ 
+/// \brief Invert the values of a boolean datum 
+/// \param[in] value datum to invert 
+/// \param[in] ctx the function execution context, optional 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> Invert(const Datum& value, ExecContext* ctx = NULLPTR); 
+ 
+/// \brief Element-wise AND of two boolean datums which always propagates nulls 
+/// (null and false is null). 
+/// 
 /// \param[in] left left operand
 /// \param[in] right right operand
-/// \param[in] ctx the function execution context, optional
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> And(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR);
-
-/// \brief Element-wise AND of two boolean datums with a Kleene truth table
-/// (null and false is false).
-///
+/// \param[in] ctx the function execution context, optional 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> And(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR); 
+ 
+/// \brief Element-wise AND of two boolean datums with a Kleene truth table 
+/// (null and false is false). 
+/// 
 /// \param[in] left left operand
 /// \param[in] right right operand
-/// \param[in] ctx the function execution context, optional
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> KleeneAnd(const Datum& left, const Datum& right,
-                        ExecContext* ctx = NULLPTR);
-
-/// \brief Element-wise OR of two boolean datums which always propagates nulls
-/// (null and true is null).
-///
+/// \param[in] ctx the function execution context, optional 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> KleeneAnd(const Datum& left, const Datum& right, 
+                        ExecContext* ctx = NULLPTR); 
+ 
+/// \brief Element-wise OR of two boolean datums which always propagates nulls 
+/// (null and true is null). 
+/// 
 /// \param[in] left left operand
 /// \param[in] right right operand
-/// \param[in] ctx the function execution context, optional
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> Or(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR);
-
-/// \brief Element-wise OR of two boolean datums with a Kleene truth table
-/// (null or true is true).
-///
+/// \param[in] ctx the function execution context, optional 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> Or(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR); 
+ 
+/// \brief Element-wise OR of two boolean datums with a Kleene truth table 
+/// (null or true is true). 
+/// 
 /// \param[in] left left operand
 /// \param[in] right right operand
-/// \param[in] ctx the function execution context, optional
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> KleeneOr(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR);
-
-/// \brief Element-wise XOR of two boolean datums
+/// \param[in] ctx the function execution context, optional 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> KleeneOr(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR); 
+ 
+/// \brief Element-wise XOR of two boolean datums 
 /// \param[in] left left operand
 /// \param[in] right right operand
-/// \param[in] ctx the function execution context, optional
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> Xor(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR);
-
+/// \param[in] ctx the function execution context, optional 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> Xor(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR); 
+ 
 /// \brief Element-wise AND NOT of two boolean datums which always propagates nulls
 /// (null and not true is null).
 ///
@@ -668,73 +668,73 @@ ARROW_EXPORT
 Result<Datum> KleeneAndNot(const Datum& left, const Datum& right,
                            ExecContext* ctx = NULLPTR);
 
-/// \brief IsIn returns true for each element of `values` that is contained in
-/// `value_set`
-///
+/// \brief IsIn returns true for each element of `values` that is contained in 
+/// `value_set` 
+/// 
 /// Behaviour of nulls is governed by SetLookupOptions::skip_nulls.
-///
-/// \param[in] values array-like input to look up in value_set
+/// 
+/// \param[in] values array-like input to look up in value_set 
 /// \param[in] options SetLookupOptions
-/// \param[in] ctx the function execution context, optional
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
+/// \param[in] ctx the function execution context, optional 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
 Result<Datum> IsIn(const Datum& values, const SetLookupOptions& options,
                    ExecContext* ctx = NULLPTR);
 ARROW_EXPORT
-Result<Datum> IsIn(const Datum& values, const Datum& value_set,
-                   ExecContext* ctx = NULLPTR);
-
-/// \brief IndexIn examines each slot in the values against a value_set array.
-/// If the value is not found in value_set, null will be output.
-/// If found, the index of occurrence within value_set (ignoring duplicates)
-/// will be output.
-///
-/// For example given values = [99, 42, 3, null] and
-/// value_set = [3, 3, 99], the output will be = [1, null, 0, null]
-///
+Result<Datum> IsIn(const Datum& values, const Datum& value_set, 
+                   ExecContext* ctx = NULLPTR); 
+ 
+/// \brief IndexIn examines each slot in the values against a value_set array. 
+/// If the value is not found in value_set, null will be output. 
+/// If found, the index of occurrence within value_set (ignoring duplicates) 
+/// will be output. 
+/// 
+/// For example given values = [99, 42, 3, null] and 
+/// value_set = [3, 3, 99], the output will be = [1, null, 0, null] 
+/// 
 /// Behaviour of nulls is governed by SetLookupOptions::skip_nulls.
-///
-/// \param[in] values array-like input
+/// 
+/// \param[in] values array-like input 
 /// \param[in] options SetLookupOptions
-/// \param[in] ctx the function execution context, optional
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
+/// \param[in] ctx the function execution context, optional 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
 Result<Datum> IndexIn(const Datum& values, const SetLookupOptions& options,
                       ExecContext* ctx = NULLPTR);
 ARROW_EXPORT
-Result<Datum> IndexIn(const Datum& values, const Datum& value_set,
-                      ExecContext* ctx = NULLPTR);
-
-/// \brief IsValid returns true for each element of `values` that is not null,
-/// false otherwise
-///
-/// \param[in] values input to examine for validity
-/// \param[in] ctx the function execution context, optional
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> IsValid(const Datum& values, ExecContext* ctx = NULLPTR);
-
-/// \brief IsNull returns true for each element of `values` that is null,
-/// false otherwise
-///
-/// \param[in] values input to examine for nullity
-/// \param[in] ctx the function execution context, optional
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> IsNull(const Datum& values, ExecContext* ctx = NULLPTR);
-
+Result<Datum> IndexIn(const Datum& values, const Datum& value_set, 
+                      ExecContext* ctx = NULLPTR); 
+ 
+/// \brief IsValid returns true for each element of `values` that is not null, 
+/// false otherwise 
+/// 
+/// \param[in] values input to examine for validity 
+/// \param[in] ctx the function execution context, optional 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> IsValid(const Datum& values, ExecContext* ctx = NULLPTR); 
+ 
+/// \brief IsNull returns true for each element of `values` that is null, 
+/// false otherwise 
+/// 
+/// \param[in] values input to examine for nullity 
+/// \param[in] ctx the function execution context, optional 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> IsNull(const Datum& values, ExecContext* ctx = NULLPTR); 
+ 
 /// \brief IsNan returns true for each element of `values` that is NaN,
 /// false otherwise
 ///
@@ -747,21 +747,21 @@ Result<Datum> IsNull(const Datum& values, ExecContext* ctx = NULLPTR);
 ARROW_EXPORT
 Result<Datum> IsNan(const Datum& values, ExecContext* ctx = NULLPTR);
 
-/// \brief FillNull replaces each null element in `values`
-/// with `fill_value`
-///
-/// \param[in] values input to examine for nullity
-/// \param[in] fill_value scalar
-/// \param[in] ctx the function execution context, optional
-///
-/// \return the resulting datum
-///
-/// \since 1.0.0
-/// \note API not yet finalized
-ARROW_EXPORT
-Result<Datum> FillNull(const Datum& values, const Datum& fill_value,
-                       ExecContext* ctx = NULLPTR);
-
+/// \brief FillNull replaces each null element in `values` 
+/// with `fill_value` 
+/// 
+/// \param[in] values input to examine for nullity 
+/// \param[in] fill_value scalar 
+/// \param[in] ctx the function execution context, optional 
+/// 
+/// \return the resulting datum 
+/// 
+/// \since 1.0.0 
+/// \note API not yet finalized 
+ARROW_EXPORT 
+Result<Datum> FillNull(const Datum& values, const Datum& fill_value, 
+                       ExecContext* ctx = NULLPTR); 
+ 
 /// \brief IfElse returns elements chosen from `left` or `right`
 /// depending on `cond`. `null` values in `cond` will be promoted to the result
 ///
@@ -985,5 +985,5 @@ Result<Datum> Nanosecond(const Datum& values, ExecContext* ctx = NULLPTR);
 /// \note API not yet finalized
 ARROW_EXPORT Result<Datum> Subsecond(const Datum& values, ExecContext* ctx = NULLPTR);
 
-}  // namespace compute
-}  // namespace arrow
+}  // namespace compute 
+}  // namespace arrow 

Some files were not shown because too many files changed in this diff