Get runtime build info.
The returned values correspond to exact loaded version of the Arrow library, rather than the values frozen at application compile-time through the ARROW_*
preprocessor definitions.
Public Members
The packed version number, e.g. 1002003 (decimal) for Arrow 1.2.3.
The âmajorâ version number, e.g. 1 for Arrow 1.2.3.
The âminorâ version number, e.g. 2 for Arrow 1.2.3.
The âpatchâ version number, e.g. 3 for Arrow 1.2.3.
The version string, e.g. â1.2.3â.
The CMake compiler identifier, e.g. âGNUâ.
The git changeset id, if available.
The git changeset description, if available.
The uppercase build type, e.g. âDEBUGâ or âRELEASEâ.
Get runtime info.
Public Members
The enabled SIMD level.
This can be less than detected_simd_level
if the ARROW_USER_SIMD_LEVEL environment variable is set to another value.
The SIMD level available on the OS and CPU.
Whether using the OS-based timezone database This is set at compile-time.
The path to the timezone database; by default None.
These can be useful if you need to decide between different blocks of code at compile time (for example to conditionally take advantage of a recently introduced API).
The Arrow major version number, for example 7
for Arrow 7.0.1.
The Arrow minor version number, for example 0
for Arrow 7.0.1.
The Arrow patch version number, for example 1
for Arrow 7.0.1.
A consolidated integer representing the full Arrow version in an easily comparable form, computed with the formula: ((ARROW_VERSION_MAJOR * 1000) + ARROW_VERSION_MINOR) * 1000 + ARROW_VERSION_PATCH
.
For example, this would choose a different block of code if the code is being compiled against a Arrow version equal to or greater than 7.0.1:
#if ARROW_VERSION >= 7000001 // Arrow 7.0.1 or later... #endif
A human-readable string representation of the Arrow version, such as "7.0.1"
.
Public Members
Path to text timezone database.
This is only configurable on Windows, which does not have a compatible OS timezone database.
Status outcome object (success or error)
The Status object is an object holding the outcome of an operation. The outcome is represented as a StatusCode, either success (StatusCode::OK) or an error (any other of the StatusCode enumeration values).
Additionally, if an error occurred, a specific error message is generally attached.
Public Functions
Pluggable constructor for use by sub-systems. detail cannot be null.
Return true iff the status indicates success.
Return true iff the status indicates an out-of-memory error.
Return true iff the status indicates a key lookup error.
Return true iff the status indicates invalid data.
Return true iff the status indicates a cancelled operation.
Return true iff the status indicates an IO-related failure.
Return true iff the status indicates a container reaching capacity limits.
Return true iff the status indicates an out of bounds index.
Return true iff the status indicates a type error.
Return true iff the status indicates an unknown error.
Return true iff the status indicates an unimplemented operation.
Return true iff the status indicates a (de)serialization failure.
Return true iff the status indicates a R-originated error.
Return a string representation of this status suitable for printing.
The string âOKâ is returned for success.
Return a string representation of this status without context lines suitable for printing.
The string âOKâ is returned for success.
Return a string representation of the status code, without the message text or POSIX code information.
Return the StatusCode value attached to this status.
Return the specific error message attached to this status.
Return the status detail attached to this message.
Return a new Status copying the existing status, but updating with the existing detail.
Return a new Status with changed message, copying the existing status code and detail.
Apply a functor if the status indicates an error.
This can be used to execute fallback or cleanup actions.
If the status indicates a success, it is returned as-is.
If the status indicates an error, the given functor is called with the status as argument. If the functor returns a new Status, it is returned. If the functor returns a Status-compatible object such as Result<T>, it is converted to Status and returned. If the functor returns void, the original Status is returned.
Public Static Functions
Return a success status.
Return an error status for out-of-memory conditions.
Return an error status for failed key lookups (e.g. column name in a table)
Return an error status for type errors (such as mismatching data types)
Return an error status for unknown errors.
Return an error status when an operation or a combination of operation and data types is unimplemented.
Return an error status for invalid data (for example a string that fails parsing)
Return an error status for cancelled operation.
Return an error status when an index is out of bounds.
Return an error status when a containerâs capacity would exceed its limits.
Return an error status when some IO-related operation failed.
Return an error status when some (de)serialization operation failed.
An opaque class that allows subsystems to retain additional information inside the Status.
Subclassed by arrow::AsyncErrorDetail, arrow::flight::FlightStatusDetail, arrow::flight::FlightWriteSizeStatusDetail, arrow::flight::TransportStatusDetail
Public Functions
Return a unique id for the type of the StatusDetail (effectively a poor manâs substitute for RTTI).
Produce a human-readable description of this status.
A class for representing either a usable value, or an error.
A Result object either contains a value of type T
or a Status object explaining why such a value is not present. The type T
must be copy-constructible and/or move-constructible.
The state of a Result object may be determined by calling ok() or status(). The ok() method returns true if the object contains a valid value. The status() method returns the internal Status object. A Result object that contains a valid value will return an OK Status for a call to status().
A value of type T
may be extracted from a Result object through a call to ValueOrDie(). This function should only be called if a call to ok() returns true. Sample usage:
arrow::Result<Foo> result = CalculateFoo(); if (result.ok()) { Foo foo = result.ValueOrDie(); foo.DoSomethingCool(); } else { ARROW_LOG(ERROR) << result.status(); }
If T
is a move-only type, like std::unique_ptr<>
, then the value should only be extracted after invoking std::move()
on the Result object. Sample usage:
arrow::Result<std::unique_ptr<Foo>> result = CalculateFoo(); if (result.ok()) { std::unique_ptr<Foo> foo = std::move(result).ValueOrDie(); foo->DoSomethingCool(); } else { ARROW_LOG(ERROR) << result.status(); }
Result is provided for the convenience of implementing functions that return some value but may fail during execution. For instance, consider a function with the following signature:
arrow::Status CalculateFoo(int *output);
This function may instead be written as:
arrow::Result<int> CalculateFoo();
Public Functions
Constructs a Result object that contains a non-OK status.
This constructor is marked explicit
to prevent attempts to return {}
from a function with a return type of, for example, Result<std::vector<int>>
. While return {}
seems like it would return an empty vector, it will actually invoke the default constructor of Result.
Constructs a Result object with the given non-OK Status object.
All calls to ValueOrDie() on this object will abort. The given status
must not be an OK status, otherwise this constructor will abort.
This constructor is not declared explicit so that a function with a return type of Result<T>
can return a Status object, and the status will be implicitly converted to the appropriate return type as a matter of convenience.
status â The non-OK Status object to initialize to.
Constructs a Result object that contains value
.
The resulting object is considered to have an OK status. The wrapped element can be accessed with ValueOrDie().
This constructor is made implicit so that a function with a return type of Result<T>
can return an object of type U &&
, implicitly converting it to a Result<T>
object.
Note that T
must be implicitly constructible from U
, and U
must not be a (cv-qualified) Status or Status-reference type. Due to C++ reference-collapsing rules and perfect-forwarding semantics, this constructor matches invocations that pass value
either as a const reference or as an rvalue reference. Since Result needs to work for both reference and rvalue-reference types, the constructor uses perfect forwarding to avoid invalidating arguments that were passed by reference. See http://thbecker.net/articles/rvalue_references/section_08.html for additional details.
value â The value to initialize to.
Constructs a Result object that contains value
.
The resulting object is considered to have an OK status. The wrapped element can be accessed with ValueOrDie().
This constructor is made implicit so that a function with a return type of Result<T>
can return an object of type T
, implicitly converting it to a Result<T>
object.
value â The value to initialize to.
Copy constructor.
This constructor needs to be explicitly defined because the presence of the move-assignment operator deletes the default copy constructor. In such a scenario, since the deleted copy constructor has stricter binding rules than the templated copy constructor, the templated constructor cannot act as a copy constructor, and any attempt to copy-construct a Result
object results in a compilation error.
other â The value to copy from.
Templatized constructor that constructs a Result<T>
from a const reference to a Result<U>
.
T
must be implicitly constructible from const U &
.
other â The value to copy from.
Copy-assignment operator.
other â The Result object to copy.
Templatized constructor which constructs a Result<T>
by moving the contents of a Result<U>
.
T
must be implicitly constructible from U &&
.
Sets other
to contain a non-OK status with a StatusError::Invalid
error code.
other â The Result object to move from and set to a non-OK status.
Move-assignment operator.
Sets other
to an invalid state..
other â The Result object to assign from and set to a non-OK status.
Compare to another Result.
Indicates whether the object contains a T
value.
Generally instead of accessing this directly you will want to use ASSIGN_OR_RAISE defined below.
True if this Result objectâs status is OK (i.e. a call to ok() returns true). If this function returns true, then it is safe to access the wrapped element through a call to ValueOrDie().
Equivalent to ok().
Gets the stored status object, or an OK status if a T
value is stored.
The stored non-OK status object, or an OK status if this object has a value.
Gets the stored status object, or an OK status if a T
value is stored.
The stored non-OK status object, or an OK status if this object has a value.
Gets the stored T
value.
This method should only be called if this Result objectâs status is OK (i.e. a call to ok() returns true), otherwise this call will abort.
The stored T
value.
Gets a mutable reference to the stored T
value.
This method should only be called if this Result objectâs status is OK (i.e. a call to ok() returns true), otherwise this call will abort.
The stored T
value.
Moves and returns the internally-stored T
value.
This method should only be called if this Result objectâs status is OK (i.e. a call to ok() returns true), otherwise this call will abort. The Result object is invalidated after this call and will be updated to contain a non-OK status.
The stored T
value.
Helper method for implementing Status returning functions in terms of semantically equivalent Result returning functions.
For example:
Status GetInt(int *out) { return GetInt().Value(out); }
Move and return the internally stored value or alternative if an error is stored.
Retrieve the value if ok(), falling back to an alternative generated by the provided factory.
Apply a function to the internally stored value to produce a new result or propagate the stored error.
Apply a function to the internally stored value to produce a new result or propagate the stored error.
Cast the internally stored value to produce a new result or propagate the stored error.
Cast the internally stored value to produce a new result or propagate the stored error.
Subclassed by parquet::HiddenColumnException, parquet::KeyAccessDeniedException, parquet::ParquetStatusException
Propagate any non-successful Status to the caller.
Execute an expression that returns a Result, extracting its value into the variable defined by lhs
(or returning a Status on error).
Example: Assigning to a new value: ARROW_ASSIGN_OR_RAISE(auto value, MaybeGetValue(arg));
Example: Assigning to an existing value: ValueType value; ARROW_ASSIGN_OR_RAISE(value, MaybeGetValue(arg));
WARNING: ARROW_ASSIGN_OR_RAISE expands into multiple statements; it cannot be used in a single statement (e.g. as the body of an if statement without {})!
WARNING: ARROW_ASSIGN_OR_RAISE std::move
s its right operand. If you have an lvalue Result which you donât want to move out of cast appropriately.
WARNING: ARROW_ASSIGN_OR_RAISE is not a single expression; it will not maintain lifetimes of all temporaries in rexpr
(e.g. ARROW_ASSIGN_OR_RAISE(auto x, MakeTemp().GetResultRef());
will most likely segfault)!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4