Arrow: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
m (Translate)
Line 1: Line 1:
<translate>
[https://arrow.apache.org/ Apache Arrow] is a cross-language development platform for in-memory data. It specifies a standardized language-independent columnar memory format for flat and hierarchical data, organized for efficient analytic operations on modern hardware. It also provides computational libraries and zero-copy streaming messaging and interprocess communication. Languages currently supported include C, C++, C#, Go, Java, JavaScript, MATLAB, Python, R, Ruby, and Rust.
[https://arrow.apache.org/ Apache Arrow] is a cross-language development platform for in-memory data. It specifies a standardized language-independent columnar memory format for flat and hierarchical data, organized for efficient analytic operations on modern hardware. It also provides computational libraries and zero-copy streaming messaging and interprocess communication. Languages currently supported include C, C++, C#, Go, Java, JavaScript, MATLAB, Python, R, Ruby, and Rust.


Line 69: Line 70:


For more information on its usage, see [https://arrow.apache.org/docs/r/index.html Arrow R documentation]
For more information on its usage, see [https://arrow.apache.org/docs/r/index.html Arrow R documentation]
</translate>

Revision as of 18:02, 26 March 2020

Apache Arrow is a cross-language development platform for in-memory data. It specifies a standardized language-independent columnar memory format for flat and hierarchical data, organized for efficient analytic operations on modern hardware. It also provides computational libraries and zero-copy streaming messaging and interprocess communication. Languages currently supported include C, C++, C#, Go, Java, JavaScript, MATLAB, Python, R, Ruby, and Rust.

CUDA

Arrow is also available with CUDA.

Question.png
[name@server ~]$ module load gcc/8.3.0 arrow/0.16.0 cuda/10.1

Python bindings

The module contains bindings for multiple python versions. To discover which are the compatible Python versions:

Question.png
[name@server ~]$ module spider arrow/0.16.0

PyArrow

The Arrow Python bindings (also named PyArrow) have first-class integration with NumPy, pandas, and built-in Python objects. They are based on the C++ implementation of Arrow.

1. Load the required modules:

Question.png
[name@server ~]$ module load gcc/8.3.0 arrow/0.16.0 python/3.7 scipy-stack

2. Import PyArrow

Question.png
[name@server ~]$ python -c "import pyarrow"

The command display nothing. You have successfully imported PyArrow.

For more information, see the Arrow Python documentation.

Apache Parquet Format

The Parquet file format is available.

To import it, execute previous steps for pyarrow, then :

Question.png
[name@server ~]$ python -c "import pyarrow.parquet"

The command display nothing. You have successfully imported the Parquet module.

R bindings

The arrow package exposes an interface to the Arrow C++ library to access many of its features in R. This includes support for analyzing large, multi-file datasets (open_dataset()), working with individual Parquet (read_parquet(), write_parquet()) and Feather (read_feather(), write_feather()) files, as well as lower-level access to Arrow memory and messages.

Installation

1. Load the required modules:

Question.png
[name@server ~]$ module load gcc/8.3.0 arrow/0.16.0 r/3.6 boost/1.68.0

2. Specify the local installation directory:

[name@server ~]$ mkdir -p ~/.local/R/$EBVERSIONR/
[name@server ~]$ export R_LIBS=~/.local/R/$EBVERSIONR/


3. Export the required variables to ensure we are using the system installation:

[name@server ~]$ export PKG_CONFIG_PATH=$EBROOTARROW/lib/pkgconfig
[name@server ~]$ export INCLUDE_DIR=$EBROOTARROW/include
[name@server ~]$ export LIB_DIR=$EBROOTARROW/lib


4. Install the bindings

Question.png
[name@server ~]$ R -e 'install.packages("arrow", repos="https://cloud.r-project.org/")'

Usage

Once installed, you can load the bindings.

1. Load the required modules:

Question.png
[name@server ~]$ module load gcc/8.3.0 arrow/0.16.0 r/3.6

2. Load the library:

Question.png
[name@server ~]$ R -e "library(arrow)"
> library("arrow")
Attaching package: ‘arrow’

For more information on its usage, see Arrow R documentation