LarkSheet connector-v1


LarkSheet connector-v1

Parent document: Connectors

The BitSail LarkSheet connector supports reading lark sheets. The main function points are as follows:

  • Support batch read from single or multiple lark sheets at once.
  • Support authentication by static token and applicationopen in new window.
  • Support read a portion of columns from sheets.

Maven dependency

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

LarkSheet reader

Supported data types

BitSail LarkSheet reader processes all data as string.

Parameters

The following mentioned parameters should be added to job.reader block when using, for example:

{
  "job": {
    "reader": {
      "class": "com.bytedance.bitsail.connector.legacy.larksheet.source.LarkSheetInputFormat",
      "sheet_urls": "https://e4163pj5kq.feishu.cn/sheets/shtcnQmZNlZ9PjZUJKT5oU3Sjjg?sheet=ZbzDHq",
      "columns": [
        {
          "name": "id",
          "type": "string"
        },
        {
          "name": "datetime",
          "type": "string"
        }
      ]
    }
  }
}

Necessary parameters

Param nameRequiredOptional valueDescription
classYesLarkSheet reader class name, com.bytedance.bitsail.connector.legacy.larksheet.source.LarkSheetInputFormat
sheet_urlsYesA list of sheet to read. Multi sheets urls are separated by comma.
columnsYesDescribing fields' names and types.

The following parameters are for authentication, you have to set (sheet_token) or (app_id and app_secret) in your configuration.

Param nameRequiredOptional valueDescription
sheet_tokenAt least set one:
1. sheet_token
2. app_id and app_secret
Token for get permission to visit feishu open api.
app_idUse app_id and app_secret to generate token for visiting feishu open api.
app_secret

Note that if you use sheet_token, it may expire when the job runs. If you use app_id and app_secret, the token will be refreshed if it expires.

Optional parameters

Param nameRequiredOptional valueDescription
reader_parallelism_numNoRead parallelism num
batch_sizeNoNumber of lines extracted once.
skip_numsnoA list of numbers indicating how many lines should be skipped in each sheet.

Configuration examples: LarkSheet connector example