write

Write distributed data to an output location

Syntax

write(location, D)

Description

example

write(location, D) writes the values in the distributed array D to files in the folder location. The data is stored in an efficient binary format suitable for reading back using datastore(location).

Examples

collapse all

       d = distributed.rand(5000,1);
       location = 'hdfs://myHadoopCluster/some/output/folder';
       write(location, d);
       ds = datastore(location);
       d1 = distributed(ds);
       ds = datastore(location);
       t1 = tall(ds);

Input Arguments

collapse all

Folder location to write data, specified as a character vector or string. location can specify a full or relative path. The specified folder can be either of these options:

  • Existing empty folder that contains no other files

  • New folder that write creates

Example: location = 'hdfs://myHadoopCluster/some/output/folder'

Example: location = '../../dir/data'

Example: location = 'C:\Users\MyName\Desktop'

Data Types: char | string

Input array, specified as a distributed array.

Introduced in R2017a

Was this topic helpful?