名称:引导 描述:从模板创建新的Starlake项目
引导技能
创建一个新的Starlake项目,包含标准目录结构和启动配置文件。可选地使用命名模板来搭建一个包含样本数据和配置的项目。
用法
starlake bootstrap [options]
选项
--template <value>: 使用的模板名称(默认:交互式选择)。示例:quickstart,simple--no-exit: 在项目创建后保持JVM运行(用于测试)--reportFormat <value>: 报告输出格式:console,json, 或html
生成的项目结构
my-project/
├── metadata/
│ ├── application.sl.yml # 全局配置,连接
│ ├── env.sl.yml # 环境变量
│ ├── types/
│ │ └── default.sl.yml # 数据类型定义
│ ├── load/
│ │ └── {domain}/
│ │ ├── _config.sl.yml # 域配置
│ │ └── {table}.sl.yml # 表模式
│ ├── transform/
│ │ └── {domain}/
│ │ ├── _config.sl.yml # 转换默认值
│ │ └── {task}.sql # SQL转换
│ ├── dags/ # 编排DAG配置
│ ├── expectations/ # 数据质量宏
│ └── extract/ # 提取配置
├── datasets/ # 处理数据存储
├── incoming/ # 原始数据着陆区
└── sample-data/ # 示例数据集
关键配置文件
application.sl.yml
version: 1
application:
connectionRef: "{{connectionRef}}"
audit:
sink:
connectionRef: "{{connectionRef}}"
connections:
duckdb:
type: "jdbc"
options:
url: "jdbc:duckdb:{{SL_ROOT}}/datasets/duckdb.db"
driver: "org.duckdb.DuckDBDriver"
bigquery:
type: "bigquery"
options:
location: "europe-west1"
authType: "APPLICATION_DEFAULT"
dagRef:
load: "airflow_load_shell"
transform: "airflow_transform_shell"
env.sl.yml
version: 1
env:
root_path: "{{SL_ROOT}}"
incoming_path: "{{SL_ROOT}}/datasets/incoming"
connectionRef: duckdb
示例
通过交互式选择引导
starlake bootstrap
使用快速启动模板引导
starlake bootstrap --template quickstart
使用简单模板引导
starlake bootstrap --template simple