File source

eKuiper provides built-in support for reading file content into the eKuiper processing pipeline. The file source is usually used as a table and it is the default type for create table statement.

  1. create table table1 (
  2. name STRING,
  3. size BIGINT,
  4. id BIGINT
  5. ) WITH (DATASOURCE="lookup.json", FORMAT="json", TYPE="file");

You can use cli or rest api to manage the tables.

The configure file for the file source is in /etc/sources/file.yaml in which the path to the file can be specified.

  1. default:
  2. fileType: json
  3. # The directory of the file relative to eKuiper root or an absolute path.
  4. # Do not include the file name here. The file name should be defined in the stream data source
  5. path: data
  6. # The interval between reading the files, time unit is ms. If only read once, set it to 0
  7. interval: 0

With this yaml file, the table will refer to the file ${eKuiper}/data/lookup.json and read it in json format.