Create Script | Teradata AppCenter - Creating Scripts - Teradata AppCenter

Teradata® AppCenter User Guide

Product
Teradata AppCenter
Release Number
1.10
Published
March 2020
Language
English (United States)
Last Update
2020-08-14
dita:mapPath
upm1569351452724.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-1111
lifecycle
previous
Product Category
Analytical Ecosystem
"" 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 SQL statements:
      • CREATE
      • DELETE
      • DROP
      • INSERT
      • JOIN
      • TRUNCATE
      • UPDATE
        The SQL parameter can list data from only one column. Therefore, you cannot use * or multiple projections on the table. For example, you cannot use:
        Select * from table-name;
        Select col1,col2,col3 from table-name;
    • SQL type fields include an Allow user to select multiple values from this query option. When you run the script, AppCenter allows you to select multiple values for the query based on the associated database table values.
    • Example query statement:

      select * from cfilter_demo where col1_item2 in (${Param});
      The in clause ${Param} represents the whole thing and does not require a single quote.
    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