跳到主要内容
版本:2.1.0

Tidb

Source plugin: Tidb [Spark]

Description

Read data from Tidb.

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"
}
}