Creating Scripts

Teradata® AppCenter User Guide

prodname
Teradata AppCenter
vrm_release
1.8
category
User Guide
featnum
B035-1111-039K
User, Administrator
  1. Select > Develop > CREATE.
  2. Enter a name up to 64 characters for this script, then select Script and a type.
    Once you save the basic information, you cannot change script type.
  3. On Setup Guide, select Script Code, then enter or upload code, or link to a GitHub rep.
    Option Considerations
    Upload or enter code ()
    • Once you upload a script, the code appears and you can add to or edit it.
    • If you upload a script file, you can switch to pulling from a GitHub repo when you create the script or edit it.
    • You can add parameters for an SQL Query to make it more generic and shareable. A parameter can be defined as “${schema}”, where schema is the parameter that accepts different values.

      For example:

      SELECT * FROM “${table}”

    Pull from GitHub repo ()
    • Once you pull from a GitHub repo, the code appears and you can add to it or edit it.
    • If you pull from a GitHub repo, you can switch to uploading a file when you create the script or edit it.
    • When you select FETCH FILES, AppCenter selects the first script file from the repo that passes the successful match test and displays it in Default File. Specifically, if the names of the files in the repository branch match queries, query, init, cmd, or command, AppCenter selects the first of those as the driver file. If you want to select another file in the repo, select , select the file, then select SYNC REPO.
    If the code includes environment variables, AppCenter automatically adds them to Settings when you save the code.
  4. [Optional] Select Description to select tags and enter a description.
    Option Considerations
    Add Tags
    • Tags are created by an administrator, and are optional.
    • In Add Tags, start typing the name of a tag, then select it.
    • You can select one or more tags for an app.
    • For additional tags, contact an administrator.
    Description
    • AppCenter supports plain text or GitHub Markdown.
    • For assistance with GitHub Markdown syntax, select in the formatting toolbar.
  5. Select Permissions to set user and script permissions.
    Option Considerations
    Managers
    • When you create a script, you are the script owner. You can add managers by user name and LDAP groups. Managers you add are considered owners.
    Privacy
    • Scripts are private by default. You can turn privacy off. For private scripts, only the script owner and other users they added as managers, can view, edit, and delete the script.
  6. Select Settings to add and remove required and optional settings for users who run this script.
    Option Consideration
    Default System Config Select the default system that this script will run against, then enter system settings.
    ADD FIELD
    • The Name field does not support spaces.
    • Hint is a brief description of the parameter that appears when a user runs the script.
    • If you add a parameter and select Upload as the type, AppCenter prompts you to upload the parameters file when you run a job for this script.
    • If you select Required for a setting and it is not part of the job execution parameters, the job will fail.
    • For scripts with an SQL type parameter, the SQL parameter supports simple SQL queries. It does not support the following queries:
      • CREATE
      • DELETE
      • DROP
      • INSERT
      • JOIN
      • TRUNCATE
      • UPDATE
      • "*"
      • ","
    Parameter actions
    • To edit, reorder, or delete parameters, select .
    • The order of the parameters here determines the order in which they are displayed when you run the script.
    Visualizations
    • Only SQL scripts support visualizations, including built-in and custom visualizations.
    • If you added visualization parameters, AppCenter generates visualizations based on the number of queries in the Script File file you uploaded.
    • The code for each visualization type must include --name= type, followed by the SQL. For an example, see Visualization Code Example for SQL Scripts.
    • If you select Custom (Upload) as the Type, follow the instructions on the screen for installing and running Node.js and Polymer Bundler to upload the resulting bundled file with the visualization.
    • If the SQL file includes a SELECT statement and no query tag, AppCenter generates a table visualization. For example, AppCenter will generate one table visualization based on the following SQL file:
      SELECT * FROM cfilter_demo LIMIT 100;
      If the SQL file includes a SELECT statement and a query tag, AppCenter generates a chart visualization. For example, AppCenter will generate one chart visualization based on the following SQL file:
      --name=query1
      SELECT * FROM cfilter_demo LIMIT 100;
  7. [Optional] Select Script Overview, then on Script Info change the script icon and color, Memory, and CPU settings.
    Option Considerations
    Icon and color
    • AppCenter automatically assigns a script icon and color. You can change one or both settings.
    Memory
    • Accept the default settings.
      Teradata recommends that you change the Memory and CPU values only if you encounter messages or errors that indicate limited resources. For example, if you run a job and it remains in the state of waiting for resources. If a job fails due to memory issues, an error log is generated and available from Execution History.
    CPU