![]() |
|
|||
File indexing completed on 2025-08-28 08:26:56
0001 // Licensed to the Apache Software Foundation (ASF) under one 0002 // or more contributor license agreements. See the NOTICE file 0003 // distributed with this work for additional information 0004 // regarding copyright ownership. The ASF licenses this file 0005 // to you under the Apache License, Version 2.0 (the 0006 // "License"); you may not use this file except in compliance 0007 // with the License. You may obtain a copy of the License at 0008 // 0009 // http://www.apache.org/licenses/LICENSE-2.0 0010 // 0011 // Unless required by applicable law or agreed to in writing, 0012 // software distributed under the License is distributed on an 0013 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 0014 // KIND, either express or implied. See the License for the 0015 // specific language governing permissions and limitations 0016 // under the License. 0017 0018 // Eager evaluation convenience APIs for invoking common functions, including 0019 // necessary memory allocations 0020 0021 #pragma once 0022 0023 #include <optional> 0024 #include <string> 0025 #include <utility> 0026 0027 #include "arrow/compute/function_options.h" 0028 #include "arrow/compute/type_fwd.h" 0029 #include "arrow/datum.h" 0030 #include "arrow/result.h" 0031 #include "arrow/util/macros.h" 0032 #include "arrow/util/visibility.h" 0033 0034 namespace arrow { 0035 namespace compute { 0036 0037 /// \addtogroup compute-concrete-options 0038 /// 0039 /// @{ 0040 0041 class ARROW_EXPORT ArithmeticOptions : public FunctionOptions { 0042 public: 0043 explicit ArithmeticOptions(bool check_overflow = false); 0044 static constexpr char const kTypeName[] = "ArithmeticOptions"; 0045 bool check_overflow; 0046 }; 0047 0048 class ARROW_EXPORT ElementWiseAggregateOptions : public FunctionOptions { 0049 public: 0050 explicit ElementWiseAggregateOptions(bool skip_nulls = true); 0051 static constexpr char const kTypeName[] = "ElementWiseAggregateOptions"; 0052 static ElementWiseAggregateOptions Defaults() { return ElementWiseAggregateOptions{}; } 0053 bool skip_nulls; 0054 }; 0055 0056 /// Rounding and tie-breaking modes for round compute functions. 0057 /// Additional details and examples are provided in compute.rst. 0058 enum class RoundMode : int8_t { 0059 /// Round to nearest integer less than or equal in magnitude (aka "floor") 0060 DOWN, 0061 /// Round to nearest integer greater than or equal in magnitude (aka "ceil") 0062 UP, 0063 /// Get the integral part without fractional digits (aka "trunc") 0064 TOWARDS_ZERO, 0065 /// Round negative values with DOWN rule 0066 /// and positive values with UP rule (aka "away from zero") 0067 TOWARDS_INFINITY, 0068 /// Round ties with DOWN rule (also called "round half towards negative infinity") 0069 HALF_DOWN, 0070 /// Round ties with UP rule (also called "round half towards positive infinity") 0071 HALF_UP, 0072 /// Round ties with TOWARDS_ZERO rule (also called "round half away from infinity") 0073 HALF_TOWARDS_ZERO, 0074 /// Round ties with TOWARDS_INFINITY rule (also called "round half away from zero") 0075 HALF_TOWARDS_INFINITY, 0076 /// Round ties to nearest even integer 0077 HALF_TO_EVEN, 0078 /// Round ties to nearest odd integer 0079 HALF_TO_ODD, 0080 }; 0081 0082 class ARROW_EXPORT RoundOptions : public FunctionOptions { 0083 public: 0084 explicit RoundOptions(int64_t ndigits = 0, 0085 RoundMode round_mode = RoundMode::HALF_TO_EVEN); 0086 static constexpr char const kTypeName[] = "RoundOptions"; 0087 static RoundOptions Defaults() { return RoundOptions(); } 0088 /// Rounding precision (number of digits to round to) 0089 int64_t ndigits; 0090 /// Rounding and tie-breaking mode 0091 RoundMode round_mode; 0092 }; 0093 0094 class ARROW_EXPORT RoundBinaryOptions : public FunctionOptions { 0095 public: 0096 explicit RoundBinaryOptions(RoundMode round_mode = RoundMode::HALF_TO_EVEN); 0097 static constexpr char const kTypeName[] = "RoundBinaryOptions"; 0098 static RoundBinaryOptions Defaults() { return RoundBinaryOptions(); } 0099 /// Rounding and tie-breaking mode 0100 RoundMode round_mode; 0101 }; 0102 0103 enum class CalendarUnit : int8_t { 0104 NANOSECOND, 0105 MICROSECOND, 0106 MILLISECOND, 0107 SECOND, 0108 MINUTE, 0109 HOUR, 0110 DAY, 0111 WEEK, 0112 MONTH, 0113 QUARTER, 0114 YEAR 0115 }; 0116 0117 class ARROW_EXPORT RoundTemporalOptions : public FunctionOptions { 0118 public: 0119 explicit RoundTemporalOptions(int multiple = 1, CalendarUnit unit = CalendarUnit::DAY, 0120 bool week_starts_monday = true, 0121 bool ceil_is_strictly_greater = false, 0122 bool calendar_based_origin = false); 0123 static constexpr char const kTypeName[] = "RoundTemporalOptions"; 0124 static RoundTemporalOptions Defaults() { return RoundTemporalOptions(); } 0125 0126 /// Number of units to round to 0127 int multiple; 0128 /// The unit used for rounding of time 0129 CalendarUnit unit; 0130 /// What day does the week start with (Monday=true, Sunday=false) 0131 bool week_starts_monday; 0132 /// Enable this flag to return a rounded value that is strictly greater than the input. 0133 /// For example: ceiling 1970-01-01T00:00:00 to 3 hours would yield 1970-01-01T03:00:00 0134 /// if set to true and 1970-01-01T00:00:00 if set to false. 0135 /// This applies for ceiling only. 0136 bool ceil_is_strictly_greater; 0137 /// By default time is rounded to a multiple of units since 1970-01-01T00:00:00. 0138 /// By setting calendar_based_origin to true, time will be rounded to a number 0139 /// of units since the last greater calendar unit. 0140 /// For example: rounding to a multiple of days since the beginning of the month or 0141 /// to hours since the beginning of the day. 0142 /// Exceptions: week and quarter are not used as greater units, therefore days will 0143 /// will be rounded to the beginning of the month not week. Greater unit of week 0144 /// is year. 0145 /// Note that ceiling and rounding might change sorting order of an array near greater 0146 /// unit change. For example rounding YYYY-mm-dd 23:00:00 to 5 hours will ceil and 0147 /// round to YYYY-mm-dd+1 01:00:00 and floor to YYYY-mm-dd 20:00:00. On the other hand 0148 /// YYYY-mm-dd+1 00:00:00 will ceil, round and floor to YYYY-mm-dd+1 00:00:00. This 0149 /// can break the order of an already ordered array. 0150 bool calendar_based_origin; 0151 }; 0152 0153 class ARROW_EXPORT RoundToMultipleOptions : public FunctionOptions { 0154 public: 0155 explicit RoundToMultipleOptions(double multiple = 1.0, 0156 RoundMode round_mode = RoundMode::HALF_TO_EVEN); 0157 explicit RoundToMultipleOptions(std::shared_ptr<Scalar> multiple, 0158 RoundMode round_mode = RoundMode::HALF_TO_EVEN); 0159 static constexpr char const kTypeName[] = "RoundToMultipleOptions"; 0160 static RoundToMultipleOptions Defaults() { return RoundToMultipleOptions(); } 0161 /// Rounding scale (multiple to round to). 0162 /// 0163 /// Should be a positive numeric scalar of a type compatible with the 0164 /// argument to be rounded. The cast kernel is used to convert the rounding 0165 /// multiple to match the result type. 0166 std::shared_ptr<Scalar> multiple; 0167 /// Rounding and tie-breaking mode 0168 RoundMode round_mode; 0169 }; 0170 0171 /// Options for var_args_join. 0172 class ARROW_EXPORT JoinOptions : public FunctionOptions { 0173 public: 0174 /// How to handle null values. (A null separator always results in a null output.) 0175 enum NullHandlingBehavior { 0176 /// A null in any input results in a null in the output. 0177 EMIT_NULL, 0178 /// Nulls in inputs are skipped. 0179 SKIP, 0180 /// Nulls in inputs are replaced with the replacement string. 0181 REPLACE, 0182 }; 0183 explicit JoinOptions(NullHandlingBehavior null_handling = EMIT_NULL, 0184 std::string null_replacement = ""); 0185 static constexpr char const kTypeName[] = "JoinOptions"; 0186 static JoinOptions Defaults() { return JoinOptions(); } 0187 NullHandlingBehavior null_handling; 0188 std::string null_replacement; 0189 }; 0190 0191 class ARROW_EXPORT MatchSubstringOptions : public FunctionOptions { 0192 public: 0193 explicit MatchSubstringOptions(std::string pattern, bool ignore_case = false); 0194 MatchSubstringOptions(); 0195 static constexpr char const kTypeName[] = "MatchSubstringOptions"; 0196 0197 /// The exact substring (or regex, depending on kernel) to look for inside input values. 0198 std::string pattern; 0199 /// Whether to perform a case-insensitive match. 0200 bool ignore_case; 0201 }; 0202 0203 class ARROW_EXPORT SplitOptions : public FunctionOptions { 0204 public: 0205 explicit SplitOptions(int64_t max_splits = -1, bool reverse = false); 0206 static constexpr char const kTypeName[] = "SplitOptions"; 0207 0208 /// Maximum number of splits allowed, or unlimited when -1 0209 int64_t max_splits; 0210 /// Start splitting from the end of the string (only relevant when max_splits != -1) 0211 bool reverse; 0212 }; 0213 0214 class ARROW_EXPORT SplitPatternOptions : public FunctionOptions { 0215 public: 0216 explicit SplitPatternOptions(std::string pattern, int64_t max_splits = -1, 0217 bool reverse = false); 0218 SplitPatternOptions(); 0219 static constexpr char const kTypeName[] = "SplitPatternOptions"; 0220 0221 /// The exact substring to split on. 0222 std::string pattern; 0223 /// Maximum number of splits allowed, or unlimited when -1 0224 int64_t max_splits; 0225 /// Start splitting from the end of the string (only relevant when max_splits != -1) 0226 bool reverse; 0227 }; 0228 0229 class ARROW_EXPORT ReplaceSliceOptions : public FunctionOptions { 0230 public: 0231 explicit ReplaceSliceOptions(int64_t start, int64_t stop, std::string replacement); 0232 ReplaceSliceOptions(); 0233 static constexpr char const kTypeName[] = "ReplaceSliceOptions"; 0234 0235 /// Index to start slicing at 0236 int64_t start; 0237 /// Index to stop slicing at 0238 int64_t stop; 0239 /// String to replace the slice with 0240 std::string replacement; 0241 }; 0242 0243 class ARROW_EXPORT ReplaceSubstringOptions : public FunctionOptions { 0244 public: 0245 explicit ReplaceSubstringOptions(std::string pattern, std::string replacement, 0246 int64_t max_replacements = -1); 0247 ReplaceSubstringOptions(); 0248 static constexpr char const kTypeName[] = "ReplaceSubstringOptions"; 0249 0250 /// Pattern to match, literal, or regular expression depending on which kernel is used 0251 std::string pattern; 0252 /// String to replace the pattern with 0253 std::string replacement; 0254 /// Max number of substrings to replace (-1 means unbounded) 0255 int64_t max_replacements; 0256 }; 0257 0258 class ARROW_EXPORT ExtractRegexOptions : public FunctionOptions { 0259 public: 0260 explicit ExtractRegexOptions(std::string pattern); 0261 ExtractRegexOptions(); 0262 static constexpr char const kTypeName[] = "ExtractRegexOptions"; 0263 0264 /// Regular expression with named capture fields 0265 std::string pattern; 0266 }; 0267 0268 /// Options for IsIn and IndexIn functions 0269 class ARROW_EXPORT SetLookupOptions : public FunctionOptions { 0270 public: 0271 /// How to handle null values. 0272 enum NullMatchingBehavior { 0273 /// MATCH, any null in `value_set` is successfully matched in 0274 /// the input. 0275 MATCH, 0276 /// SKIP, any null in `value_set` is ignored and nulls in the input 0277 /// produce null (IndexIn) or false (IsIn) values in the output. 0278 SKIP, 0279 /// EMIT_NULL, any null in `value_set` is ignored and nulls in the 0280 /// input produce null (IndexIn and IsIn) values in the output. 0281 EMIT_NULL, 0282 /// INCONCLUSIVE, null values are regarded as unknown values, which is 0283 /// sql-compatible. nulls in the input produce null (IndexIn and IsIn) 0284 /// values in the output. Besides, if `value_set` contains a null, 0285 /// non-null unmatched values in the input also produce null values 0286 /// (IndexIn and IsIn) in the output. 0287 INCONCLUSIVE 0288 }; 0289 0290 explicit SetLookupOptions(Datum value_set, NullMatchingBehavior = MATCH); 0291 SetLookupOptions(); 0292 0293 // DEPRECATED(will be removed after removing of skip_nulls) 0294 explicit SetLookupOptions(Datum value_set, bool skip_nulls); 0295 0296 static constexpr char const kTypeName[] = "SetLookupOptions"; 0297 0298 /// The set of values to look up input values into. 0299 Datum value_set; 0300 0301 NullMatchingBehavior null_matching_behavior; 0302 0303 // DEPRECATED(will be removed after removing of skip_nulls) 0304 NullMatchingBehavior GetNullMatchingBehavior() const; 0305 0306 // DEPRECATED(use null_matching_behavior instead) 0307 /// Whether nulls in `value_set` count for lookup. 0308 /// 0309 /// If true, any null in `value_set` is ignored and nulls in the input 0310 /// produce null (IndexIn) or false (IsIn) values in the output. 0311 /// If false, any null in `value_set` is successfully matched in 0312 /// the input. 0313 std::optional<bool> skip_nulls; 0314 }; 0315 0316 /// Options for struct_field function 0317 class ARROW_EXPORT StructFieldOptions : public FunctionOptions { 0318 public: 0319 explicit StructFieldOptions(std::vector<int> indices); 0320 explicit StructFieldOptions(std::initializer_list<int>); 0321 explicit StructFieldOptions(FieldRef field_ref); 0322 StructFieldOptions(); 0323 static constexpr char const kTypeName[] = "StructFieldOptions"; 0324 0325 /// The FieldRef specifying what to extract from struct or union. 0326 FieldRef field_ref; 0327 }; 0328 0329 class ARROW_EXPORT StrptimeOptions : public FunctionOptions { 0330 public: 0331 explicit StrptimeOptions(std::string format, TimeUnit::type unit, 0332 bool error_is_null = false); 0333 StrptimeOptions(); 0334 static constexpr char const kTypeName[] = "StrptimeOptions"; 0335 0336 /// The desired format string. 0337 std::string format; 0338 /// The desired time resolution 0339 TimeUnit::type unit; 0340 /// Return null on parsing errors if true or raise if false 0341 bool error_is_null; 0342 }; 0343 0344 class ARROW_EXPORT StrftimeOptions : public FunctionOptions { 0345 public: 0346 explicit StrftimeOptions(std::string format, std::string locale = "C"); 0347 StrftimeOptions(); 0348 0349 static constexpr char const kTypeName[] = "StrftimeOptions"; 0350 0351 static constexpr const char* kDefaultFormat = "%Y-%m-%dT%H:%M:%S"; 0352 0353 /// The desired format string. 0354 std::string format; 0355 /// The desired output locale string. 0356 std::string locale; 0357 }; 0358 0359 class ARROW_EXPORT PadOptions : public FunctionOptions { 0360 public: 0361 explicit PadOptions(int64_t width, std::string padding = " ", 0362 bool lean_left_on_odd_padding = true); 0363 PadOptions(); 0364 static constexpr char const kTypeName[] = "PadOptions"; 0365 0366 /// The desired string length. 0367 int64_t width; 0368 /// What to pad the string with. Should be one codepoint (Unicode)/byte (ASCII). 0369 std::string padding; 0370 /// What to do if there is an odd number of padding characters (in case of centered 0371 /// padding). Defaults to aligning on the left (i.e. adding the extra padding character 0372 /// on the right) 0373 bool lean_left_on_odd_padding = true; 0374 }; 0375 0376 class ARROW_EXPORT TrimOptions : public FunctionOptions { 0377 public: 0378 explicit TrimOptions(std::string characters); 0379 TrimOptions(); 0380 static constexpr char const kTypeName[] = "TrimOptions"; 0381 0382 /// The individual characters to be trimmed from the string. 0383 std::string characters; 0384 }; 0385 0386 class ARROW_EXPORT SliceOptions : public FunctionOptions { 0387 public: 0388 explicit SliceOptions(int64_t start, int64_t stop = std::numeric_limits<int64_t>::max(), 0389 int64_t step = 1); 0390 SliceOptions(); 0391 static constexpr char const kTypeName[] = "SliceOptions"; 0392 int64_t start, stop, step; 0393 }; 0394 0395 class ARROW_EXPORT ListSliceOptions : public FunctionOptions { 0396 public: 0397 explicit ListSliceOptions(int64_t start, std::optional<int64_t> stop = std::nullopt, 0398 int64_t step = 1, 0399 std::optional<bool> return_fixed_size_list = std::nullopt); 0400 ListSliceOptions(); 0401 static constexpr char const kTypeName[] = "ListSliceOptions"; 0402 /// The start of list slicing. 0403 int64_t start; 0404 /// Optional stop of list slicing. If not set, then slice to end. (NotImplemented) 0405 std::optional<int64_t> stop; 0406 /// Slicing step 0407 int64_t step; 0408 // Whether to return a FixedSizeListArray. If true _and_ stop is after 0409 // a list element's length, nulls will be appended to create the requested slice size. 0410 // Default of `nullopt` will return whatever type it got in. 0411 std::optional<bool> return_fixed_size_list; 0412 }; 0413 0414 class ARROW_EXPORT NullOptions : public FunctionOptions { 0415 public: 0416 explicit NullOptions(bool nan_is_null = false); 0417 static constexpr char const kTypeName[] = "NullOptions"; 0418 static NullOptions Defaults() { return NullOptions{}; } 0419 0420 bool nan_is_null; 0421 }; 0422 0423 enum CompareOperator : int8_t { 0424 EQUAL, 0425 NOT_EQUAL, 0426 GREATER, 0427 GREATER_EQUAL, 0428 LESS, 0429 LESS_EQUAL, 0430 }; 0431 0432 struct ARROW_EXPORT CompareOptions { 0433 explicit CompareOptions(CompareOperator op) : op(op) {} 0434 CompareOptions() : CompareOptions(CompareOperator::EQUAL) {} 0435 enum CompareOperator op; 0436 }; 0437 0438 class ARROW_EXPORT MakeStructOptions : public FunctionOptions { 0439 public: 0440 MakeStructOptions(std::vector<std::string> n, std::vector<bool> r, 0441 std::vector<std::shared_ptr<const KeyValueMetadata>> m); 0442 explicit MakeStructOptions(std::vector<std::string> n); 0443 MakeStructOptions(); 0444 static constexpr char const kTypeName[] = "MakeStructOptions"; 0445 0446 /// Names for wrapped columns 0447 std::vector<std::string> field_names; 0448 0449 /// Nullability bits for wrapped columns 0450 std::vector<bool> field_nullability; 0451 0452 /// Metadata attached to wrapped columns 0453 std::vector<std::shared_ptr<const KeyValueMetadata>> field_metadata; 0454 }; 0455 0456 struct ARROW_EXPORT DayOfWeekOptions : public FunctionOptions { 0457 public: 0458 explicit DayOfWeekOptions(bool count_from_zero = true, uint32_t week_start = 1); 0459 static constexpr char const kTypeName[] = "DayOfWeekOptions"; 0460 static DayOfWeekOptions Defaults() { return DayOfWeekOptions(); } 0461 0462 /// Number days from 0 if true and from 1 if false 0463 bool count_from_zero; 0464 /// What day does the week start with (Monday=1, Sunday=7). 0465 /// The numbering is unaffected by the count_from_zero parameter. 0466 uint32_t week_start; 0467 }; 0468 0469 /// Used to control timestamp timezone conversion and handling ambiguous/nonexistent 0470 /// times. 0471 struct ARROW_EXPORT AssumeTimezoneOptions : public FunctionOptions { 0472 public: 0473 /// \brief How to interpret ambiguous local times that can be interpreted as 0474 /// multiple instants (normally two) due to DST shifts. 0475 /// 0476 /// AMBIGUOUS_EARLIEST emits the earliest instant amongst possible interpretations. 0477 /// AMBIGUOUS_LATEST emits the latest instant amongst possible interpretations. 0478 enum Ambiguous { AMBIGUOUS_RAISE, AMBIGUOUS_EARLIEST, AMBIGUOUS_LATEST }; 0479 0480 /// \brief How to handle local times that do not exist due to DST shifts. 0481 /// 0482 /// NONEXISTENT_EARLIEST emits the instant "just before" the DST shift instant 0483 /// in the given timestamp precision (for example, for a nanoseconds precision 0484 /// timestamp, this is one nanosecond before the DST shift instant). 0485 /// NONEXISTENT_LATEST emits the DST shift instant. 0486 enum Nonexistent { NONEXISTENT_RAISE, NONEXISTENT_EARLIEST, NONEXISTENT_LATEST }; 0487 0488 explicit AssumeTimezoneOptions(std::string timezone, 0489 Ambiguous ambiguous = AMBIGUOUS_RAISE, 0490 Nonexistent nonexistent = NONEXISTENT_RAISE); 0491 AssumeTimezoneOptions(); 0492 static constexpr char const kTypeName[] = "AssumeTimezoneOptions"; 0493 0494 /// Timezone to convert timestamps from 0495 std::string timezone; 0496 0497 /// How to interpret ambiguous local times (due to DST shifts) 0498 Ambiguous ambiguous; 0499 /// How to interpret nonexistent local times (due to DST shifts) 0500 Nonexistent nonexistent; 0501 }; 0502 0503 struct ARROW_EXPORT WeekOptions : public FunctionOptions { 0504 public: 0505 explicit WeekOptions(bool week_starts_monday = true, bool count_from_zero = false, 0506 bool first_week_is_fully_in_year = false); 0507 static constexpr char const kTypeName[] = "WeekOptions"; 0508 static WeekOptions Defaults() { return WeekOptions{}; } 0509 static WeekOptions ISODefaults() { 0510 return WeekOptions{/*week_starts_monday*/ true, 0511 /*count_from_zero=*/false, 0512 /*first_week_is_fully_in_year=*/false}; 0513 } 0514 static WeekOptions USDefaults() { 0515 return WeekOptions{/*week_starts_monday*/ false, 0516 /*count_from_zero=*/false, 0517 /*first_week_is_fully_in_year=*/false}; 0518 } 0519 0520 /// What day does the week start with (Monday=true, Sunday=false) 0521 bool week_starts_monday; 0522 /// Dates from current year that fall into last ISO week of the previous year return 0523 /// 0 if true and 52 or 53 if false. 0524 bool count_from_zero; 0525 /// Must the first week be fully in January (true), or is a week that begins on 0526 /// December 29, 30, or 31 considered to be the first week of the new year (false)? 0527 bool first_week_is_fully_in_year; 0528 }; 0529 0530 struct ARROW_EXPORT Utf8NormalizeOptions : public FunctionOptions { 0531 public: 0532 enum Form { NFC, NFKC, NFD, NFKD }; 0533 0534 explicit Utf8NormalizeOptions(Form form = NFC); 0535 static Utf8NormalizeOptions Defaults() { return Utf8NormalizeOptions(); } 0536 static constexpr char const kTypeName[] = "Utf8NormalizeOptions"; 0537 0538 /// The Unicode normalization form to apply 0539 Form form; 0540 }; 0541 0542 class ARROW_EXPORT RandomOptions : public FunctionOptions { 0543 public: 0544 enum Initializer { SystemRandom, Seed }; 0545 0546 static RandomOptions FromSystemRandom() { return RandomOptions{SystemRandom, 0}; } 0547 static RandomOptions FromSeed(uint64_t seed) { return RandomOptions{Seed, seed}; } 0548 0549 RandomOptions(Initializer initializer, uint64_t seed); 0550 RandomOptions(); 0551 static constexpr char const kTypeName[] = "RandomOptions"; 0552 static RandomOptions Defaults() { return RandomOptions(); } 0553 0554 /// The type of initialization for random number generation - system or provided seed. 0555 Initializer initializer; 0556 /// The seed value used to initialize the random number generation. 0557 uint64_t seed; 0558 }; 0559 0560 /// Options for map_lookup function 0561 class ARROW_EXPORT MapLookupOptions : public FunctionOptions { 0562 public: 0563 enum Occurrence { 0564 /// Return the first matching value 0565 FIRST, 0566 /// Return the last matching value 0567 LAST, 0568 /// Return all matching values 0569 ALL 0570 }; 0571 0572 explicit MapLookupOptions(std::shared_ptr<Scalar> query_key, Occurrence occurrence); 0573 MapLookupOptions(); 0574 0575 constexpr static char const kTypeName[] = "MapLookupOptions"; 0576 0577 /// The key to lookup in the map 0578 std::shared_ptr<Scalar> query_key; 0579 0580 /// Whether to return the first, last, or all matching values 0581 Occurrence occurrence; 0582 }; 0583 0584 /// @} 0585 0586 /// \brief Get the absolute value of a value. 0587 /// 0588 /// If argument is null the result will be null. 0589 /// 0590 /// \param[in] arg the value transformed 0591 /// \param[in] options arithmetic options (overflow handling), optional 0592 /// \param[in] ctx the function execution context, optional 0593 /// \return the elementwise absolute value 0594 ARROW_EXPORT 0595 Result<Datum> AbsoluteValue(const Datum& arg, 0596 ArithmeticOptions options = ArithmeticOptions(), 0597 ExecContext* ctx = NULLPTR); 0598 0599 /// \brief Add two values together. Array values must be the same length. If 0600 /// either addend is null the result will be null. 0601 /// 0602 /// \param[in] left the first addend 0603 /// \param[in] right the second addend 0604 /// \param[in] options arithmetic options (overflow handling), optional 0605 /// \param[in] ctx the function execution context, optional 0606 /// \return the elementwise sum 0607 ARROW_EXPORT 0608 Result<Datum> Add(const Datum& left, const Datum& right, 0609 ArithmeticOptions options = ArithmeticOptions(), 0610 ExecContext* ctx = NULLPTR); 0611 0612 /// \brief Subtract two values. Array values must be the same length. If the 0613 /// minuend or subtrahend is null the result will be null. 0614 /// 0615 /// \param[in] left the value subtracted from (minuend) 0616 /// \param[in] right the value by which the minuend is reduced (subtrahend) 0617 /// \param[in] options arithmetic options (overflow handling), optional 0618 /// \param[in] ctx the function execution context, optional 0619 /// \return the elementwise difference 0620 ARROW_EXPORT 0621 Result<Datum> Subtract(const Datum& left, const Datum& right, 0622 ArithmeticOptions options = ArithmeticOptions(), 0623 ExecContext* ctx = NULLPTR); 0624 0625 /// \brief Multiply two values. Array values must be the same length. If either 0626 /// factor is null the result will be null. 0627 /// 0628 /// \param[in] left the first factor 0629 /// \param[in] right the second factor 0630 /// \param[in] options arithmetic options (overflow handling), optional 0631 /// \param[in] ctx the function execution context, optional 0632 /// \return the elementwise product 0633 ARROW_EXPORT 0634 Result<Datum> Multiply(const Datum& left, const Datum& right, 0635 ArithmeticOptions options = ArithmeticOptions(), 0636 ExecContext* ctx = NULLPTR); 0637 0638 /// \brief Divide two values. Array values must be the same length. If either 0639 /// argument is null the result will be null. For integer types, if there is 0640 /// a zero divisor, an error will be raised. 0641 /// 0642 /// \param[in] left the dividend 0643 /// \param[in] right the divisor 0644 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0645 /// \param[in] ctx the function execution context, optional 0646 /// \return the elementwise quotient 0647 ARROW_EXPORT 0648 Result<Datum> Divide(const Datum& left, const Datum& right, 0649 ArithmeticOptions options = ArithmeticOptions(), 0650 ExecContext* ctx = NULLPTR); 0651 0652 /// \brief Negate values. 0653 /// 0654 /// If argument is null the result will be null. 0655 /// 0656 /// \param[in] arg the value negated 0657 /// \param[in] options arithmetic options (overflow handling), optional 0658 /// \param[in] ctx the function execution context, optional 0659 /// \return the elementwise negation 0660 ARROW_EXPORT 0661 Result<Datum> Negate(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0662 ExecContext* ctx = NULLPTR); 0663 0664 /// \brief Raise the values of base array to the power of the exponent array values. 0665 /// Array values must be the same length. If either base or exponent is null the result 0666 /// will be null. 0667 /// 0668 /// \param[in] left the base 0669 /// \param[in] right the exponent 0670 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0671 /// \param[in] ctx the function execution context, optional 0672 /// \return the elementwise base value raised to the power of exponent 0673 ARROW_EXPORT 0674 Result<Datum> Power(const Datum& left, const Datum& right, 0675 ArithmeticOptions options = ArithmeticOptions(), 0676 ExecContext* ctx = NULLPTR); 0677 0678 /// \brief Raise Euler's number to the power of specified exponent, element-wise. 0679 /// If the exponent value is null the result will be null. 0680 /// 0681 /// \param[in] arg the exponent 0682 /// \param[in] ctx the function execution context, optional 0683 /// \return the element-wise Euler's number raised to the power of exponent 0684 ARROW_EXPORT 0685 Result<Datum> Exp(const Datum& arg, ExecContext* ctx = NULLPTR); 0686 0687 /// \brief More accurately calculate `exp(arg) - 1` for values close to zero. 0688 /// If the exponent value is null the result will be null. 0689 /// 0690 /// This function is more accurate than calculating `exp(value) - 1` directly for values 0691 /// close to zero. 0692 /// 0693 /// \param[in] arg the exponent 0694 /// \param[in] ctx the function execution context, optional 0695 /// \return the element-wise Euler's number raised to the power of exponent minus 1 0696 ARROW_EXPORT 0697 Result<Datum> Expm1(const Datum& arg, ExecContext* ctx = NULLPTR); 0698 0699 /// \brief Left shift the left array by the right array. Array values must be the 0700 /// same length. If either operand is null, the result will be null. 0701 /// 0702 /// \param[in] left the value to shift 0703 /// \param[in] right the value to shift by 0704 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0705 /// \param[in] ctx the function execution context, optional 0706 /// \return the elementwise left value shifted left by the right value 0707 ARROW_EXPORT 0708 Result<Datum> ShiftLeft(const Datum& left, const Datum& right, 0709 ArithmeticOptions options = ArithmeticOptions(), 0710 ExecContext* ctx = NULLPTR); 0711 0712 /// \brief Right shift the left array by the right array. Array values must be the 0713 /// same length. If either operand is null, the result will be null. Performs a 0714 /// logical shift for unsigned values, and an arithmetic shift for signed values. 0715 /// 0716 /// \param[in] left the value to shift 0717 /// \param[in] right the value to shift by 0718 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0719 /// \param[in] ctx the function execution context, optional 0720 /// \return the elementwise left value shifted right by the right value 0721 ARROW_EXPORT 0722 Result<Datum> ShiftRight(const Datum& left, const Datum& right, 0723 ArithmeticOptions options = ArithmeticOptions(), 0724 ExecContext* ctx = NULLPTR); 0725 0726 /// \brief Compute the sine of the array values. 0727 /// \param[in] arg The values to compute the sine for. 0728 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0729 /// \param[in] ctx the function execution context, optional 0730 /// \return the elementwise sine of the values 0731 ARROW_EXPORT 0732 Result<Datum> Sin(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0733 ExecContext* ctx = NULLPTR); 0734 0735 /// \brief Compute the cosine of the array values. 0736 /// \param[in] arg The values to compute the cosine for. 0737 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0738 /// \param[in] ctx the function execution context, optional 0739 /// \return the elementwise cosine of the values 0740 ARROW_EXPORT 0741 Result<Datum> Cos(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0742 ExecContext* ctx = NULLPTR); 0743 0744 /// \brief Compute the inverse sine (arcsine) of the array values. 0745 /// \param[in] arg The values to compute the inverse sine for. 0746 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0747 /// \param[in] ctx the function execution context, optional 0748 /// \return the elementwise inverse sine of the values 0749 ARROW_EXPORT 0750 Result<Datum> Asin(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0751 ExecContext* ctx = NULLPTR); 0752 0753 /// \brief Compute the inverse cosine (arccosine) of the array values. 0754 /// \param[in] arg The values to compute the inverse cosine for. 0755 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0756 /// \param[in] ctx the function execution context, optional 0757 /// \return the elementwise inverse cosine of the values 0758 ARROW_EXPORT 0759 Result<Datum> Acos(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0760 ExecContext* ctx = NULLPTR); 0761 0762 /// \brief Compute the tangent of the array values. 0763 /// \param[in] arg The values to compute the tangent for. 0764 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0765 /// \param[in] ctx the function execution context, optional 0766 /// \return the elementwise tangent of the values 0767 ARROW_EXPORT 0768 Result<Datum> Tan(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0769 ExecContext* ctx = NULLPTR); 0770 0771 /// \brief Compute the inverse tangent (arctangent) of the array values. 0772 /// \param[in] arg The values to compute the inverse tangent for. 0773 /// \param[in] ctx the function execution context, optional 0774 /// \return the elementwise inverse tangent of the values 0775 ARROW_EXPORT 0776 Result<Datum> Atan(const Datum& arg, ExecContext* ctx = NULLPTR); 0777 0778 /// \brief Compute the inverse tangent (arctangent) of y/x, using the 0779 /// argument signs to determine the correct quadrant. 0780 /// \param[in] y The y-values to compute the inverse tangent for. 0781 /// \param[in] x The x-values to compute the inverse tangent for. 0782 /// \param[in] ctx the function execution context, optional 0783 /// \return the elementwise inverse tangent of the values 0784 ARROW_EXPORT 0785 Result<Datum> Atan2(const Datum& y, const Datum& x, ExecContext* ctx = NULLPTR); 0786 0787 /// \brief Compute the hyperbolic sine of the array values. 0788 /// \param[in] arg The values to compute the hyperbolic sine for. 0789 /// \param[in] ctx the function execution context, optional 0790 /// \return the elementwise hyperbolic sine of the values 0791 ARROW_EXPORT 0792 Result<Datum> Sinh(const Datum& arg, ExecContext* ctx = NULLPTR); 0793 0794 /// \brief Compute the hyperbolic cosine of the array values. 0795 /// \param[in] arg The values to compute the hyperbolic cosine for. 0796 /// \param[in] ctx the function execution context, optional 0797 /// \return the elementwise hyperbolic cosine of the values 0798 ARROW_EXPORT 0799 Result<Datum> Cosh(const Datum& arg, ExecContext* ctx = NULLPTR); 0800 0801 /// \brief Compute the hyperbolic tangent of the array values. 0802 /// \param[in] arg The values to compute the hyperbolic tangent for. 0803 /// \param[in] ctx the function execution context, optional 0804 /// \return the elementwise hyperbolic tangent of the values 0805 ARROW_EXPORT 0806 Result<Datum> Tanh(const Datum& arg, ExecContext* ctx = NULLPTR); 0807 0808 /// \brief Compute the inverse hyperbolic sine of the array values. 0809 /// \param[in] arg The values to compute the inverse hyperbolic sine for. 0810 /// \param[in] ctx the function execution context, optional 0811 /// \return the elementwise inverse hyperbolic sine of the values 0812 ARROW_EXPORT 0813 Result<Datum> Asinh(const Datum& arg, ExecContext* ctx = NULLPTR); 0814 0815 /// \brief Compute the inverse hyperbolic cosine of the array values. 0816 /// \param[in] arg The values to compute the inverse hyperbolic cosine for. 0817 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0818 /// \param[in] ctx the function execution context, optional 0819 /// \return the elementwise inverse hyperbolic cosine of the values 0820 ARROW_EXPORT 0821 Result<Datum> Acosh(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0822 ExecContext* ctx = NULLPTR); 0823 0824 /// \brief Compute the inverse hyperbolic tangent of the array values. 0825 /// \param[in] arg The values to compute the inverse hyperbolic tangent for. 0826 /// \param[in] options arithmetic options (enable/disable overflow checking), optional 0827 /// \param[in] ctx the function execution context, optional 0828 /// \return the elementwise inverse hyperbolic tangent of the values 0829 ARROW_EXPORT 0830 Result<Datum> Atanh(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0831 ExecContext* ctx = NULLPTR); 0832 0833 /// \brief Get the natural log of a value. 0834 /// 0835 /// If argument is null the result will be null. 0836 /// 0837 /// \param[in] arg The values to compute the logarithm for. 0838 /// \param[in] options arithmetic options (overflow handling), optional 0839 /// \param[in] ctx the function execution context, optional 0840 /// \return the elementwise natural log 0841 ARROW_EXPORT 0842 Result<Datum> Ln(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0843 ExecContext* ctx = NULLPTR); 0844 0845 /// \brief Get the log base 10 of a value. 0846 /// 0847 /// If argument is null the result will be null. 0848 /// 0849 /// \param[in] arg The values to compute the logarithm for. 0850 /// \param[in] options arithmetic options (overflow handling), optional 0851 /// \param[in] ctx the function execution context, optional 0852 /// \return the elementwise log base 10 0853 ARROW_EXPORT 0854 Result<Datum> Log10(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0855 ExecContext* ctx = NULLPTR); 0856 0857 /// \brief Get the log base 2 of a value. 0858 /// 0859 /// If argument is null the result will be null. 0860 /// 0861 /// \param[in] arg The values to compute the logarithm for. 0862 /// \param[in] options arithmetic options (overflow handling), optional 0863 /// \param[in] ctx the function execution context, optional 0864 /// \return the elementwise log base 2 0865 ARROW_EXPORT 0866 Result<Datum> Log2(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0867 ExecContext* ctx = NULLPTR); 0868 0869 /// \brief Get the natural log of (1 + value). 0870 /// 0871 /// If argument is null the result will be null. 0872 /// This function may be more accurate than Log(1 + value) for values close to zero. 0873 /// 0874 /// \param[in] arg The values to compute the logarithm for. 0875 /// \param[in] options arithmetic options (overflow handling), optional 0876 /// \param[in] ctx the function execution context, optional 0877 /// \return the elementwise natural log 0878 ARROW_EXPORT 0879 Result<Datum> Log1p(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0880 ExecContext* ctx = NULLPTR); 0881 0882 /// \brief Get the log of a value to the given base. 0883 /// 0884 /// If argument is null the result will be null. 0885 /// 0886 /// \param[in] arg The values to compute the logarithm for. 0887 /// \param[in] base The given base. 0888 /// \param[in] options arithmetic options (overflow handling), optional 0889 /// \param[in] ctx the function execution context, optional 0890 /// \return the elementwise log to the given base 0891 ARROW_EXPORT 0892 Result<Datum> Logb(const Datum& arg, const Datum& base, 0893 ArithmeticOptions options = ArithmeticOptions(), 0894 ExecContext* ctx = NULLPTR); 0895 0896 /// \brief Get the square-root of a value. 0897 /// 0898 /// If argument is null the result will be null. 0899 /// 0900 /// \param[in] arg The values to compute the square-root for. 0901 /// \param[in] options arithmetic options (overflow handling), optional 0902 /// \param[in] ctx the function execution context, optional 0903 /// \return the elementwise square-root 0904 ARROW_EXPORT 0905 Result<Datum> Sqrt(const Datum& arg, ArithmeticOptions options = ArithmeticOptions(), 0906 ExecContext* ctx = NULLPTR); 0907 0908 /// \brief Round to the nearest integer less than or equal in magnitude to the 0909 /// argument. 0910 /// 0911 /// If argument is null the result will be null. 0912 /// 0913 /// \param[in] arg the value to round 0914 /// \param[in] ctx the function execution context, optional 0915 /// \return the rounded value 0916 ARROW_EXPORT 0917 Result<Datum> Floor(const Datum& arg, ExecContext* ctx = NULLPTR); 0918 0919 /// \brief Round to the nearest integer greater than or equal in magnitude to the 0920 /// argument. 0921 /// 0922 /// If argument is null the result will be null. 0923 /// 0924 /// \param[in] arg the value to round 0925 /// \param[in] ctx the function execution context, optional 0926 /// \return the rounded value 0927 ARROW_EXPORT 0928 Result<Datum> Ceil(const Datum& arg, ExecContext* ctx = NULLPTR); 0929 0930 /// \brief Get the integral part without fractional digits. 0931 /// 0932 /// If argument is null the result will be null. 0933 /// 0934 /// \param[in] arg the value to truncate 0935 /// \param[in] ctx the function execution context, optional 0936 /// \return the truncated value 0937 ARROW_EXPORT 0938 Result<Datum> Trunc(const Datum& arg, ExecContext* ctx = NULLPTR); 0939 0940 /// \brief Find the element-wise maximum of any number of arrays or scalars. 0941 /// Array values must be the same length. 0942 /// 0943 /// \param[in] args arrays or scalars to operate on. 0944 /// \param[in] options options for handling nulls, optional 0945 /// \param[in] ctx the function execution context, optional 0946 /// \return the element-wise maximum 0947 ARROW_EXPORT 0948 Result<Datum> MaxElementWise( 0949 const std::vector<Datum>& args, 0950 ElementWiseAggregateOptions options = ElementWiseAggregateOptions::Defaults(), 0951 ExecContext* ctx = NULLPTR); 0952 0953 /// \brief Find the element-wise minimum of any number of arrays or scalars. 0954 /// Array values must be the same length. 0955 /// 0956 /// \param[in] args arrays or scalars to operate on. 0957 /// \param[in] options options for handling nulls, optional 0958 /// \param[in] ctx the function execution context, optional 0959 /// \return the element-wise minimum 0960 ARROW_EXPORT 0961 Result<Datum> MinElementWise( 0962 const std::vector<Datum>& args, 0963 ElementWiseAggregateOptions options = ElementWiseAggregateOptions::Defaults(), 0964 ExecContext* ctx = NULLPTR); 0965 0966 /// \brief Get the sign of a value. Array values can be of arbitrary length. If argument 0967 /// is null the result will be null. 0968 /// 0969 /// \param[in] arg the value to extract sign from 0970 /// \param[in] ctx the function execution context, optional 0971 /// \return the element-wise sign function 0972 ARROW_EXPORT 0973 Result<Datum> Sign(const Datum& arg, ExecContext* ctx = NULLPTR); 0974 0975 /// \brief Round a value to a given precision. 0976 /// 0977 /// If arg is null the result will be null. 0978 /// 0979 /// \param[in] arg the value to be rounded 0980 /// \param[in] options rounding options (rounding mode and number of digits), optional 0981 /// \param[in] ctx the function execution context, optional 0982 /// \return the element-wise rounded value 0983 ARROW_EXPORT 0984 Result<Datum> Round(const Datum& arg, RoundOptions options = RoundOptions::Defaults(), 0985 ExecContext* ctx = NULLPTR); 0986 0987 /// \brief Round a value to a given precision. 0988 /// 0989 /// If arg1 is null the result will be null. 0990 /// If arg2 is null then the result will be null. If arg2 is negative, then the rounding 0991 /// place will be shifted to the left (thus -1 would correspond to rounding to the nearest 0992 /// ten). If positive, the rounding place will shift to the right (and +1 would 0993 /// correspond to rounding to the nearest tenth). 0994 /// 0995 /// \param[in] arg1 the value to be rounded 0996 /// \param[in] arg2 the number of significant digits to round to 0997 /// \param[in] options rounding options, optional 0998 /// \param[in] ctx the function execution context, optional 0999 /// \return the element-wise rounded value 1000 ARROW_EXPORT 1001 Result<Datum> RoundBinary(const Datum& arg1, const Datum& arg2, 1002 RoundBinaryOptions options = RoundBinaryOptions::Defaults(), 1003 ExecContext* ctx = NULLPTR); 1004 1005 /// \brief Round a value to a given multiple. 1006 /// 1007 /// If argument is null the result will be null. 1008 /// 1009 /// \param[in] arg the value to round 1010 /// \param[in] options rounding options (rounding mode and multiple), optional 1011 /// \param[in] ctx the function execution context, optional 1012 /// \return the element-wise rounded value 1013 ARROW_EXPORT 1014 Result<Datum> RoundToMultiple( 1015 const Datum& arg, RoundToMultipleOptions options = RoundToMultipleOptions::Defaults(), 1016 ExecContext* ctx = NULLPTR); 1017 1018 /// \brief Ceil a temporal value to a given frequency 1019 /// 1020 /// If argument is null the result will be null. 1021 /// 1022 /// \param[in] arg the temporal value to ceil 1023 /// \param[in] options temporal rounding options, optional 1024 /// \param[in] ctx the function execution context, optional 1025 /// \return the element-wise rounded value 1026 /// 1027 /// \since 7.0.0 1028 /// \note API not yet finalized 1029 ARROW_EXPORT 1030 Result<Datum> CeilTemporal( 1031 const Datum& arg, RoundTemporalOptions options = RoundTemporalOptions::Defaults(), 1032 ExecContext* ctx = NULLPTR); 1033 1034 /// \brief Floor a temporal value to a given frequency 1035 /// 1036 /// If argument is null the result will be null. 1037 /// 1038 /// \param[in] arg the temporal value to floor 1039 /// \param[in] options temporal rounding options, optional 1040 /// \param[in] ctx the function execution context, optional 1041 /// \return the element-wise rounded value 1042 /// 1043 /// \since 7.0.0 1044 /// \note API not yet finalized 1045 ARROW_EXPORT 1046 Result<Datum> FloorTemporal( 1047 const Datum& arg, RoundTemporalOptions options = RoundTemporalOptions::Defaults(), 1048 ExecContext* ctx = NULLPTR); 1049 1050 /// \brief Round a temporal value to a given frequency 1051 /// 1052 /// If argument is null the result will be null. 1053 /// 1054 /// \param[in] arg the temporal value to round 1055 /// \param[in] options temporal rounding options, optional 1056 /// \param[in] ctx the function execution context, optional 1057 /// \return the element-wise rounded value 1058 /// 1059 /// \since 7.0.0 1060 /// \note API not yet finalized 1061 ARROW_EXPORT 1062 Result<Datum> RoundTemporal( 1063 const Datum& arg, RoundTemporalOptions options = RoundTemporalOptions::Defaults(), 1064 ExecContext* ctx = NULLPTR); 1065 1066 /// \brief Invert the values of a boolean datum 1067 /// \param[in] value datum to invert 1068 /// \param[in] ctx the function execution context, optional 1069 /// \return the resulting datum 1070 /// 1071 /// \since 1.0.0 1072 /// \note API not yet finalized 1073 ARROW_EXPORT 1074 Result<Datum> Invert(const Datum& value, ExecContext* ctx = NULLPTR); 1075 1076 /// \brief Element-wise AND of two boolean datums which always propagates nulls 1077 /// (null and false is null). 1078 /// 1079 /// \param[in] left left operand 1080 /// \param[in] right right operand 1081 /// \param[in] ctx the function execution context, optional 1082 /// \return the resulting datum 1083 /// 1084 /// \since 1.0.0 1085 /// \note API not yet finalized 1086 ARROW_EXPORT 1087 Result<Datum> And(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR); 1088 1089 /// \brief Element-wise AND of two boolean datums with a Kleene truth table 1090 /// (null and false is false). 1091 /// 1092 /// \param[in] left left operand 1093 /// \param[in] right right operand 1094 /// \param[in] ctx the function execution context, optional 1095 /// \return the resulting datum 1096 /// 1097 /// \since 1.0.0 1098 /// \note API not yet finalized 1099 ARROW_EXPORT 1100 Result<Datum> KleeneAnd(const Datum& left, const Datum& right, 1101 ExecContext* ctx = NULLPTR); 1102 1103 /// \brief Element-wise OR of two boolean datums which always propagates nulls 1104 /// (null and true is null). 1105 /// 1106 /// \param[in] left left operand 1107 /// \param[in] right right operand 1108 /// \param[in] ctx the function execution context, optional 1109 /// \return the resulting datum 1110 /// 1111 /// \since 1.0.0 1112 /// \note API not yet finalized 1113 ARROW_EXPORT 1114 Result<Datum> Or(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR); 1115 1116 /// \brief Element-wise OR of two boolean datums with a Kleene truth table 1117 /// (null or true is true). 1118 /// 1119 /// \param[in] left left operand 1120 /// \param[in] right right operand 1121 /// \param[in] ctx the function execution context, optional 1122 /// \return the resulting datum 1123 /// 1124 /// \since 1.0.0 1125 /// \note API not yet finalized 1126 ARROW_EXPORT 1127 Result<Datum> KleeneOr(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR); 1128 1129 /// \brief Element-wise XOR of two boolean datums 1130 /// \param[in] left left operand 1131 /// \param[in] right right operand 1132 /// \param[in] ctx the function execution context, optional 1133 /// \return the resulting datum 1134 /// 1135 /// \since 1.0.0 1136 /// \note API not yet finalized 1137 ARROW_EXPORT 1138 Result<Datum> Xor(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR); 1139 1140 /// \brief Element-wise AND NOT of two boolean datums which always propagates nulls 1141 /// (null and not true is null). 1142 /// 1143 /// \param[in] left left operand 1144 /// \param[in] right right operand 1145 /// \param[in] ctx the function execution context, optional 1146 /// \return the resulting datum 1147 /// 1148 /// \since 3.0.0 1149 /// \note API not yet finalized 1150 ARROW_EXPORT 1151 Result<Datum> AndNot(const Datum& left, const Datum& right, ExecContext* ctx = NULLPTR); 1152 1153 /// \brief Element-wise AND NOT of two boolean datums with a Kleene truth table 1154 /// (false and not null is false, null and not true is false). 1155 /// 1156 /// \param[in] left left operand 1157 /// \param[in] right right operand 1158 /// \param[in] ctx the function execution context, optional 1159 /// \return the resulting datum 1160 /// 1161 /// \since 3.0.0 1162 /// \note API not yet finalized 1163 ARROW_EXPORT 1164 Result<Datum> KleeneAndNot(const Datum& left, const Datum& right, 1165 ExecContext* ctx = NULLPTR); 1166 1167 /// \brief IsIn returns true for each element of `values` that is contained in 1168 /// `value_set` 1169 /// 1170 /// Behaviour of nulls is governed by SetLookupOptions::skip_nulls. 1171 /// 1172 /// \param[in] values array-like input to look up in value_set 1173 /// \param[in] options SetLookupOptions 1174 /// \param[in] ctx the function execution context, optional 1175 /// \return the resulting datum 1176 /// 1177 /// \since 1.0.0 1178 /// \note API not yet finalized 1179 ARROW_EXPORT 1180 Result<Datum> IsIn(const Datum& values, const SetLookupOptions& options, 1181 ExecContext* ctx = NULLPTR); 1182 ARROW_EXPORT 1183 Result<Datum> IsIn(const Datum& values, const Datum& value_set, 1184 ExecContext* ctx = NULLPTR); 1185 1186 /// \brief IndexIn examines each slot in the values against a value_set array. 1187 /// If the value is not found in value_set, null will be output. 1188 /// If found, the index of occurrence within value_set (ignoring duplicates) 1189 /// will be output. 1190 /// 1191 /// For example given values = [99, 42, 3, null] and 1192 /// value_set = [3, 3, 99], the output will be = [2, null, 0, null] 1193 /// 1194 /// Behaviour of nulls is governed by SetLookupOptions::skip_nulls. 1195 /// 1196 /// \param[in] values array-like input 1197 /// \param[in] options SetLookupOptions 1198 /// \param[in] ctx the function execution context, optional 1199 /// \return the resulting datum 1200 /// 1201 /// \since 1.0.0 1202 /// \note API not yet finalized 1203 ARROW_EXPORT 1204 Result<Datum> IndexIn(const Datum& values, const SetLookupOptions& options, 1205 ExecContext* ctx = NULLPTR); 1206 ARROW_EXPORT 1207 Result<Datum> IndexIn(const Datum& values, const Datum& value_set, 1208 ExecContext* ctx = NULLPTR); 1209 1210 /// \brief IsValid returns true for each element of `values` that is not null, 1211 /// false otherwise 1212 /// 1213 /// \param[in] values input to examine for validity 1214 /// \param[in] ctx the function execution context, optional 1215 /// \return the resulting datum 1216 /// 1217 /// \since 1.0.0 1218 /// \note API not yet finalized 1219 ARROW_EXPORT 1220 Result<Datum> IsValid(const Datum& values, ExecContext* ctx = NULLPTR); 1221 1222 /// \brief IsNull returns true for each element of `values` that is null, 1223 /// false otherwise 1224 /// 1225 /// \param[in] values input to examine for nullity 1226 /// \param[in] options NullOptions 1227 /// \param[in] ctx the function execution context, optional 1228 /// \return the resulting datum 1229 /// 1230 /// \since 1.0.0 1231 /// \note API not yet finalized 1232 ARROW_EXPORT 1233 Result<Datum> IsNull(const Datum& values, NullOptions options = NullOptions::Defaults(), 1234 ExecContext* ctx = NULLPTR); 1235 1236 /// \brief IsNan returns true for each element of `values` that is NaN, 1237 /// false otherwise 1238 /// 1239 /// \param[in] values input to look for NaN 1240 /// \param[in] ctx the function execution context, optional 1241 /// \return the resulting datum 1242 /// 1243 /// \since 3.0.0 1244 /// \note API not yet finalized 1245 ARROW_EXPORT 1246 Result<Datum> IsNan(const Datum& values, ExecContext* ctx = NULLPTR); 1247 1248 /// \brief IfElse returns elements chosen from `left` or `right` 1249 /// depending on `cond`. `null` values in `cond` will be promoted to the result 1250 /// 1251 /// \param[in] cond `Boolean` condition Scalar/ Array 1252 /// \param[in] left Scalar/ Array 1253 /// \param[in] right Scalar/ Array 1254 /// \param[in] ctx the function execution context, optional 1255 /// 1256 /// \return the resulting datum 1257 /// 1258 /// \since 5.0.0 1259 /// \note API not yet finalized 1260 ARROW_EXPORT 1261 Result<Datum> IfElse(const Datum& cond, const Datum& left, const Datum& right, 1262 ExecContext* ctx = NULLPTR); 1263 1264 /// \brief CaseWhen behaves like a switch/case or if-else if-else statement: for 1265 /// each row, select the first value for which the corresponding condition is 1266 /// true, or (if given) select the 'else' value, else emit null. Note that a 1267 /// null condition is the same as false. 1268 /// 1269 /// \param[in] cond Conditions (Boolean) 1270 /// \param[in] cases Values (any type), along with an optional 'else' value. 1271 /// \param[in] ctx the function execution context, optional 1272 /// 1273 /// \return the resulting datum 1274 /// 1275 /// \since 5.0.0 1276 /// \note API not yet finalized 1277 ARROW_EXPORT 1278 Result<Datum> CaseWhen(const Datum& cond, const std::vector<Datum>& cases, 1279 ExecContext* ctx = NULLPTR); 1280 1281 /// \brief Year returns year for each element of `values` 1282 /// 1283 /// \param[in] values input to extract year from 1284 /// \param[in] ctx the function execution context, optional 1285 /// \return the resulting datum 1286 /// 1287 /// \since 5.0.0 1288 /// \note API not yet finalized 1289 ARROW_EXPORT 1290 Result<Datum> Year(const Datum& values, ExecContext* ctx = NULLPTR); 1291 1292 /// \brief IsLeapYear returns if a year is a leap year for each element of `values` 1293 /// 1294 /// \param[in] values input to extract leap year indicator from 1295 /// \param[in] ctx the function execution context, optional 1296 /// \return the resulting datum 1297 /// 1298 /// \since 8.0.0 1299 /// \note API not yet finalized 1300 ARROW_EXPORT 1301 Result<Datum> IsLeapYear(const Datum& values, ExecContext* ctx = NULLPTR); 1302 1303 /// \brief Month returns month for each element of `values`. 1304 /// Month is encoded as January=1, December=12 1305 /// 1306 /// \param[in] values input to extract month from 1307 /// \param[in] ctx the function execution context, optional 1308 /// \return the resulting datum 1309 /// 1310 /// \since 5.0.0 1311 /// \note API not yet finalized 1312 ARROW_EXPORT 1313 Result<Datum> Month(const Datum& values, ExecContext* ctx = NULLPTR); 1314 1315 /// \brief Day returns day number for each element of `values` 1316 /// 1317 /// \param[in] values input to extract day from 1318 /// \param[in] ctx the function execution context, optional 1319 /// \return the resulting datum 1320 /// 1321 /// \since 5.0.0 1322 /// \note API not yet finalized 1323 ARROW_EXPORT 1324 Result<Datum> Day(const Datum& values, ExecContext* ctx = NULLPTR); 1325 1326 /// \brief YearMonthDay returns a struct containing the Year, Month and Day value for 1327 /// each element of `values`. 1328 /// 1329 /// \param[in] values input to extract (year, month, day) struct from 1330 /// \param[in] ctx the function execution context, optional 1331 /// \return the resulting datum 1332 /// 1333 /// \since 7.0.0 1334 /// \note API not yet finalized 1335 ARROW_EXPORT 1336 Result<Datum> YearMonthDay(const Datum& values, ExecContext* ctx = NULLPTR); 1337 1338 /// \brief DayOfWeek returns number of the day of the week value for each element of 1339 /// `values`. 1340 /// 1341 /// By default week starts on Monday denoted by 0 and ends on Sunday denoted 1342 /// by 6. Start day of the week (Monday=1, Sunday=7) and numbering base (0 or 1) can be 1343 /// set using DayOfWeekOptions 1344 /// 1345 /// \param[in] values input to extract number of the day of the week from 1346 /// \param[in] options for setting start of the week and day numbering 1347 /// \param[in] ctx the function execution context, optional 1348 /// \return the resulting datum 1349 /// 1350 /// \since 5.0.0 1351 /// \note API not yet finalized 1352 ARROW_EXPORT Result<Datum> DayOfWeek(const Datum& values, 1353 DayOfWeekOptions options = DayOfWeekOptions(), 1354 ExecContext* ctx = NULLPTR); 1355 1356 /// \brief DayOfYear returns number of day of the year for each element of `values`. 1357 /// January 1st maps to day number 1, February 1st to 32, etc. 1358 /// 1359 /// \param[in] values input to extract number of day of the year from 1360 /// \param[in] ctx the function execution context, optional 1361 /// \return the resulting datum 1362 /// 1363 /// \since 5.0.0 1364 /// \note API not yet finalized 1365 ARROW_EXPORT Result<Datum> DayOfYear(const Datum& values, ExecContext* ctx = NULLPTR); 1366 1367 /// \brief ISOYear returns ISO year number for each element of `values`. 1368 /// First week of an ISO year has the majority (4 or more) of its days in January. 1369 /// 1370 /// \param[in] values input to extract ISO year from 1371 /// \param[in] ctx the function execution context, optional 1372 /// \return the resulting datum 1373 /// 1374 /// \since 5.0.0 1375 /// \note API not yet finalized 1376 ARROW_EXPORT 1377 Result<Datum> ISOYear(const Datum& values, ExecContext* ctx = NULLPTR); 1378 1379 /// \brief USYear returns US epidemiological year number for each element of `values`. 1380 /// First week of US epidemiological year has the majority (4 or more) of it's 1381 /// days in January. Last week of US epidemiological year has the year's last 1382 /// Wednesday in it. US epidemiological week starts on Sunday. 1383 /// 1384 /// \param[in] values input to extract US epidemiological year from 1385 /// \param[in] ctx the function execution context, optional 1386 /// \return the resulting datum 1387 /// 1388 /// \since 8.0.0 1389 /// \note API not yet finalized 1390 ARROW_EXPORT 1391 Result<Datum> USYear(const Datum& values, ExecContext* ctx = NULLPTR); 1392 1393 /// \brief ISOWeek returns ISO week of year number for each element of `values`. 1394 /// First ISO week has the majority (4 or more) of its days in January. 1395 /// ISO week starts on Monday. Year can have 52 or 53 weeks. 1396 /// Week numbering can start with 1. 1397 /// 1398 /// \param[in] values input to extract ISO week of year from 1399 /// \param[in] ctx the function execution context, optional 1400 /// \return the resulting datum 1401 /// 1402 /// \since 5.0.0 1403 /// \note API not yet finalized 1404 ARROW_EXPORT Result<Datum> ISOWeek(const Datum& values, ExecContext* ctx = NULLPTR); 1405 1406 /// \brief USWeek returns US week of year number for each element of `values`. 1407 /// First US week has the majority (4 or more) of its days in January. 1408 /// US week starts on Sunday. Year can have 52 or 53 weeks. 1409 /// Week numbering starts with 1. 1410 /// 1411 /// \param[in] values input to extract US week of year from 1412 /// \param[in] ctx the function execution context, optional 1413 /// \return the resulting datum 1414 /// 1415 /// \since 6.0.0 1416 /// \note API not yet finalized 1417 ARROW_EXPORT Result<Datum> USWeek(const Datum& values, ExecContext* ctx = NULLPTR); 1418 1419 /// \brief Week returns week of year number for each element of `values`. 1420 /// First ISO week has the majority (4 or more) of its days in January. 1421 /// Year can have 52 or 53 weeks. Week numbering can start with 0 or 1 1422 /// depending on DayOfWeekOptions.count_from_zero. 1423 /// 1424 /// \param[in] values input to extract week of year from 1425 /// \param[in] options for setting numbering start 1426 /// \param[in] ctx the function execution context, optional 1427 /// \return the resulting datum 1428 /// 1429 /// \since 6.0.0 1430 /// \note API not yet finalized 1431 ARROW_EXPORT Result<Datum> Week(const Datum& values, WeekOptions options = WeekOptions(), 1432 ExecContext* ctx = NULLPTR); 1433 1434 /// \brief ISOCalendar returns a (ISO year, ISO week, ISO day of week) struct for 1435 /// each element of `values`. 1436 /// ISO week starts on Monday denoted by 1 and ends on Sunday denoted by 7. 1437 /// 1438 /// \param[in] values input to ISO calendar struct from 1439 /// \param[in] ctx the function execution context, optional 1440 /// \return the resulting datum 1441 /// 1442 /// \since 5.0.0 1443 /// \note API not yet finalized 1444 ARROW_EXPORT Result<Datum> ISOCalendar(const Datum& values, ExecContext* ctx = NULLPTR); 1445 1446 /// \brief Quarter returns the quarter of year number for each element of `values` 1447 /// First quarter maps to 1 and fourth quarter maps to 4. 1448 /// 1449 /// \param[in] values input to extract quarter of year from 1450 /// \param[in] ctx the function execution context, optional 1451 /// \return the resulting datum 1452 /// 1453 /// \since 5.0.0 1454 /// \note API not yet finalized 1455 ARROW_EXPORT Result<Datum> Quarter(const Datum& values, ExecContext* ctx = NULLPTR); 1456 1457 /// \brief Hour returns hour value for each element of `values` 1458 /// 1459 /// \param[in] values input to extract hour from 1460 /// \param[in] ctx the function execution context, optional 1461 /// \return the resulting datum 1462 /// 1463 /// \since 5.0.0 1464 /// \note API not yet finalized 1465 ARROW_EXPORT 1466 Result<Datum> Hour(const Datum& values, ExecContext* ctx = NULLPTR); 1467 1468 /// \brief Minute returns minutes value for each element of `values` 1469 /// 1470 /// \param[in] values input to extract minutes from 1471 /// \param[in] ctx the function execution context, optional 1472 /// \return the resulting datum 1473 /// 1474 /// \since 5.0.0 1475 /// \note API not yet finalized 1476 ARROW_EXPORT 1477 Result<Datum> Minute(const Datum& values, ExecContext* ctx = NULLPTR); 1478 1479 /// \brief Second returns seconds value for each element of `values` 1480 /// 1481 /// \param[in] values input to extract seconds from 1482 /// \param[in] ctx the function execution context, optional 1483 /// \return the resulting datum 1484 /// 1485 /// \since 5.0.0 1486 /// \note API not yet finalized 1487 ARROW_EXPORT 1488 Result<Datum> Second(const Datum& values, ExecContext* ctx = NULLPTR); 1489 1490 /// \brief Millisecond returns number of milliseconds since the last full second 1491 /// for each element of `values` 1492 /// 1493 /// \param[in] values input to extract milliseconds from 1494 /// \param[in] ctx the function execution context, optional 1495 /// \return the resulting datum 1496 /// 1497 /// \since 5.0.0 1498 /// \note API not yet finalized 1499 ARROW_EXPORT 1500 Result<Datum> Millisecond(const Datum& values, ExecContext* ctx = NULLPTR); 1501 1502 /// \brief Microsecond returns number of microseconds since the last full millisecond 1503 /// for each element of `values` 1504 /// 1505 /// \param[in] values input to extract microseconds from 1506 /// \param[in] ctx the function execution context, optional 1507 /// \return the resulting datum 1508 /// 1509 /// \since 5.0.0 1510 /// \note API not yet finalized 1511 ARROW_EXPORT 1512 Result<Datum> Microsecond(const Datum& values, ExecContext* ctx = NULLPTR); 1513 1514 /// \brief Nanosecond returns number of nanoseconds since the last full millisecond 1515 /// for each element of `values` 1516 /// 1517 /// \param[in] values input to extract nanoseconds from 1518 /// \param[in] ctx the function execution context, optional 1519 /// \return the resulting datum 1520 /// 1521 /// \since 5.0.0 1522 /// \note API not yet finalized 1523 ARROW_EXPORT 1524 Result<Datum> Nanosecond(const Datum& values, ExecContext* ctx = NULLPTR); 1525 1526 /// \brief Subsecond returns the fraction of second elapsed since last full second 1527 /// as a float for each element of `values` 1528 /// 1529 /// \param[in] values input to extract subsecond from 1530 /// \param[in] ctx the function execution context, optional 1531 /// \return the resulting datum 1532 /// 1533 /// \since 5.0.0 1534 /// \note API not yet finalized 1535 ARROW_EXPORT Result<Datum> Subsecond(const Datum& values, ExecContext* ctx = NULLPTR); 1536 1537 /// \brief Format timestamps according to a format string 1538 /// 1539 /// Return formatted time strings according to the format string 1540 /// `StrftimeOptions::format` and to the locale specifier `Strftime::locale`. 1541 /// 1542 /// \param[in] values input timestamps 1543 /// \param[in] options for setting format string and locale 1544 /// \param[in] ctx the function execution context, optional 1545 /// \return the resulting datum 1546 /// 1547 /// \since 6.0.0 1548 /// \note API not yet finalized 1549 ARROW_EXPORT Result<Datum> Strftime(const Datum& values, StrftimeOptions options, 1550 ExecContext* ctx = NULLPTR); 1551 1552 /// \brief Parse timestamps according to a format string 1553 /// 1554 /// Return parsed timestamps according to the format string 1555 /// `StrptimeOptions::format` at time resolution `Strftime::unit`. Parse errors are 1556 /// raised depending on the `Strftime::error_is_null` setting. 1557 /// 1558 /// \param[in] values input strings 1559 /// \param[in] options for setting format string, unit and error_is_null 1560 /// \param[in] ctx the function execution context, optional 1561 /// \return the resulting datum 1562 /// 1563 /// \since 8.0.0 1564 /// \note API not yet finalized 1565 ARROW_EXPORT Result<Datum> Strptime(const Datum& values, StrptimeOptions options, 1566 ExecContext* ctx = NULLPTR); 1567 1568 /// \brief Converts timestamps from local timestamp without a timezone to a timestamp with 1569 /// timezone, interpreting the local timestamp as being in the specified timezone for each 1570 /// element of `values` 1571 /// 1572 /// \param[in] values input to convert 1573 /// \param[in] options for setting source timezone, exception and ambiguous timestamp 1574 /// handling. 1575 /// \param[in] ctx the function execution context, optional 1576 /// \return the resulting datum 1577 /// 1578 /// \since 6.0.0 1579 /// \note API not yet finalized 1580 ARROW_EXPORT Result<Datum> AssumeTimezone(const Datum& values, 1581 AssumeTimezoneOptions options, 1582 ExecContext* ctx = NULLPTR); 1583 1584 /// \brief IsDaylightSavings extracts if currently observing daylight savings for each 1585 /// element of `values` 1586 /// 1587 /// \param[in] values input to extract daylight savings indicator from 1588 /// \param[in] ctx the function execution context, optional 1589 /// \return the resulting datum 1590 /// 1591 /// \since 8.0.0 1592 /// \note API not yet finalized 1593 ARROW_EXPORT Result<Datum> IsDaylightSavings(const Datum& values, 1594 ExecContext* ctx = NULLPTR); 1595 1596 /// \brief LocalTimestamp converts timestamp to timezone naive local timestamp 1597 /// 1598 /// \param[in] values input to convert to local time 1599 /// \param[in] ctx the function execution context, optional 1600 /// \return the resulting datum 1601 /// 1602 /// \since 12.0.0 1603 /// \note API not yet finalized 1604 ARROW_EXPORT Result<Datum> LocalTimestamp(const Datum& values, 1605 ExecContext* ctx = NULLPTR); 1606 1607 /// \brief Years Between finds the number of years between two values 1608 /// 1609 /// \param[in] left input treated as the start time 1610 /// \param[in] right input treated as the end time 1611 /// \param[in] ctx the function execution context, optional 1612 /// \return the resulting datum 1613 /// 1614 /// \since 8.0.0 1615 /// \note API not yet finalized 1616 ARROW_EXPORT Result<Datum> YearsBetween(const Datum& left, const Datum& right, 1617 ExecContext* ctx = NULLPTR); 1618 1619 /// \brief Quarters Between finds the number of quarters between two values 1620 /// 1621 /// \param[in] left input treated as the start time 1622 /// \param[in] right input treated as the end time 1623 /// \param[in] ctx the function execution context, optional 1624 /// \return the resulting datum 1625 /// 1626 /// \since 8.0.0 1627 /// \note API not yet finalized 1628 ARROW_EXPORT Result<Datum> QuartersBetween(const Datum& left, const Datum& right, 1629 ExecContext* ctx = NULLPTR); 1630 1631 /// \brief Months Between finds the number of month between two values 1632 /// 1633 /// \param[in] left input treated as the start time 1634 /// \param[in] right input treated as the end time 1635 /// \param[in] ctx the function execution context, optional 1636 /// \return the resulting datum 1637 /// 1638 /// \since 8.0.0 1639 /// \note API not yet finalized 1640 ARROW_EXPORT Result<Datum> MonthsBetween(const Datum& left, const Datum& right, 1641 ExecContext* ctx = NULLPTR); 1642 1643 /// \brief Weeks Between finds the number of weeks between two values 1644 /// 1645 /// \param[in] left input treated as the start time 1646 /// \param[in] right input treated as the end time 1647 /// \param[in] ctx the function execution context, optional 1648 /// \return the resulting datum 1649 /// 1650 /// \since 8.0.0 1651 /// \note API not yet finalized 1652 ARROW_EXPORT Result<Datum> WeeksBetween(const Datum& left, const Datum& right, 1653 ExecContext* ctx = NULLPTR); 1654 1655 /// \brief Month Day Nano Between finds the number of months, days, and nanoseconds 1656 /// between two values 1657 /// 1658 /// \param[in] left input treated as the start time 1659 /// \param[in] right input treated as the end time 1660 /// \param[in] ctx the function execution context, optional 1661 /// \return the resulting datum 1662 /// 1663 /// \since 8.0.0 1664 /// \note API not yet finalized 1665 ARROW_EXPORT Result<Datum> MonthDayNanoBetween(const Datum& left, const Datum& right, 1666 ExecContext* ctx = NULLPTR); 1667 1668 /// \brief DayTime Between finds the number of days and milliseconds between two values 1669 /// 1670 /// \param[in] left input treated as the start time 1671 /// \param[in] right input treated as the end time 1672 /// \param[in] ctx the function execution context, optional 1673 /// \return the resulting datum 1674 /// 1675 /// \since 8.0.0 1676 /// \note API not yet finalized 1677 ARROW_EXPORT Result<Datum> DayTimeBetween(const Datum& left, const Datum& right, 1678 ExecContext* ctx = NULLPTR); 1679 1680 /// \brief Days Between finds the number of days between two values 1681 /// 1682 /// \param[in] left input treated as the start time 1683 /// \param[in] right input treated as the end time 1684 /// \param[in] ctx the function execution context, optional 1685 /// \return the resulting datum 1686 /// 1687 /// \since 8.0.0 1688 /// \note API not yet finalized 1689 ARROW_EXPORT Result<Datum> DaysBetween(const Datum& left, const Datum& right, 1690 ExecContext* ctx = NULLPTR); 1691 1692 /// \brief Hours Between finds the number of hours between two values 1693 /// 1694 /// \param[in] left input treated as the start time 1695 /// \param[in] right input treated as the end time 1696 /// \param[in] ctx the function execution context, optional 1697 /// \return the resulting datum 1698 /// 1699 /// \since 8.0.0 1700 /// \note API not yet finalized 1701 ARROW_EXPORT Result<Datum> HoursBetween(const Datum& left, const Datum& right, 1702 ExecContext* ctx = NULLPTR); 1703 1704 /// \brief Minutes Between finds the number of minutes between two values 1705 /// 1706 /// \param[in] left input treated as the start time 1707 /// \param[in] right input treated as the end time 1708 /// \param[in] ctx the function execution context, optional 1709 /// \return the resulting datum 1710 /// 1711 /// \since 8.0.0 1712 /// \note API not yet finalized 1713 ARROW_EXPORT Result<Datum> MinutesBetween(const Datum& left, const Datum& right, 1714 ExecContext* ctx = NULLPTR); 1715 1716 /// \brief Seconds Between finds the number of hours between two values 1717 /// 1718 /// \param[in] left input treated as the start time 1719 /// \param[in] right input treated as the end time 1720 /// \param[in] ctx the function execution context, optional 1721 /// \return the resulting datum 1722 /// 1723 /// \since 8.0.0 1724 /// \note API not yet finalized 1725 ARROW_EXPORT Result<Datum> SecondsBetween(const Datum& left, const Datum& right, 1726 ExecContext* ctx = NULLPTR); 1727 1728 /// \brief Milliseconds Between finds the number of milliseconds between two values 1729 /// 1730 /// \param[in] left input treated as the start time 1731 /// \param[in] right input treated as the end time 1732 /// \param[in] ctx the function execution context, optional 1733 /// \return the resulting datum 1734 /// 1735 /// \since 8.0.0 1736 /// \note API not yet finalized 1737 ARROW_EXPORT Result<Datum> MillisecondsBetween(const Datum& left, const Datum& right, 1738 ExecContext* ctx = NULLPTR); 1739 1740 /// \brief Microseconds Between finds the number of microseconds between two values 1741 /// 1742 /// \param[in] left input treated as the start time 1743 /// \param[in] right input treated as the end time 1744 /// \param[in] ctx the function execution context, optional 1745 /// \return the resulting datum 1746 /// 1747 /// \since 8.0.0 1748 /// \note API not yet finalized 1749 ARROW_EXPORT Result<Datum> MicrosecondsBetween(const Datum& left, const Datum& right, 1750 ExecContext* ctx = NULLPTR); 1751 1752 /// \brief Nanoseconds Between finds the number of nanoseconds between two values 1753 /// 1754 /// \param[in] left input treated as the start time 1755 /// \param[in] right input treated as the end time 1756 /// \param[in] ctx the function execution context, optional 1757 /// \return the resulting datum 1758 /// 1759 /// \since 8.0.0 1760 /// \note API not yet finalized 1761 ARROW_EXPORT Result<Datum> NanosecondsBetween(const Datum& left, const Datum& right, 1762 ExecContext* ctx = NULLPTR); 1763 1764 /// \brief Finds either the FIRST, LAST, or ALL items with a key that matches the given 1765 /// query key in a map. 1766 /// 1767 /// Returns an array of items for FIRST and LAST, and an array of list of items for ALL. 1768 /// 1769 /// \param[in] map to look in 1770 /// \param[in] options to pass a query key and choose which matching keys to return 1771 /// (FIRST, LAST or ALL) 1772 /// \param[in] ctx the function execution context, optional 1773 /// \return the resulting datum 1774 /// 1775 /// \since 8.0.0 1776 /// \note API not yet finalized 1777 ARROW_EXPORT Result<Datum> MapLookup(const Datum& map, MapLookupOptions options, 1778 ExecContext* ctx = NULLPTR); 1779 } // namespace compute 1780 } // namespace arrow
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |