连接加载技能Skill cnxload

此技能用于将Parquet、CSV或JSON文件直接加载到JDBC数据库表,提供快速数据导入功能,支持多种数据库驱动和并行写入选项,适用于数据集成、ETL开发和数据仓库场景,关键词包括:数据加载、JDBC、Parquet、CSV、JSON、数据库连接、ETL、批量处理。

ETL开发 0 次安装 0 次浏览 更新于 3/15/2026

名称: cnxload 描述: 将文件(Parquet/CSV/JSON)加载到JDBC表

连接加载技能

直接从Parquet、CSV或JSON文件加载数据到JDBC数据库表。这提供了一种简单的方式将数据推入任何JDBC兼容的数据库,无需经过完整的Starlake加载管道。

使用方法

starlake cnxload [选项]

选项

  • --source_file <值>: 源文件的完整路径(必需)。支持Parquet、CSV、JSON
  • --output_table <值>: 目标JDBC表,格式为 模式.表(必需)
  • --options k1=v1,k2=v2: JDBC连接选项:
    • driver: JDBC驱动类(例如 org.postgresql.Driver
    • user: 数据库用户
    • password: 数据库密码
    • url: JDBC URL(例如 jdbc:postgresql://localhost:5432/mydb
    • partitions: 并行写入的分区数
    • batchSize: 插入的批处理大小
  • --write_strategy <值>: 写入策略:APPENDOVERWRITE
  • --reportFormat <值>: 报告输出格式:consolejsonhtml

示例

加载Parquet到PostgreSQL

starlake cnxload \
  --source_file /data/orders.parquet \
  --output_table public.orders \
  --options driver=org.postgresql.Driver,url=jdbc:postgresql://localhost:5432/mydb,user=admin,password=secret \
  --write_strategy APPEND

加载CSV到数据库

starlake cnxload \
  --source_file /data/customers.csv \
  --output_table public.customers \
  --options driver=org.postgresql.Driver,url=jdbc:postgresql://localhost:5432/mydb,user=admin,password=secret \
  --write_strategy OVERWRITE

加载带批处理选项

starlake cnxload \
  --source_file /data/orders.parquet \
  --output_table sales.orders \
  --options driver=com.mysql.cj.jdbc.Driver,url=jdbc:mysql://localhost:3306/mydb,user=root,password=secret,batchSize=5000 \
  --write_strategy APPEND

相关技能