Skip to content

[Feature][core] add parameters in json format #1392

@aubdiy

Description

@aubdiy

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

新增个 -pj 参数, 用于接收 json 格式的自定义参数

Use case

  • commond
bin/start-chunjun                              \
    -mode local                                \
    -jobType sync                              \
    -chunjunDistDir chunjun-dist               \
    -job stream.json                           \
    -p a=a1,b=b1                               \
    -pj '{"c":123,"d":"ddd"}'
  • stream.json
{
  "job": {
    "content": [
      {
        "reader": {
          "parameter": {
            "column": [
              {
                "name": "id",
                "type": "id"
              },
              {
                "name": "name",
                "type": "string"
              },
              {
                "name": "content",
                "type": "string"
              },
              {
                "name": "${a}_${b}_${c}_${d}",
                "type": "string"
                
              }
            ],
            "sliceRecordCount": [
              "2"
            ],
            "permitsPerSecond": 1
          },
          "table": {
            "tableName": "sourceTable"
          },
          "name": "streamreader"
        },
        "writer": {
          "parameter": {
            "column": [
              {
                "name": "id",
                "type": "id"
              },
              {
                "name": "name",
                "type": "string"
              }
            ],
            "print": true
          },
          "table": {
            "tableName": "sinkTable"
          },
          "name": "streamwriter"
        },
        "transformer": {
          "transformSql": "select id,name from sourceTable where CHAR_LENGTH(name) < 50 and CHAR_LENGTH(content) < 50"
        }
      }
    ],
    "setting": {
      "errorLimit": {
        "record": 100
      },
      "speed": {
        "bytes": 0,
        "channel": 1,
        "readerChannel": 1,
        "writerChannel": 1
      }
    }
  }
}

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestthis is a feature requests on the product

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions