SelectDB connector


SelectDB connector

Parent document: connectors

The SelectDB connector supports batch writing of data to the SelectDB cloud data warehouse, and provides flexible writing request construction.

Maven dependency


<dependency>
    <groupId>com.bytedance.bitsail</groupId>
    <artifactId>bitsail-connector-selectdb</artifactId>
    <version>${revision}</version>
</dependency>

SelectDB writer

Supported data type

Selectdb write connector uses json or csv format to transfer data, and the supported data types are:

  • CHAR
  • VARCHAR
  • TEXT
  • BOOLEAN
  • BINARY
  • VARBINARY
  • DECIMAL
  • DECIMALV2
  • INT
  • TINYINT
  • SMALLINT
  • INTEGER
  • INTERVAL_YEAR_MONTH
  • INTERVAL_DAY_TIME
  • BIGINT
  • LARGEINT
  • FLOAT
  • DOUBLE
  • DATE
  • DATETIME

Parameters

Write connector parameters are configured in job.writer, please pay attention to the path prefix when actually using it, for example:

{
  "job": {
    "writer": {
      "class": "com.bytedance.bitsail.connector.selectdb.sink.SelectdbSink",
      "cluster_name": "test_cluster",
      "table_identifier": "test_db.test_select_table"
    }
  }
}

Necessary parameters

Param nameRequiredDescription
classyesSelectdb writer class name,, com.bytedance.bitsail.connector.selectdb.sink.SelectdbSink
load_urlyesSelectdb HTTP upload address
jdbc_urlyesSelectdb JDBC query address
cluster_nameyesSelectdb cluster name
useryesSelectdb account user
passwordyesSelectdb account password
table_identifieryesWrite to the database table of Selectdb,like:test_db.test_select_table

Optional parameters

Param nameRequiredOptional valueDescription
writer_parallelism_numnoWriter parallelism num
sink_flush_interval_msnoFlush interval in upsert mode, default 5000 ms
sink_max_retriesnoMax retry times, default 3
sink_buffer_sizenoMax size of buffer, default 1048576 bytes (1MB)
sink_buffer_countnoMax number of records can be buffered, default 3
sink_enable_deletenoenable delete or no
sink_write_modenoCurrently only supported BATCH_UPSERTWrite mode
stream_load_propertiesnoStream load parameters that will be append to the stream load url. Format is standard json map
load_contend_typenocsv
json
Content format of streamload, default json
csv_field_delimiternofield delimiter used in csv, default ","
csv_line_delimiternoline delimiter used in csv, default "\n"

Configuration examples: selectdb-connector-example

SelectDB Cloud: selectdbopen in new window