SQL-MapReduce Query Syntax - Aster Analytics

Teradata Aster® Analytics Foundation User GuideUpdate 2

Product
Aster Analytics
Release Number
7.00.02
Published
September 2017
Language
English (United States)
Last Update
2018-04-17
dita:mapPath
uce1497542673292.ditamap
dita:ditavalPath
AA-notempfilter_pdf_output.ditaval
dita:id
B700-1022
lifecycle
previous
Product Category
Software

The SQL-MapReduce function syntax allows one or more partitioned inputs and zero or more dimensional inputs.

SELECT [ ALL | 
         DISTINCT [ ON ( expression [,...] ) ] |
         * |
         expression [ [ AS ] output_name ][,...]
       ]
  FROM sqlmr_function_name (on_clause function_argument) [[ AS ] alias ][,...]
  [ WHERE condition ]
  [ GROUP BY expression [,...] ]
  [ HAVING condition [,...] ]
  [ ORDER BY expression [ ASC | DESC ][ NULLS { FIRST | LAST } ][,...] ]
  [ LIMIT { count | ALL } ]
  [ OFFSET start ];

on_clause is:

{ partition_any_input | partition_attributes_input | dimensional_input }

partition_any_input is:

table_input PARTITION BY { ANY [ORDER BY expression] | table_input [ order_by ] }

partition_attributes_input is:

table_input PARTITION BY p_attribute_set [order_by]

dimensional_input is:

table_input DIMENSION [ order_by]

table_input is:

ON table_expression [AS alias]

table_expression is:

{ table_name | view_name | (query) }
sqlmr_function_name
Name of a SQL-MapReduce function that you have installed in Aster Database. If the sqlmr_function_name contains uppercase letters, you must enclose it in double quotation marks (").
on_clause
Provides the input data on which the function operates. This data is composed of one or more partitioned inputs and zero or more dimensional inputs.
partition_any_input
Expressions that partition the input data before the function operates on it.
partition_attributes_input
Expressions that partition the input data before the function operates on it.
p_attribute_set
One or more partition keys to use to partition the input data before the function operates on it.
dimensional_input
Expression that replicates the input data to all nodes before the function operates on it.
order_by
[Optional] Expression that sorts the input data after partitioning, but before the function operates on it.
table_input
For rules about when an alias is required, see Rules for Table Aliases.
function_argument
[Optional] Argument clause that typically modifies the behavior of the SQL-MapReduce function. Do not confuse argument clauses with input data: Input data is the data on which the function operates; argument clauses provide runtime parameters. You pass an argument clause in the form argument_name (literal [, ...]), where argument_name is the name of the argument clause (as defined in the function) and literal is the value to be assigned to that argument. You can pass multiple argument clause blocks, separated from the next argument clause block with whitespace (not commas).

The preceding syntax focuses on SQL-MapReduce. For the complete syntax of the SELECT statement, including the WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, and OFFSET clauses, see the Teradata Aster® Database User Guide for Aster Appliances or Teradata Aster® Database User Guide for Commodity Hardware.