本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
表达式和文字
值表达式
值表达式由以下语法定义:
value-expression := <character-expression > | <number-expression> | <datetime-expression> | <interval-expression> | <boolean-expression>
字符(字符串)表达式
字符表达式由以下语法定义:
character-expression := <character-literal> | <character-expression> || <character-expression> | <character-function> ( <parameters> ) character-literal := <quote> { <character> }* <quote> string-literal := <quote> { <character> }* <quote> character-function := CAST | COALESCE | CURRENT_PATH | FIRST_VALUE | INITCAP | LAST_VALUE | LOWER | MAX | MIN | NULLIF | OVERLAY | SUBSTRING| SYSTEM_USER | TRIM | UPPER | <user-defined-function>
请注意,Amazon Kinesis Data Analytics 直播 SQL 支持 unicode 字符文字,例如 u&'foo'。与使用常规文字一样,你可以避开这些文字中的单引号,比如 u&'can "t'。与常规文字不同,你可以使用 unicode 转义符:例如,u&'\ 0009' 是一个仅由制表符组成的字符串。你可以用另一个\ 来逃避\,比如 u&'back\\ slash'。Amazon Kinesis Data Analytics 还支持备用转义字符,比如 u&'! 0009!!' uescape '!' 是一个制表符。
数字ereion
数字ereion ereion reion reion reion on
number-expression := <number-literal> | <number-unary-oper> <number-expression> | <number-expression> <number-operator> <number-expression> | <number-function> [ ( <parameters> ) ] number-literal := <UNSIGNED_INTEGER_LITERAL> | <DECIMAL_NUMERIC_LITERAL> | <APPROX_NUMERIC_LITERAL>
--Note: An <APPROX_NUMERIC_LITERAL> is a number in scientific notation, such as with an --exponent, such as 1e2 or -1.5E-6. number-unary-oper := + | - number-operator := + | - | / | * number-function := ABS | AVG | CAST | CEIL | CEILING | CHAR_LENGTH | CHARACTER_LENGTH | COALESCE | COUNT | EXP | EXTRACT | FIRST_VALUE | FLOOR | LAST_VALUE | LN | LOG10 | MAX | MIN | MOD | NULLIF | POSITION | POWER | SUM| <user-defined-function>
日期/时间/时间ereion
日期/时间表达式由以下语法定义:
datetime-expression := <datetime-literal> | <datetime-expression> [ + | - ] <number-expression> | <datetime-function> [ ( <parameters> ) ] datetime-literal := <left_brace> { <character-literal> } * <right_brace> | <DATE> { <character-literal> } * | <TIME> { <character-literal> } * | <TIMESTAMP> { <character-literal> } * datetime-function := CAST | CEIL | CEILING | CURRENT_DATE | CURRENT_ROW_TIMESTAMP | CURRENT_ROW_TIMESTAMP | FIRST_VALUE| FLOOR | LAST_VALUE | LOCALTIME | LOCALTIMESTAMP | MAX | MIN | NULLIF | ROWTIME | <user-defined-function> <time unit> := YEAR | MONTH | DAY | HOUR | MINUTE | SECOND
时间间隔eon
时间间隔eon ereion on ereonion on on on on
interval-expression := <interval-literal> | <interval-function> interval-literal := <INTERVAL> ( <MINUS> | <PLUS> ) <QUOTED_STRING> <IntervalQualifier> IntervalQualifier := <YEAR> ( <UNSIGNED_INTEGER_LITERAL> ) | <YEAR> ( <UNSIGNED_INTEGER_LITERAL> ) <TO> <MONTH> | <MONTH> [ ( <UNSIGNED_INTEGER_LITERAL> ) ] | <DAY> [ ( <UNSIGNED_INTEGER_LITERAL> ) ] | <DAY> [ ( <UNSIGNED_INTEGER_LITERAL> ) ] <TO> { <HOUR> | <MINUTE> | <SECOND> [ ( <UNSIGNED_INTEGER_LITERAL> ) ] } | <HOUR> [ ( <UNSIGNED_INTEGER_LITERAL> ) ] | <HOUR> [ ( <UNSIGNED_INTEGER_LITERAL> ) ] <TO> { <MINUTE> | <SECOND> [ <UNSIGNED_INTEGER_LITERAL> ] } | <MINUTE> [ ( <UNSIGNED_INTEGER_LITERAL> ) ] | <MINUTE> [ ( <UNSIGNED_INTEGER_LITERAL> ) ] <TO> <SECOND> [ ( <UNSIGNED_INTEGER_LITERAL> ) ] | <SECOND> [ ( <UNSIGNED_INTEGER_LITERAL> ) ] interval-function := ABS | CAST | FIRST_VALUE | LAST_VALUE | MAX | MIN | NULLIF| <user-defined-function>
布尔值eion
布尔表达式由以下语法定义:
boolean-expression := <boolean-literal> | <boolean-expression> <boolean-operator> <boolean-expression> | <boolean-unary-oper> <boolean-expression> | <boolean-function> ( <parameters> ) | ( <boolean-expression> ) boolean-literal := TRUE | FALSE boolean-operator := AND | OR boolean-unary-oper := NOT boolean-function := CAST | FIRST_VALUE | LAST_VALUE | NULLIF | <user-defined-function>