The MaxCompute compiler is developed based on the new-generation SQL engine of MaxCompute V2.0. The compiler significantly simplifies SQL compilation and improves SQL expressions. This topic describes how to use the errors and alerts that are reported in the MaxCompute compiler to check and modify a script.

Background information

  • We recommend that you use the MaxCompute compiler together with MaxCompute Studio to improve the usability of the MaxCompute compiler. For more information about how to install MaxCompute Studio, see Install MaxCompute Studio.
  • Before you submit scripts, we recommend that you use the MaxCompute compiler to perform static compilation checks for the scripts. We recommend that you enable the syntax highlighting feature by selecting Enable syntax coloring when you configure MaxCompute SQL configuration items. For more information about the configuration items, see MaxCompute SQL configuration items.

Use errors to check and modify a script

  • Compiler error display
    In the compiler shown in the following figure, if you move the pointer over the red digit, the error information expect 1 columns, actually have 2 is displayed. Compiler error display
  • Script execution resultScript execution result
  • Error description

    In this example, the src table contains two columns. When you execute an INSERT statement to insert data into the table, a value in a specific column is not specified in the VALUES parameter.

Use alerts to check and modify a script

  • Compiler alert display
    In the compiler shown in the following figure, if you move the pointer over the letter that is marked with a yellow background, the alert information implicit conversion from STRING to DOUBLE, potential data loss, use CAST function to suppress is displayed. Compiler alert display
  • Alert description
    The implicit conversion from STRING to DOUBLE may cause data loss. You must use the CAST function to convert the data type. For more information about data type conversions, see Type conversions.
    Note
    • To save time and resources, we recommend that you clear all alerts before you run scripts.
    • If you submit a script that contains errors, the health score of your MaxCompute project is deducted. This lowers the priorities of the subsequent jobs that you submit. In later versions of MaxCompute, if you submit a script that contains uncleared alerts, the health score of your MaxCompute project is also deducted. Therefore, you can use the errors and alerts in the MaxCompute compiler to prevent priority downgrade.