SQL statements are stored as part of the query instance for the object. If the same query is being made across multiple users using private connections, the SQL must be shared and entered by individual users.
NOTE: If a dataset created from custom SQL is shared, collaborators are not permitted to edit the custom SQL.
SQL statements must be valid for the syntax of the target relational system. Syntax examples are provided below.
- If you modify the custom SQL statement when reading from a source, all samples generated based on the previous SQL are invalidated.
Declared variables are not supported.
- For each SQL statement, all columns must have an explicit name. Example:
Function references such as:
Must be specified as:
UPPER(col) as col_name
When using custom SQL to read from a Hive view, the results of a nested function are saved to a temporary name, unless explicitly aliased.
- If aliases are not used, the temporary column names can cause jobs to fail, on Spark in particular.
- For more information, see Using Hive.
The following limitations apply to creating datasets from a single statement.
All single-statement SQL queries must begin with a
Selecting columns with the same name, even with
"*", is not supported and generates an ambiguous column name error.
Tip: You should use fully qualified column names or proper aliasing. See Column Aliasing below.
Users are encouraged to provide fully qualified path to table being used. Example:
SELECT "id", "value" FROM "public"."my_table"
- You should use proper escaping in SQL.
D s config method ws
Locate the following setting:
Enable custom SQL Query
trueto enable the SQL pushdown featureability to create datasets using customized SQL statements. By default, this feature is enabled.