edit-icon download-icon

Tools

Last Updated: Aug 17, 2018

Contents

SQL scripts

You can use the SQL script editor to write SQL syntaxes. For more information, see MaxCompute SQL Introduction.

Demo

  1. Drag a MaxCompute source component to the canvas and enter the table name in the right pane, as shown in the following figure.

    image

    • A SQL Script component supports a maximum of two input ports.

    • If a partitioned table is input, the system automatically selects the Partition option for the table. You can then select a partition or enter a partition name. Currently, only one partition can be specified. If the Partition option is not selected or no partition name is specified, the system determines that a full table is input.

    • The Partition option is unavailable when an unpartitioned table is input.

  2. Drag a SQL script component to the canvas, connect the component to the MaxCompute source component, and click the SQL Script component. The parameters appear, as shown in the following figure.
    image
    Enter SQL syntaxes, as shown in the following figure:
    image

    • A SQL Script Component supports a maximum of two input ports and one output port.

    • You can enter only one SQL syntax, for details see SQL Expressions.

    • Input tables are mapped to t1 and t2, respectively. You can use ${t1} or ${t2} to make a call to the relevant table without a need to specify the table name.

    • The SQL script in the preceding figure is used to calculate the number of rows in the table.

  3. Drag a MaxCompute target component to the Canvas and enter a new table name, as shown in the following figure. The system then automatically creates the table. If you want to input a partitioned table, you must enter partition information.
    image
    Currently, partitioned tables are not supported.

  4. Connect all components and then click Run.
    image

  5. Right-click the MaxCompute target component and select View Data.
    image

PAI commands

No PAI commands are available.

Thank you! We've received your feedback.