Skip to main content
Version: 2.1.1

Tidb

Description

Read data from Tidb.

tip

Engine Supported and plugin name

  • Spark: Tidb
  • Flink

Env Options

nametyperequireddefault value
spark.tispark.pd.addressesstringyes-
spark.sql.extensionsstringyesorg.apache.spark.sql.TiExtensions
spark.tispark.pd.addresses [string]

your pd servers

spark.sql.extensions [string]

default value : org.apache.spark.sql.TiExtensions

Options

nametyperequireddefault value
databasestringyes-
pre_sqlstringyes-
database [string]

Tidb database

pre_sql [string]

sql script

common options [string]

Source Plugin common parameters, refer to Source Plugin for details

Example

env {
spark.tispark.pd.addresses = "192.168.0.1:2379"
spark.sql.extensions = "org.apache.spark.sql.TiExtensions"
}

source {
tidb {
database = "test"
pre_sql = "select * from table1"
}
}