[Internal] Flat file data source provider - an ODA run-time extension.

Package Specification

The ODA flat file driver serves as an exemplary implementation of the ODA run-time interfaces. It performs basic data source provider functionalities including:

Consuming the ODA flat file driver

Data store format

The flat file ODA driver expects that both meta-data (including column names and data types) and data are kept in a single CSV file. The first line of a CSV file specifies data column names. The second line may optionally specify the column data types. The remaining portion of the file contains data.

Redundant Spaces

Redundant spaces are allowed in a CSV file, but will be trimmed once processed by the flat file driver.

Double Quotes

Double Quotes can be used in a CSV file for the purpose of clarity. The quotes, however, will be trimmed once processed by the driver. That is, a line in CSV file like is processed to be the same as the following line: A comma within a pair of double quotes would not be treated as separator. For example, contains a single column value. It is not considered the same as the following line: because the second case is processed to contain three columnn values, i.e. "I'm", "however", and "a really normal String".

Null Values

Null values are allowed. They are presented as blanks, and are comma-separated from other data. A CSV file that contains only one column, and all the data is of null value will be treated as an empty table.

Data Types

Flat file driver currently supports the following data types:
INT, DOUBLE,STRING,DATE,TIME,TIMESTAMP and BIGDECIMAL.
Support for BLOB and CLOB data types will be added in future. The driver's data type codes are defined as follows:

SQL-like Query Syntax

The flat file driver supports limited SQL-like query syntax. The supported syntax is:
(those in square brackets are optional): The query text is case in-sensitive and allows redundant spaces. The flat file driver does not support multiple tables in the FROM clause. For example, a table is named "employee.csv" with columns "Id", "Name" and "HireDate", the following queries are valid: However, the following queries are invalid: