Topsy maxcompute Studio SQL Editor

Source: Internet
Author: User

Summary:Because of its simple and easy to learn, SQL is the main means for users to interact with Maxcompute services. How to help users write SQL efficiently and happily is the core mission of Maxcompute Studio, let's take a look at the following: Forget the syntax to believe that everyone has forgotten how to write SQL, once forgotten, I am afraid to go around to find documents and code samples, forced to leave the focus of SQL Editor, which greatly affects efficiency.

Because of its simple and easy to learn, SQL is the main means for users to interact with Maxcompute services. How to help users write SQL efficiently and happily is the core mission of Maxcompute Studio, let's explore:

Forget grammar

I believe everyone has forgotten how to write SQL, once forgotten, I am afraid that can only go around to find documents and code samples, forced to leave the focus of SQL Editor, the impact of efficiency. In studio, we have integrated a large number of Maxcompute SQL syntax templates that you can call out with just one shortcut key. For example, I now want to add a column to the table, but do not know the SQL syntax, then use the shortcut keys (Windows:ctrl + j, Mac:? + j) to call out the live template, enter the column keyword search Syntax template, here we choose ALTER TABLE add c Olumn:

At this point, the syntax template for adding columns is inserted immediately in SQL Editor, and you simply continue to enter tables and columns (use tab to toggle between elements to be edited)

Forget schema

The SQL syntax is structured, and the next step is to fill in the various entity elements (mainly including tables and functions). Similarly, do I have to memorize the table name or function name in order to complete SQL? Of course not, studio wants what you think:

List and search

What tables and functions are present under project?

    • In Project Explorer you can get a global view:

    • Using the shortcut key (Windows:ctrl+alt+shift+n mac:?+?+o) to call out navigate symbol, enter the table name or function name search:

Double-click an entity in Project Explorer or select an entity in navigate symbol to display its details.

Smart Tips

Studio will give the appropriate smart hints based on the syntax context of the current cursor position, selecting it without entering:

Schema Association
    • When you hover over a table name, the schema of the table is displayed:

    • When hovering over a function name, a function signature is displayed:

Defining jumps

Further, if you want to view the entity details, then:

    • Table: Holding down the CTRL key, click to open the Table Details window, including the presentation of sample data.

    • Custom Function: Ctrl-click to display its source code (Java is a jar of anti-compilation, Python is the source).

    • Built-in functions: (Windows:ctrl + Q Mac:ctrl + J) call out the Help document:

Code detection

In addition to satisfying the syntax, SQL also defines rules to detect potential problems with the SQL you write, such as:

The full list of rules can be viewed at preference-editor-inspections-maxcompute.

Easy to read

SQL is written, and you need to read and understand what it means. The following features are supported for this studio, allowing users to read SQL.

Syntax highlighting

Different types of characters in SQL will have different highlighting colors, and error messages will appear when there is a syntax error:

Brace matching and code folding
    • Click the opening parenthesis, and the closing parenthesis paired with it are highlighted, and vice versa.

    • When the SQL is longer, you can click on the left side of the folding button, the sentence folded up to facilitate the elimination of interference.


Formatting

A good format can help us to better understand the SQL structure, and when it comes to a cluttered SQL, the first step you need to do is format (shortcut CTRL + ALT + L). At the same time, studio supports custom formatting rules (such as keyword capitalization, line wrapping, etc.), which can be configured on the following page:

Visualization of

Click on the Graph tab on the lower left side of SQL Editor to show the SQL structure as a pot chart, for example (the corresponding SQL text select * from hy_test):

At this time, this graph is not high, and we will improve it, making it as beautiful as the SQL Runtime's job graph.

Use Find

Sometimes we want to know which scripts a table (or function) is used in so that we can better understand the processing logic of the table. Then, you can select the table in the editor and the right-click menu to select Find Usages, then all scripts that use the table are searched under current IntelliJ project:

Run partial execution

If you want to execute some of the statements in SQL, you can:

    • Select the text segment you want to execute with the mouse and click the Run button:

    • Executes a single statement (with the SET statement with SET statements) using the Gutter icon on the left sidebar:

Console Seamless Integration

You can run console commands such as the GRANT statement directly in SQL Editor, or you can click the Console icon on toolbar to open a Maxcompute console window and enter the console command:

Run history

All SQL that was submitted to run through studio we are all recorded on this machine, you can click on the icon on the toolbar, pop up the SQL History window, query the SQL you have executed:

Original link


Topsy maxcompute Studio SQL Editor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.