Text Source - rambabu-chamakuri/PSTL-DOC GitHub Wiki

The Text Source is a specific subset of the of the File Source. As such, File Source options may also be configured on a Text Source. As always, the path option of the File Source must be configured. Please review the File Source if you are not already familiar with it.

The Text Source is relatively primitive, as it simply reads a file line by line. Each line in the file becomes a single row, with one column. The underlying data type of this column can be coerced by the user as needed. Similarly, the user can provide a column name up front, otherwise the column name defaults to value. You can find a few examples below to help you understand these constraints.

CREATE STREAM foo
FROM TEXT
OPTIONS(
  'path'='/path/to/data'
);

In the above example, the user provides no type or column name coercion, they should expect the table foo to have a single column named value of type string.

CREATE STREAM foo(value binary)
FROM TEXT
OPTIONS(
  'path'='/path/to/data'
);

In the above example, the user provides explicit type and column name coercion, they should expect the table foo to have a single column named value of type binary.

CREATE STREAM foo(key int, value binary)
FROM TEXT
OPTIONS(
  'path'='/path/to/data'
);

In the above example, the user provides explicit type and column name coercion, however, they have violated one of the Text Source constraints: it only provides one column. As a result, the user should expect this to fail.

Options

The Text Source does not have any additional options.