GithubHelp home page GithubHelp logo

isabella232 / argument-setter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from data-integrations/argument-setter

0.0 0.0 0.0 59 KB

A argument setter plugin

Home Page: http://docs.cask.co/cdap

License: Apache License 2.0

Java 100.00%

argument-setter's Introduction

Argument Setter

cm-available CDAP Action License Join CDAP community

Argument Setter is a type of Action plugin that allows one to create reusable pipelines by dynamically substituting the configurations that can be served by an HTTP Server. It uses the Macro capabilities provided by CDAP.

Usage

Following is a simple example of a configuration that can be served by HTTP server to this plugin.

{
  "arguments" : [
    { "name" : "input.path", "type" : "string", "value" : "/Users/nitin/Work/Demo/data/titanic.xlsx" },
    { "name" : "rulebook", "type" : "import", "value" : "http://localhost:11015/v3/namespaces/default/apps/yare/services/service/rulebook/MyRuleBook" },
    { "name" : "parser", "type" : "array", "value" :
      [
        "parse-as-excel body , true",
        "drop body",
        "set columns PassengerId,Survived,Pclass,Name,Sex,Age,SibSp,Parch,Ticket,Fare,Cabin,Embarked",
        "filter-row-if-matched Age Age"
        "cut-character Sex Sex 1",
        "uppercase Sex",
        "rename Sex Gender",
        "keep PassengerId, Name",
        "fill-null-or-empty Age 0"
      ]
    },
    {
      "name" : "output.schema", "type" : "schema", "value" :
      [
        { "name" : "PassengerId", "type" : "string", "nullable" : true},
        { "name" : "Name", "type" : "string", "nullable" : true}
      ]
    },
    { "name" : "dq.checks", "type" : "array", "value" :
      [
        "filter-rows-on regex-match Name .*James.*"
      ]
    },
    { "name" : "stage.path", "type" : "string", "value" : "titanic_excel"}
  ]
}

The configuration is made up of collection of Arguments and Arguments defines all the configurations for one or more pipelines qualified by macro names.

{
    "arguments" : [
        { argument }, { argument }, ..., {argument}
    ]
}

Each argument is made up of following fields

  • Name -- Defines the name of the argument or macro name.
  • Type -- Defines the type of argument. It can be either int, float, double, short, string, schema, char, array or map. &
  • Value -- Defines the value based on the type.

Argument Types

Following are the argument types supported by the system:

Argument Type Type Description
import Defines the type that imports the value using a HTTP invocation
schema Defines the value to be of schema type that is defined as combination of name, type and nullable
int Defines the value as integer type
float Defines the value as float type
double Defines the value as double type
short Defines the value as short type
string Defines the value as string type
char Defines the value as char type
array Defines the value as array of string type
map Defines the value of map

argument-setter's People

Contributors

albertshau avatar bdmogal avatar cdap-apps avatar curiousvini avatar elfenheart avatar nitinmotgi avatar nliu132 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.