Skip to content

Databend Reader ​

DatabendReader plugin implements reading data from Databend.

Note that Databend has MySQL client protocol compatible implementation, so you can directly use MySQL Reader to read Databend data.

Example ​

We can start Databend database in the following way

bash
docker run  -tid  --rm  -p 8000:8000 \
   -e QUERY_DEFAULT_USER=databend \
   -e QUERY_DEFAULT_PASSWORD=databend \
   datafuselabs/databend

Then create a table to read

sql
(
	id int,
	name varchar(255),
	salary float,
	created_at datetime,
	updated_at datetime
);

And populate necessary data

The following configuration reads this table to terminal:

json
{
  "job": {
    "setting": {
      "speed": {
        "bytes": -1,
        "channel": 1
      }
    },
    "content": {
      "reader": {
        "name": "databendreader",
        "parameter": {
          "column": [
            "*"
          ],
          "connection": {
            "jdbcUrl": "jdbc:databend://127.0.0.1:8000/default",
            "table": [
              "addax_reader"
            ]
          },
          "username": "databend",
          "password": "databend"
        }
      },
      "writer": {
        "name": "streamwriter",
        "parameter": {
          "print": "true"
        }
      }
    }
  }
}

Save the above configuration file as job/databend2stream.json

Execute Collection Command ​

Execute the following command for data collection

bash
bin/addax.sh job/databend2stream.json

Parameters ​

This plugin is based on RDBMS Reader, so you can refer to all parameters of RDBMS Reader.

Limitations ​

None at the moment