[#7727] Support parsing DEGREES() as a synonym for DEGREE() and DEG(), and RADIANS() for RADIAN(), RAD()

This commit is contained in:
lukaseder 2018-08-08 10:01:40 +02:00
parent d1b571ddd3
commit d2a6a0f04c
2 changed files with 8 additions and 4 deletions

View File

@ -634,7 +634,7 @@ term =
| 'DAY' '(' field ')'
| 'DECODE' '(' field ',' field ',' field { ',' field } ')'
| 'DENSE_RANK' ( '(' ')' over | '(' fields ')' withinGroup )
| ( 'DEG' | 'DEGREE' ) '(' sum ')'
| ( 'DEG' | 'DEGREE' | 'DEGREES' ) '(' sum ')'
| 'EXTRACT' '(' datePart 'FROM' field ')'
| 'EXP' '(' sum ')'
| 'EVERY' '(' field ')' [ filter ] [ over ]
@ -711,7 +711,7 @@ term =
| 'RANK' ( '(' ')' over | '(' fields ')' withinGroup )
| 'ROUND' '(' field [ ',' unsignedInteger ] ')'
| 'ROWNUM'
| ( 'RAD' | 'RADIAN' ) '(' sum ')'
| ( 'RAD' | 'RADIAN' | 'RADIANS' ) '(' sum ')'
| 'ROW' '(' fields ')'
| ( 'SUBSTR' | 'SUBSTRING' ) '(' field ',' sum [ ',' sum ] ')'
| 'SECOND' '(' field ')'

View File

@ -4433,7 +4433,9 @@ final class ParserImpl implements Parser {
return field;
else if ((field = parseFieldDayIf(ctx)) != null)
return field;
else if (parseFunctionNameIf(ctx, "DEGREE") || parseFunctionNameIf(ctx, "DEG"))
else if (parseFunctionNameIf(ctx, "DEGREES")
|| parseFunctionNameIf(ctx, "DEGREE")
|| parseFunctionNameIf(ctx, "DEG"))
return deg((Field) parseFieldSumParenthesised(ctx));
if ((field = parseFieldDecodeIf(ctx)) != null)
@ -4645,7 +4647,9 @@ final class ParserImpl implements Parser {
return field;
else if (parseKeywordIf(ctx, "ROWNUM"))
return rownum();
else if (parseFunctionNameIf(ctx, "RADIAN") || parseFunctionNameIf(ctx, "RAD"))
else if (parseFunctionNameIf(ctx, "RADIANS")
|| parseFunctionNameIf(ctx, "RADIAN")
|| parseFunctionNameIf(ctx, "RAD"))
return rad((Field) parseFieldSumParenthesised(ctx));
if (parseFunctionNameIf(ctx, "ROW"))