Read File

Reads the content of files from various storage services.

A read operation happens according to the Read configuration. If reading On input, the input contains the used path. Otherwise, if reading Once, the path comes from the configuration.

The connection used varies with the Connection configuration. The Connection type From input is available only if reading On input. Otherwise, a static connection ID from Connection Management can be used.

For each opeation, the output is a file message. If Output in Batches is true, one operation may have many outputs.

The operator ignores directory inputs and produces no output. A directory input must have file.isDir set to true. Usually these inputs come from another operator such as List Files.

Supported services are:

Configuration Parameters

Name

ID

Type

Description

Read

mode

string

Mandatory. The operation mode. Details of each mode are found below. If Output in batches is enabled, each read operation may produce many outputs.

Accepted values:
  • On input: A read operation happens for every input received. The input informs the path to read from.

  • Once: A single read operation happens as soon as the graph is Running. The Path configuration informs the path to read from.

Default: "On input"

Connection (static)

connection

object

Points to the static connection to read from. Only available if Read is set to Once.

Default: {}

Connection (dynamic)

dynamicConnection

object

Points to the dynamic connection to read from. It uses the file connection attribute. Only available if Read is set to On input.

Default: {"configurationType":"From input"}

Path

path

string

Points to the file to read, relative to the used connection. It must be in the qualified name format. If the Connection is set with a connection ID, you may use the UI file browsing to set the path. Only available if Read is set to Once.

Default: /

Output in Batches

outputInBatches

bool

If true, each output uses batching attributes and has a body limited by Output batch size. Also, each operation may produce many outputs.

Default: false

Output Batch Size

outputBatchSize

string

The maximum number of bytes placed in each output message. The value allows metric prefixes and an optional "i" to state binary bases (examples below). It is useful to reduce graph latency and memory usage. Only available if Output in batches is set to true.

Example values:
  • "1", "1B": 1 byte

  • "2kb", "2KB": 2*103 bytes

  • "2kib", "2KiB": 2*210 bytes

  • "3mb", "3MB": 3*106 bytes

  • "3mib", "3MiB": 3*220 bytes

Default: 1MB

Input

Input

Type

Description

ref

message.fileReference

A file message pointing to the file to read. The body is ignored. If it is a directory, the operator ignores it, producing no output.

Output

Output

Type

Description

file

message.file

A file message with the contents of the file in the body. The message also has the updated connection, path, and size values in the file attribute.

error

message.error

An Error Message, in case an error was raised during an operation.