You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by al...@apache.org on 2024/09/19 07:37:51 UTC

(ignite) branch master updated: IGNITE-22991 SQL Calcite: Update Calcite version to 1.37 - Fixes #11478.

This is an automated email from the ASF dual-hosted git repository.

alexpl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new d6b30366919 IGNITE-22991 SQL Calcite: Update Calcite version to 1.37 - Fixes #11478.
d6b30366919 is described below

commit d6b303669198b86d889c28487eed0a841ef66158
Author: Aleksey Plekhanov <pl...@gmail.com>
AuthorDate: Thu Sep 19 10:34:36 2024 +0300

    IGNITE-22991 SQL Calcite: Update Calcite version to 1.37 - Fixes #11478.
    
    Signed-off-by: Aleksey Plekhanov <pl...@gmail.com>
---
 docs/_docs/SQL/sql-calcite.adoc                    |     2 +-
 modules/calcite/pom.xml                            |     2 +-
 modules/calcite/src/main/codegen/config.fmpp       |     6 +
 .../query/calcite/exec/exp/RexImpTable.java        |   363 +-
 .../query/calcite/exec/exp/RexToLixTranslator.java |    55 +
 .../query/calcite/exec/exp/agg/Accumulators.java   |    46 +
 .../query/calcite/externalize/RelJson.java         |     1 +
 .../query/calcite/externalize/RelJsonReader.java   |    14 +-
 .../query/calcite/prepare/PlannerPhase.java        |     3 +
 .../calcite/sql/fun/IgniteStdSqlOperatorTable.java |    12 +
 .../calcite/sql/generated/IgniteSqlParserImpl.java | 22812 ++++++++++---------
 .../generated/IgniteSqlParserImplConstants.java    |  1418 +-
 .../generated/IgniteSqlParserImplTokenManager.java | 22123 +++++++++---------
 .../processors/query/calcite/trait/TraitUtils.java |     5 +
 .../exec/rel/HashAggregateExecutionTest.java       |     1 +
 .../query/calcite/integration/IntervalTest.java    |     5 +-
 .../calcite/integration/StdSqlOperatorsTest.java   |    10 +-
 .../query/calcite/planner/PlannerTest.java         |    59 -
 .../calcite/planner/SerializationPlannerTest.java  |    93 +
 .../calcite/planner/SortAggregatePlannerTest.java  |     2 +-
 .../apache/ignite/testsuites/PlannerTestSuite.java |     4 +-
 21 files changed, 24416 insertions(+), 22620 deletions(-)

diff --git a/docs/_docs/SQL/sql-calcite.adoc b/docs/_docs/SQL/sql-calcite.adoc
index ddeaab14640..547d1192faa 100644
--- a/docs/_docs/SQL/sql-calcite.adoc
+++ b/docs/_docs/SQL/sql-calcite.adoc
@@ -150,7 +150,7 @@ The Calcite-based SQL engine currently supports:
 |`UPPER`, `LOWER`, `INITCAP`, `TO_BASE64`, `FROM_BASE64`, `MD5`, `SHA1`, `SUBSTRING`, `LEFT`, `RIGHT`, `REPLACE`, `TRANSLATE`, `CHR`, `CHAR_LENGTH`, `CHARACTER_LENGTH`, `LENGTH`, `CONCAT`, `OVERLAY`, `POSITION`, `ASCII`, `REPEAT`, `SPACE`, `STRCMP`, `SOUNDEX`, `DIFFERENCE`, `REVERSE`, `TRIM`, `LTRIM`, `RTRIM`, `REGEXP_REPLACE`
 
 |Math functions
-|`MOD`, `EXP`, `POWER`, `LN`, `LOG10`, `ABS`, `RAND`, `RAND_INTEGER`, `ACOS`, `ASIN`, `ATAN`, `ATAN2`, `SQRT`, `CBRT`, `COS`, `COSH`, `COT`, `DEGREES`, `RADIANS`, `ROUND`, `SIGN`, `SIN`, `SINH`, `TAN`, `TANH`, `TRUNCATE`, `PI`
+|`MOD`, `EXP`, `POWER`, `LN`, `LOG10`, `ABS`, `RAND`, `RAND_INTEGER`, `ACOS`, `ACOSH`, `ASIN`, `ASINH`, `ATAN`, `ATANH`, `ATAN2`, `SQRT`, `CBRT`, `COS`, `COSH`, `COT`, `COTH`, `DEGREES`, `RADIANS`, `ROUND`, `SIGN`, `SIN`, `SINH`, `TAN`, `TANH`, `SEC`, `SECH`, `CSC`, `CSCH`, `TRUNCATE`, `PI`
 
 |Date and time functions
 |`EXTRACT`, `FLOOR`, `CEIL`, `TIMESTAMPADD`, `TIMESTAMPDIFF`, `LAST_DATE`, `DAYNAME`, `MONTHNAME`, `DAYOFMONTH`, `DAYOFWEEK`, `DAYOFYEAR`, `YEAR`, `QUARTER`, `MONTH`, `WEEK`, `HOUR`, `MINUTE`, `SECOND`, `TIMESTAMP_SECONDS`, `TIMESTAMP_MILLIS`, `TIMESTAMP_MICROS`, `UNIX_SECONDS`, `UNIX_MILLIS`, `UNIX_MICROS`, `UNIX_DATE`, `DATE_FROM_UNIX_DATE`, `DATE`, `TIME`, `DATETIME`, `CURRENT_TIME`, `CURRENT_TIMESTAMP`, `CURRENT_DATE`, `LOCALTIME`, `LOCALTIMESTAMP`
diff --git a/modules/calcite/pom.xml b/modules/calcite/pom.xml
index 57ee3a8013e..7b09999076c 100644
--- a/modules/calcite/pom.xml
+++ b/modules/calcite/pom.xml
@@ -36,7 +36,7 @@
     <!-- Module specific package versions -->
     <properties>
         <avatica.version>1.23.0</avatica.version>
-        <calcite.version>1.34.0</calcite.version>
+        <calcite.version>1.37.0</calcite.version>
         <checker.version>3.10.0</checker.version>
         <failureaccess.version>1.0.1</failureaccess.version>
         <immutables.version>2.8.2</immutables.version>
diff --git a/modules/calcite/src/main/codegen/config.fmpp b/modules/calcite/src/main/codegen/config.fmpp
index 8a6dde00bdf..9b0bb6c61e2 100644
--- a/modules/calcite/src/main/codegen/config.fmpp
+++ b/modules/calcite/src/main/codegen/config.fmpp
@@ -227,6 +227,7 @@ data: {
       "JSON_OBJECT"
       "JSON_OBJECTAGG"
       "JSON_QUERY"
+      "JSON_SCOPE"
       "JSON_VALUE"
       "LAG"
       "LANGUAGE"
@@ -273,6 +274,7 @@ data: {
       "ONE"
       "ONLY"
       "OPEN"
+      "ORDINAL"
       "OUT"
       "OVER"
       "OVERLAPS"
@@ -324,6 +326,9 @@ data: {
       "ROWS"
       "ROW_NUMBER"
       "RUNNING"
+      "SAFE_CAST"
+      "SAFE_OFFSET"
+      "SAFE_ORDINAL"
       "SAVEPOINT"
       "SCOPE"
       "SCROLL"
@@ -371,6 +376,7 @@ data: {
       "TRIM"
       "TRIM_ARRAY"
       "TRUNCATE"
+      "TRY_CAST"
       "UESCAPE"
       "UNIQUE"
       "UNKNOWN"
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java
index 433fb9d2963..39025437fe8 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java
@@ -16,8 +16,6 @@
  */
 package org.apache.ignite.internal.processors.query.calcite.exec.exp;
 
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Type;
@@ -28,7 +26,6 @@ import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import com.google.common.collect.ImmutableList;
 import org.apache.calcite.adapter.enumerable.EnumUtils;
@@ -63,6 +60,7 @@ import org.apache.calcite.sql.SqlKind;
 import org.apache.calcite.sql.SqlOperator;
 import org.apache.calcite.sql.SqlTableFunction;
 import org.apache.calcite.sql.SqlTypeConstructorFunction;
+import org.apache.calcite.sql.fun.SqlItemOperator;
 import org.apache.calcite.sql.fun.SqlStdOperatorTable;
 import org.apache.calcite.sql.fun.SqlTrimFunction;
 import org.apache.calcite.sql.type.SqlTypeName;
@@ -88,10 +86,16 @@ import static org.apache.calcite.linq4j.tree.ExpressionType.Negate;
 import static org.apache.calcite.linq4j.tree.ExpressionType.NotEqual;
 import static org.apache.calcite.linq4j.tree.ExpressionType.Subtract;
 import static org.apache.calcite.linq4j.tree.ExpressionType.UnaryPlus;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.ACOSH;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.ASINH;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.ATANH;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.CHR;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.COMPRESS;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.CONCAT_FUNCTION;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.COSH;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.COTH;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.CSC;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.CSCH;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.DATE;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.DATETIME;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.DATE_FROM_UNIX_DATE;
@@ -101,6 +105,7 @@ import static org.apache.calcite.sql.fun.SqlLibraryOperators.EXISTS_NODE;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.EXTRACT_VALUE;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.EXTRACT_XML;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.FROM_BASE64;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.ILIKE;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_DEPTH;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_KEYS;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_LENGTH;
@@ -109,12 +114,16 @@ import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_REMOVE;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_STORAGE_SIZE;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_TYPE;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.LEFT;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.LOG;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.MD5;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.MONTHNAME;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.REGEXP_REPLACE;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.REPEAT;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.REVERSE;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.RIGHT;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.RLIKE;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.SEC;
+import static org.apache.calcite.sql.fun.SqlLibraryOperators.SECH;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.SHA1;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.SINH;
 import static org.apache.calcite.sql.fun.SqlLibraryOperators.SOUNDEX;
@@ -202,16 +211,18 @@ import static org.apache.calcite.sql.fun.SqlStdOperatorTable.MINUS;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.MINUS_DATE;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.MOD;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.MULTIPLY;
+import static org.apache.calcite.sql.fun.SqlStdOperatorTable.NEGATED_POSIX_REGEX_CASE_INSENSITIVE;
+import static org.apache.calcite.sql.fun.SqlStdOperatorTable.NEGATED_POSIX_REGEX_CASE_SENSITIVE;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.NOT;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.NOT_EQUALS;
-import static org.apache.calcite.sql.fun.SqlStdOperatorTable.NOT_LIKE;
-import static org.apache.calcite.sql.fun.SqlStdOperatorTable.NOT_SIMILAR_TO;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.OCTET_LENGTH;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.OR;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.OVERLAY;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.PI;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.PLUS;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.POSITION;
+import static org.apache.calcite.sql.fun.SqlStdOperatorTable.POSIX_REGEX_CASE_INSENSITIVE;
+import static org.apache.calcite.sql.fun.SqlStdOperatorTable.POSIX_REGEX_CASE_SENSITIVE;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.POWER;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.RADIANS;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.RAND;
@@ -230,6 +241,7 @@ import static org.apache.calcite.sql.fun.SqlStdOperatorTable.TRUNCATE;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.UNARY_MINUS;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.UNARY_PLUS;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.UPPER;
+import static org.apache.calcite.util.ReflectUtil.isStatic;
 import static org.apache.ignite.internal.processors.query.calcite.sql.fun.IgniteOwnSqlOperatorTable.GREATEST2;
 import static org.apache.ignite.internal.processors.query.calcite.sql.fun.IgniteOwnSqlOperatorTable.LEAST2;
 import static org.apache.ignite.internal.processors.query.calcite.sql.fun.IgniteOwnSqlOperatorTable.NULL_BOUND;
@@ -321,30 +333,42 @@ public class RexImpTable {
         defineMethod(MOD, "mod", NullPolicy.STRICT);
         defineMethod(EXP, "exp", NullPolicy.STRICT);
         defineMethod(POWER, "power", NullPolicy.STRICT);
-        defineMethod(LN, "ln", NullPolicy.STRICT);
-        defineMethod(LOG10, "log10", NullPolicy.STRICT);
         defineMethod(ABS, "abs", NullPolicy.STRICT);
 
-        map.put(RAND, new RandImplementor());
-        map.put(RAND_INTEGER, new RandIntegerImplementor());
-
-        defineMethod(ACOS, "acos", NullPolicy.STRICT);
-        defineMethod(ASIN, "asin", NullPolicy.STRICT);
-        defineMethod(ATAN, "atan", NullPolicy.STRICT);
-        defineMethod(ATAN2, "atan2", NullPolicy.STRICT);
-        defineMethod(CBRT, "cbrt", NullPolicy.STRICT);
-        defineMethod(COS, "cos", NullPolicy.STRICT);
-        defineMethod(COSH, "cosh", NullPolicy.STRICT);
-        defineMethod(COT, "cot", NullPolicy.STRICT);
-        defineMethod(DEGREES, "degrees", NullPolicy.STRICT);
-        defineMethod(RADIANS, "radians", NullPolicy.STRICT);
-        defineMethod(ROUND, "sround", NullPolicy.STRICT);
-        defineMethod(SIGN, "sign", NullPolicy.STRICT);
-        defineMethod(SIN, "sin", NullPolicy.STRICT);
-        defineMethod(SINH, "sinh", NullPolicy.STRICT);
-        defineMethod(TAN, "tan", NullPolicy.STRICT);
-        defineMethod(TANH, "tanh", NullPolicy.STRICT);
-        defineMethod(TRUNCATE, "struncate", NullPolicy.STRICT);
+        map.put(LN, new LogImplementor());
+        map.put(LOG, new LogImplementor());
+        map.put(LOG10, new LogImplementor());
+
+        defineReflective(RAND, BuiltInMethod.RAND.method,
+            BuiltInMethod.RAND_SEED.method);
+        defineReflective(RAND_INTEGER, BuiltInMethod.RAND_INTEGER.method,
+            BuiltInMethod.RAND_INTEGER_SEED.method);
+
+        defineMethod(ACOS, BuiltInMethod.ACOS.method, NullPolicy.STRICT);
+        defineMethod(ACOSH, BuiltInMethod.ACOSH.method, NullPolicy.STRICT);
+        defineMethod(ASIN, BuiltInMethod.ASIN.method, NullPolicy.STRICT);
+        defineMethod(ASINH, BuiltInMethod.ASINH.method, NullPolicy.STRICT);
+        defineMethod(ATAN, BuiltInMethod.ATAN.method, NullPolicy.STRICT);
+        defineMethod(ATAN2, BuiltInMethod.ATAN2.method, NullPolicy.STRICT);
+        defineMethod(ATANH, BuiltInMethod.ATANH.method, NullPolicy.STRICT);
+        defineMethod(CBRT, BuiltInMethod.CBRT.method, NullPolicy.STRICT);
+        defineMethod(COS, BuiltInMethod.COS.method, NullPolicy.STRICT);
+        defineMethod(COSH, BuiltInMethod.COSH.method, NullPolicy.STRICT);
+        defineMethod(COT, BuiltInMethod.COT.method, NullPolicy.STRICT);
+        defineMethod(COTH, BuiltInMethod.COTH.method, NullPolicy.STRICT);
+        defineMethod(CSC, BuiltInMethod.CSC.method, NullPolicy.STRICT);
+        defineMethod(CSCH, BuiltInMethod.CSCH.method, NullPolicy.STRICT);
+        defineMethod(DEGREES, BuiltInMethod.DEGREES.method, NullPolicy.STRICT);
+        defineMethod(RADIANS, BuiltInMethod.RADIANS.method, NullPolicy.STRICT);
+        defineMethod(ROUND, BuiltInMethod.SROUND.method, NullPolicy.STRICT);
+        defineMethod(SEC, BuiltInMethod.SEC.method, NullPolicy.STRICT);
+        defineMethod(SECH, BuiltInMethod.SECH.method, NullPolicy.STRICT);
+        defineMethod(SIGN, BuiltInMethod.SIGN.method, NullPolicy.STRICT);
+        defineMethod(SIN, BuiltInMethod.SIN.method, NullPolicy.STRICT);
+        defineMethod(SINH, BuiltInMethod.SINH.method, NullPolicy.STRICT);
+        defineMethod(TAN, BuiltInMethod.TAN.method, NullPolicy.STRICT);
+        defineMethod(TANH, BuiltInMethod.TANH.method, NullPolicy.STRICT);
+        defineMethod(TRUNCATE, BuiltInMethod.STRUNCATE.method, NullPolicy.STRICT);
 
         map.put(PI, new PiImplementor());
 
@@ -391,31 +415,30 @@ public class RexImpTable {
         map.put(IS_NOT_FALSE, new IsNotFalseImplementor());
 
         // LIKE and SIMILAR
-        final MethodImplementor likeImplementor =
-            new MethodImplementor(BuiltInMethod.LIKE.method, NullPolicy.STRICT,
-                false);
-        map.put(LIKE, likeImplementor);
-        map.put(NOT_LIKE, likeImplementor);
-        final MethodImplementor similarImplementor =
-            new MethodImplementor(BuiltInMethod.SIMILAR.method, NullPolicy.STRICT,
-                false);
-        map.put(SIMILAR_TO, similarImplementor);
-        map.put(NOT_SIMILAR_TO, NotImplementor.of(similarImplementor));
+        defineReflective(LIKE, BuiltInMethod.LIKE.method,
+            BuiltInMethod.LIKE_ESCAPE.method);
+        defineReflective(ILIKE, BuiltInMethod.ILIKE.method,
+            BuiltInMethod.ILIKE_ESCAPE.method);
+        defineReflective(RLIKE, BuiltInMethod.RLIKE.method);
+        defineReflective(SIMILAR_TO, BuiltInMethod.SIMILAR.method,
+            BuiltInMethod.SIMILAR_ESCAPE.method);
 
         // POSIX REGEX
-        final MethodImplementor posixRegexImplementorCaseSensitive =
-            new PosixRegexMethodImplementor(true);
-        final MethodImplementor posixRegexImplementorCaseInsensitive =
-            new PosixRegexMethodImplementor(false);
-        map.put(SqlStdOperatorTable.POSIX_REGEX_CASE_INSENSITIVE,
-            posixRegexImplementorCaseInsensitive);
-        map.put(SqlStdOperatorTable.POSIX_REGEX_CASE_SENSITIVE,
-            posixRegexImplementorCaseSensitive);
-        map.put(SqlStdOperatorTable.NEGATED_POSIX_REGEX_CASE_INSENSITIVE,
-            NotImplementor.of(posixRegexImplementorCaseInsensitive));
-        map.put(SqlStdOperatorTable.NEGATED_POSIX_REGEX_CASE_SENSITIVE,
-            NotImplementor.of(posixRegexImplementorCaseSensitive));
-        map.put(REGEXP_REPLACE, new RegexpReplaceImplementor());
+        ReflectiveImplementor insensitiveImplementor =
+            defineReflective(POSIX_REGEX_CASE_INSENSITIVE,
+                BuiltInMethod.POSIX_REGEX_INSENSITIVE.method);
+        ReflectiveImplementor sensitiveImplementor =
+            defineReflective(POSIX_REGEX_CASE_SENSITIVE,
+                BuiltInMethod.POSIX_REGEX_SENSITIVE.method);
+        map.put(NEGATED_POSIX_REGEX_CASE_INSENSITIVE,
+            NotImplementor.of(insensitiveImplementor));
+        map.put(NEGATED_POSIX_REGEX_CASE_SENSITIVE,
+            NotImplementor.of(sensitiveImplementor));
+        defineReflective(REGEXP_REPLACE,
+            BuiltInMethod.REGEXP_REPLACE3.method,
+            BuiltInMethod.REGEXP_REPLACE4.method,
+            BuiltInMethod.REGEXP_REPLACE5.method,
+            BuiltInMethod.REGEXP_REPLACE6.method);
 
         // Multisets & arrays
         defineMethod(CARDINALITY, BuiltInMethod.COLLECTION_SIZE.method,
@@ -477,10 +500,11 @@ public class RexImpTable {
         // Json Operators
         defineMethod(JSON_VALUE_EXPRESSION,
             BuiltInMethod.JSON_VALUE_EXPRESSION.method, NullPolicy.STRICT);
-        defineMethod(JSON_EXISTS, BuiltInMethod.JSON_EXISTS.method, NullPolicy.ARG0);
+        defineReflective(JSON_EXISTS, BuiltInMethod.JSON_EXISTS2.method,
+            BuiltInMethod.JSON_EXISTS3.method);
         map.put(JSON_VALUE,
             new JsonValueImplementor(BuiltInMethod.JSON_VALUE.method));
-        defineMethod(JSON_QUERY, BuiltInMethod.JSON_QUERY.method, NullPolicy.ARG0);
+        defineReflective(JSON_QUERY, BuiltInMethod.JSON_QUERY.method);
         defineMethod(JSON_TYPE, BuiltInMethod.JSON_TYPE.method, NullPolicy.ARG0);
         defineMethod(JSON_DEPTH, BuiltInMethod.JSON_DEPTH.method, NullPolicy.ARG0);
         defineMethod(JSON_KEYS, BuiltInMethod.JSON_KEYS.method, NullPolicy.ARG0);
@@ -542,28 +566,6 @@ public class RexImpTable {
         defineMethod(IS_NOT_DISTINCT_FROM, IgniteMethod.IS_NOT_DISTINCT_FROM.method(), NullPolicy.NONE);
     }
 
-    /** */
-    private <T> Supplier<T> constructorSupplier(Class<T> klass) {
-        final Constructor<T> constructor;
-        try {
-            constructor = klass.getDeclaredConstructor();
-        }
-        catch (NoSuchMethodException e) {
-            throw new IllegalArgumentException(
-                klass + " should implement zero arguments constructor");
-        }
-        return () -> {
-            try {
-                return constructor.newInstance();
-            }
-            catch (InstantiationException | IllegalAccessException
-                | InvocationTargetException e) {
-                throw new IllegalStateException(
-                    "Error while creating aggregate implementor " + constructor, e);
-            }
-        };
-    }
-
     /** */
     private void defineMethod(SqlOperator operator, String functionName, NullPolicy nullPolicy) {
         map.put(operator, new MethodNameImplementor(functionName, nullPolicy, false));
@@ -574,6 +576,13 @@ public class RexImpTable {
         map.put(operator, new MethodImplementor(method, nullPolicy, false));
     }
 
+    /** */
+    private ReflectiveImplementor defineReflective(SqlOperator operator, Method... methods) {
+        final ReflectiveImplementor implementor = new ReflectiveImplementor(ImmutableList.copyOf(methods));
+        map.put(operator, implementor);
+        return implementor;
+    }
+
     /** */
     private void defineUnary(SqlOperator operator, ExpressionType expressionType,
         NullPolicy nullPolicy, String backupMethodName) {
@@ -1010,32 +1019,9 @@ public class RexImpTable {
     }
 
     /**
-     * Implementor for {@link org.apache.calcite.sql.fun.SqlPosixRegexOperator}s.
-     */
-    private static class PosixRegexMethodImplementor extends MethodImplementor {
-        /** */
-        protected final boolean caseSensitive;
-
-        /** Constructor. */
-        PosixRegexMethodImplementor(boolean caseSensitive) {
-            super(BuiltInMethod.POSIX_REGEX.method, NullPolicy.STRICT, false);
-            this.caseSensitive = caseSensitive;
-        }
-
-        /** {@inheritDoc} */
-        @Override Expression implementSafe(RexToLixTranslator translator,
-            RexCall call, List<Expression> argValueList) {
-            assert argValueList.size() == 2;
-            // Add extra parameter (caseSensitive boolean flag), required by SqlFunctions#posixRegex.
-            final List<Expression> newOperands = new ArrayList<>(argValueList);
-            newOperands.add(Expressions.constant(caseSensitive));
-            return super.implementSafe(translator, call, newOperands);
-        }
-    }
-
-    /**
-     * Implementor for JSON_VALUE function, convert to solid format "JSON_VALUE(json_doc, path, empty_behavior,
-     * empty_default, error_behavior, error default)" in order to simplify the runtime implementation.
+     * Implementor for JSON_VALUE function, convert to solid format
+     * "JSON_VALUE(json_doc, path, empty_behavior, empty_default, error_behavior, error default)"
+     * in order to simplify the runtime implementation.
      *
      * <p>We should avoid this when we support
      * variable arguments function.
@@ -1049,7 +1035,6 @@ public class RexImpTable {
         /** {@inheritDoc} */
         @Override Expression implementSafe(RexToLixTranslator translator,
             RexCall call, List<Expression> argValueList) {
-            final Expression expression;
             final List<Expression> newOperands = new ArrayList<>();
             newOperands.add(argValueList.get(0));
             newOperands.add(argValueList.get(1));
@@ -1093,12 +1078,11 @@ public class RexImpTable {
             newOperands.add(dfltValOnEmpty);
             newOperands.add(errorBehavior);
             newOperands.add(dfltValOnError);
-            Class clazz = method.getDeclaringClass();
-            expression = EnumUtils.call(null, clazz, method.getName(), newOperands);
-
-            final Type returnType =
-                translator.typeFactory.getJavaClass(call.getType());
-            return EnumUtils.convert(expression, returnType);
+            List<Expression> argValList0 =
+                ConverterUtils.fromInternal(method.getParameterTypes(), newOperands);
+            final Expression target =
+                Expressions.new_(method.getDeclaringClass());
+            return Expressions.call(target, method, argValList0);
         }
     }
 
@@ -1625,7 +1609,29 @@ public class RexImpTable {
         }
     }
 
-    /** Implementor for the {@code ITEM} SQL operator. */
+    /** Implementor for indexing an array using the {@code ITEM} SQL operator
+     * and the {@code OFFSET}, {@code ORDINAL}, {@code SAFE_OFFSET}, and
+     * {@code SAFE_ORDINAL} BigQuery operators. */
+    private static class ArrayItemImplementor extends AbstractRexCallImplementor {
+        /** */
+        ArrayItemImplementor() {
+            super("array_item", NullPolicy.STRICT, false);
+        }
+
+        /** {@inheritDoc} */
+        @Override Expression implementSafe(final RexToLixTranslator translator,
+            final RexCall call, final List<Expression> argValueList) {
+            final SqlItemOperator itemOperator = (SqlItemOperator)call.getOperator();
+            return Expressions.call(BuiltInMethod.ARRAY_ITEM.method,
+                Expressions.list(argValueList)
+                    .append(Expressions.constant(itemOperator.offset))
+                    .append(Expressions.constant(itemOperator.safe)));
+        }
+    }
+
+    /** General implementor for indexing a collection using the {@code ITEM} SQL operator. If the
+     * collection is an array, an instance of the ArrayItemImplementor is used to handle
+     * additional offset and out-of-bounds behavior that is only applicable for arrays. */
     private static class ItemImplementor extends AbstractRexCallImplementor {
         /** */
         ItemImplementor() {
@@ -1639,16 +1645,16 @@ public class RexImpTable {
         /** {@inheritDoc} */
         @Override Expression implementSafe(final RexToLixTranslator translator,
             final RexCall call, final List<Expression> argValueList) {
-            final MethodImplementor implementor =
+            final AbstractRexCallImplementor implementor =
                 getImplementor(call.getOperands().get(0).getType().getSqlTypeName());
             return implementor.implementSafe(translator, call, argValueList);
         }
 
         /** */
-        private MethodImplementor getImplementor(SqlTypeName sqlTypeName) {
+        private AbstractRexCallImplementor getImplementor(SqlTypeName sqlTypeName) {
             switch (sqlTypeName) {
                 case ARRAY:
-                    return new MethodImplementor(BuiltInMethod.ARRAY_ITEM.method, nullPolicy, false);
+                    return new ArrayItemImplementor();
                 case MAP:
                     return new MethodImplementor(BuiltInMethod.MAP_ITEM.method, nullPolicy, false);
                 default:
@@ -2205,76 +2211,86 @@ public class RexImpTable {
         }
     }
 
-    /**
-     * Implementation that calls a given {@link Method}.
+    /** Implementor for the {@code LN}, {@code LOG}, and {@code LOG10} operators.
      *
-     * <p>When method is not static, a new instance of the required class is
-     * created.
+     * <p>Handles all logarithm functions using log rules to determine the
+     * appropriate base (i.e. base e for LN).
      */
-    private static class ReflectiveImplementor extends AbstractRexCallImplementor {
+    private static class LogImplementor extends AbstractRexCallImplementor {
         /** */
-        protected final Method method;
-
-        /** */
-        ReflectiveImplementor(Method method, NullPolicy nullPolicy) {
-            super("reflective_" + method.getName(), nullPolicy, false);
-            this.method = method;
+        LogImplementor() {
+            super("log", NullPolicy.STRICT, true);
         }
 
         /** {@inheritDoc} */
-        @Override Expression implementSafe(RexToLixTranslator translator,
-            RexCall call, List<Expression> argValueList) {
-            List<Expression> argValList0 = ConverterUtils.fromInternal(method.getParameterTypes(), argValueList);
-            if ((method.getModifiers() & Modifier.STATIC) != 0)
-                return Expressions.call(method, argValList0);
+        @Override Expression implementSafe(final RexToLixTranslator translator,
+            final RexCall call, final List<Expression> argValueList) {
+            return Expressions.call(BuiltInMethod.LOG.method, args(call, argValueList));
+        }
 
-            // The UDF class must have a public zero-args constructor.
-            // Assume that the validator checked already.
-            final Expression target = Expressions.new_(method.getDeclaringClass());
-            return Expressions.call(target, method, argValList0);
+        /** */
+        private static List<Expression> args(RexCall call,
+            List<Expression> argValueList) {
+            Expression operand0 = argValueList.get(0);
+            final Expressions.FluentList<Expression> list = Expressions.list(operand0);
+            switch (call.getOperator().getName()) {
+                case "LOG":
+                    if (argValueList.size() == 2)
+                        return list.append(argValueList.get(1));
+                    // fall through
+                case "LN":
+                    return list.append(Expressions.constant(Math.exp(1)));
+                case "LOG10":
+                    return list.append(Expressions.constant(BigDecimal.TEN));
+                default:
+                    throw new AssertionError("Operator not found: " + call.getOperator());
+            }
         }
     }
 
-    /** Implementor for the {@code RAND} function. */
-    private static class RandImplementor extends AbstractRexCallImplementor {
+    /**
+     * Implementation that a {@link java.lang.reflect.Method}.
+     *
+     * <p>If there are several methods in the list, calls the first that has the
+     * right number of arguments.
+     *
+     * <p>When method is not static, a new instance of the required class is
+     * created.
+     */
+    private static class ReflectiveImplementor extends AbstractRexCallImplementor {
         /** */
-        private final AbstractRexCallImplementor[] implementors = {
-            new ReflectiveImplementor(BuiltInMethod.RAND.method, nullPolicy),
-            new ReflectiveImplementor(BuiltInMethod.RAND_SEED.method, nullPolicy)
-        };
+        protected final ImmutableList<? extends Method> methods;
 
         /** */
-        RandImplementor() {
-            super("rand", NullPolicy.STRICT, false);
+        ReflectiveImplementor(List<? extends Method> methods) {
+            super("reflective_" + methods.get(0).getName(), NullPolicy.STRICT, false);
+            this.methods = ImmutableList.copyOf(methods);
         }
 
         /** {@inheritDoc} */
-        @Override Expression implementSafe(final RexToLixTranslator translator,
-            final RexCall call, final List<Expression> argValueList) {
-            return implementors[call.getOperands().size()]
-                .implementSafe(translator, call, argValueList);
+        @Override Expression implementSafe(RexToLixTranslator translator,
+            RexCall call, List<Expression> argValList) {
+            for (Method method : methods) {
+                if (method.getParameterCount() == argValList.size())
+                    return implementSafe(method, argValList);
+            }
+            throw new IllegalArgumentException("no matching method");
         }
-    }
 
-    /** Implementor for the {@code RAND_INTEGER} function. */
-    private static class RandIntegerImplementor extends AbstractRexCallImplementor {
         /** */
-        private final AbstractRexCallImplementor[] implementors = {
-            null,
-            new ReflectiveImplementor(BuiltInMethod.RAND_INTEGER.method, nullPolicy),
-            new ReflectiveImplementor(BuiltInMethod.RAND_INTEGER_SEED.method, nullPolicy)
-        };
-
-        /** */
-        RandIntegerImplementor() {
-            super("rand_integer", NullPolicy.STRICT, false);
-        }
-
-        /** {@inheritDoc} */
-        @Override Expression implementSafe(final RexToLixTranslator translator,
-            final RexCall call, final List<Expression> argValueList) {
-            return implementors[call.getOperands().size()]
-                .implementSafe(translator, call, argValueList);
+        protected MethodCallExpression implementSafe(Method method,
+            List<Expression> argValList) {
+            List<Expression> argValList0 =
+                ConverterUtils.fromInternal(method.getParameterTypes(),
+                    argValList);
+            if (isStatic(method))
+                return Expressions.call(method, argValList0);
+            else {
+                // The class must have a public zero-args constructor.
+                final Expression target =
+                    Expressions.new_(method.getDeclaringClass());
+                return Expressions.call(target, method, argValList0);
+            }
         }
     }
 
@@ -2406,29 +2422,6 @@ public class RexImpTable {
         }
     }
 
-    /** Implementor for the {@code REGEXP_REPLACE} function. */
-    private static class RegexpReplaceImplementor extends AbstractRexCallImplementor {
-        /** Implementors. */
-        private final AbstractRexCallImplementor[] implementors = {
-            new ReflectiveImplementor(BuiltInMethod.REGEXP_REPLACE3.method, nullPolicy),
-            new ReflectiveImplementor(BuiltInMethod.REGEXP_REPLACE4.method, nullPolicy),
-            new ReflectiveImplementor(BuiltInMethod.REGEXP_REPLACE5.method, nullPolicy),
-            new ReflectiveImplementor(BuiltInMethod.REGEXP_REPLACE6.method, nullPolicy),
-        };
-
-        /** */
-        RegexpReplaceImplementor() {
-            super("regexp_replace", NullPolicy.STRICT, false);
-        }
-
-        /** {@inheritDoc} */
-        @Override Expression implementSafe(RexToLixTranslator translator,
-            RexCall call, List<Expression> argValueList) {
-            return implementors[call.getOperands().size() - 3]
-                .implementSafe(translator, call, argValueList);
-        }
-    }
-
     /** Implementor for the {@code DEFAULT} function. */
     private static class DefaultImplementor extends AbstractRexCallImplementor {
         /** */
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexToLixTranslator.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexToLixTranslator.java
index e697948cc06..5de08f2f0e3 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexToLixTranslator.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexToLixTranslator.java
@@ -47,6 +47,8 @@ import org.apache.calcite.rex.RexCorrelVariable;
 import org.apache.calcite.rex.RexDynamicParam;
 import org.apache.calcite.rex.RexFieldAccess;
 import org.apache.calcite.rex.RexInputRef;
+import org.apache.calcite.rex.RexLambda;
+import org.apache.calcite.rex.RexLambdaRef;
 import org.apache.calcite.rex.RexLiteral;
 import org.apache.calcite.rex.RexLocalRef;
 import org.apache.calcite.rex.RexNode;
@@ -929,6 +931,22 @@ public class RexToLixTranslator implements RexVisitor<RexToLixTranslator.Result>
         return deref(localRef).accept(this);
     }
 
+    /** {@inheritDoc} */
+    @Override public Result visitLambdaRef(RexLambdaRef ref) {
+        final ParameterExpression valVariable =
+            Expressions.parameter(
+                typeFactory.getJavaClass(ref.getType()), ref.getName());
+
+        // Generate one line of code to check whether lambdaRef is null, e.g.,
+        // "final boolean input_isNull = $0 == null;"
+        final Expression isNullExpression = checkNull(valVariable);
+        final ParameterExpression isNullVariable =
+            Expressions.parameter(
+                Boolean.TYPE, list.newName("input_isNull"));
+        list.add(Expressions.declare(Modifier.FINAL, isNullVariable, isNullExpression));
+        return new Result(isNullVariable, valVariable);
+    }
+
     /**
      * Visit {@code RexLiteral}. If it has never been visited before, {@code RexToLixTranslator} will generate two lines
      * of code. For example, when visiting a primitive int (10), the generated code snippet is: {@code final int
@@ -1284,6 +1302,43 @@ public class RexToLixTranslator implements RexVisitor<RexToLixTranslator.Result>
         return visitInputRef(fieldRef);
     }
 
+    /** {@inheritDoc} */
+    @Override public Result visitLambda(RexLambda lambda) {
+        final RexNode expression = lambda.getExpression();
+        final List<RexLambdaRef> rexLambdaRefs = lambda.getParameters();
+
+        // Prepare parameter expressions for lambda expression
+        final ParameterExpression[] paramExpressions =
+            new ParameterExpression[rexLambdaRefs.size()];
+        for (int i = 0; i < rexLambdaRefs.size(); i++) {
+            final RexLambdaRef rexLambdaRef = rexLambdaRefs.get(i);
+            paramExpressions[i] =
+                Expressions.parameter(
+                    typeFactory.getJavaClass(rexLambdaRef.getType()), rexLambdaRef.getName());
+        }
+
+        // Generate code for lambda expression body
+        final RexToLixTranslator exprTranslator = setBlock(new BlockBuilder());
+        final Result exprResult = expression.accept(exprTranslator);
+        exprTranslator.list.add(
+            Expressions.return_(null, exprResult.valueVariable));
+
+        // Generate code for lambda expression
+        final Expression functionExpression =
+            Expressions.lambda(exprTranslator.list.toBlock(), paramExpressions);
+        final ParameterExpression valVariable =
+            Expressions.parameter(functionExpression.getType(), list.newName("function_value"));
+        list.add(Expressions.declare(Modifier.FINAL, valVariable, functionExpression));
+
+        // Generate code for checking whether lambda expression is null
+        final Expression isNullExpression = checkNull(valVariable);
+        final ParameterExpression isNullVariable =
+            Expressions.parameter(Boolean.TYPE, list.newName("function_isNull"));
+        list.add(Expressions.declare(Modifier.FINAL, isNullVariable, isNullExpression));
+
+        return new Result(isNullVariable, valVariable);
+    }
+
     /** */
     Expression checkNull(Expression expr) {
         if (Primitive.flavor(expr.getType()) == Primitive.Flavor.PRIMITIVE)
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/agg/Accumulators.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/agg/Accumulators.java
index e7656744dbe..21c813e156b 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/agg/Accumulators.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/agg/Accumulators.java
@@ -31,6 +31,8 @@ import java.util.function.Supplier;
 import org.apache.calcite.avatica.util.ByteString;
 import org.apache.calcite.rel.core.AggregateCall;
 import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rex.RexLiteral;
+import org.apache.calcite.rex.RexNode;
 import org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext;
 import org.apache.ignite.internal.processors.query.calcite.exec.RowHandler;
 import org.apache.ignite.internal.processors.query.calcite.type.IgniteTypeFactory;
@@ -84,6 +86,8 @@ public class Accumulators {
                 return maxFactory(call, hnd);
             case "SINGLE_VALUE":
                 return () -> new SingleVal<>(call, hnd);
+            case "LITERAL_AGG":
+                return () -> new LiteralVal<>(call, hnd);
             case "ANY_VALUE":
                 return () -> new AnyVal<>(call, hnd);
             case "LISTAGG":
@@ -312,6 +316,48 @@ public class Accumulators {
         }
     }
 
+    /**
+     * LITERAL_AGG accumulator, returns predefined literal value.
+     * Calcite`s implementation RexImpTable#LiteralAggImplementor.
+     */
+    private static class LiteralVal<Row> extends AbstractAccumulator<Row> {
+        /** */
+        public LiteralVal(AggregateCall aggCall, RowHandler<Row> hnd) {
+            super(aggCall, hnd);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void add(Row row) {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public void apply(Accumulator<Row> other) {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object end() {
+            assert !F.isEmpty(aggregateCall().rexList) : "aggregateCall().rexList is empty for LITERAL_AGG";
+
+            RexNode rexNode = aggregateCall().rexList.get(0);
+
+            assert rexNode instanceof RexLiteral;
+
+            return ((RexLiteral)rexNode).getValue();
+        }
+
+        /** {@inheritDoc} */
+        @Override public List<RelDataType> argumentTypes(IgniteTypeFactory typeFactory) {
+            return F.asList(typeFactory.createTypeWithNullability(typeFactory.createSqlType(ANY), true));
+        }
+
+        /** {@inheritDoc} */
+        @Override public RelDataType returnType(IgniteTypeFactory typeFactory) {
+            return aggregateCall().getType();
+        }
+    }
+
     /** */
     private static class AnyVal<Row> extends AbstractAccumulator<Row> {
         /** */
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/externalize/RelJson.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/externalize/RelJson.java
index 98597e1d1d6..bc2473edaac 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/externalize/RelJson.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/externalize/RelJson.java
@@ -740,6 +740,7 @@ class RelJson {
         map.put("filter", node.filterArg);
         map.put("name", node.getName());
         map.put("coll", toJson(node.getCollation()));
+        map.put("rexList", toJson(node.rexList));
         return map;
     }
 
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/externalize/RelJsonReader.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/externalize/RelJsonReader.java
index 531f9c94e1d..472a2d17f06 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/externalize/RelJsonReader.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/externalize/RelJsonReader.java
@@ -17,6 +17,7 @@
 package org.apache.ignite.internal.processors.query.calcite.externalize;
 
 import java.io.IOException;
+import java.math.BigDecimal;
 import java.util.AbstractList;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
@@ -40,6 +41,7 @@ import org.apache.calcite.rel.core.AggregateCall;
 import org.apache.calcite.rel.type.RelDataType;
 import org.apache.calcite.rex.RexLiteral;
 import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.runtime.SqlFunctions;
 import org.apache.calcite.sql.SqlAggFunction;
 import org.apache.calcite.util.ImmutableBitSet;
 import org.apache.calcite.util.Pair;
@@ -220,6 +222,11 @@ public class RelJsonReader {
             return ((Number)jsonRel.get(tag)).floatValue();
         }
 
+        /** {@inheritDoc} */
+        @Override public BigDecimal getBigDecimal(String tag) {
+            return SqlFunctions.toBigDecimal(jsonRel.get(tag));
+        }
+
         /** {@inheritDoc} */
         @Override public boolean getBoolean(String tag, boolean default_) {
             Boolean b = (Boolean)jsonRel.get(tag);
@@ -331,10 +338,13 @@ public class RelJsonReader {
             Boolean distinct = (Boolean)jsonAggCall.get("distinct");
             List<Integer> operands = (List<Integer>)jsonAggCall.get("operands");
             Integer filterOperand = (Integer)jsonAggCall.get("filter");
-            RelDataType type = relJson.toType(Commons.typeFactory(Commons.emptyCluster()), jsonAggCall.get("type"));
+            RelDataType type = relJson.toType(Commons.typeFactory(), jsonAggCall.get("type"));
             String name = (String)jsonAggCall.get("name");
             RelCollation collation = relJson.toCollation((List<Map<String, Object>>)jsonAggCall.get("coll"));
-            return AggregateCall.create(aggregation, distinct, false, false, operands,
+            List<RexNode> rexList = Commons.transform((List<Object>)jsonAggCall.get("rexList"),
+                node -> relJson.toRex(this, node));
+
+            return AggregateCall.create(aggregation, distinct, false, false, rexList, operands,
                 filterOperand == null ? -1 : filterOperand, null, collation, type, name);
         }
     }
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/PlannerPhase.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/PlannerPhase.java
index 73b315ae3d6..8e82d494047 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/PlannerPhase.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/PlannerPhase.java
@@ -211,6 +211,9 @@ public enum PlannerPhase {
                     // Works also as CoreRules#JOIN_COMMUTE and overrides it if defined after.
                     CoreRules.JOIN_COMMUTE_OUTER,
 
+                    PruneEmptyRules.CORRELATE_LEFT_INSTANCE,
+                    PruneEmptyRules.CORRELATE_RIGHT_INSTANCE,
+
                     // Useful of this rule is not clear now.
                     // CoreRules.AGGREGATE_REDUCE_FUNCTIONS,
 
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/fun/IgniteStdSqlOperatorTable.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/fun/IgniteStdSqlOperatorTable.java
index 25f8ea4dc5f..1b7492d958a 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/fun/IgniteStdSqlOperatorTable.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/fun/IgniteStdSqlOperatorTable.java
@@ -16,6 +16,7 @@
  */
 package org.apache.ignite.internal.processors.query.calcite.sql.fun;
 
+import org.apache.calcite.sql.fun.SqlInternalOperators;
 import org.apache.calcite.sql.fun.SqlLibraryOperators;
 import org.apache.calcite.sql.fun.SqlStdOperatorTable;
 import org.apache.calcite.sql.util.ReflectiveSqlOperatorTable;
@@ -157,14 +158,18 @@ public class IgniteStdSqlOperatorTable extends ReflectiveSqlOperatorTable {
         register(SqlStdOperatorTable.RAND); // Random.
         register(SqlStdOperatorTable.RAND_INTEGER); // Integer random.
         register(SqlStdOperatorTable.ACOS); // Arc cosine.
+        register(SqlLibraryOperators.ACOSH); // Hyperbolic arc cosine.
         register(SqlStdOperatorTable.ASIN); // Arc sine.
+        register(SqlLibraryOperators.ASINH); // Hyperbolic arc sine.
         register(SqlStdOperatorTable.ATAN); // Arc tangent.
         register(SqlStdOperatorTable.ATAN2); // Angle from coordinates.
+        register(SqlLibraryOperators.ATANH); // Hyperbolic arc tangent.
         register(SqlStdOperatorTable.SQRT); // Square root.
         register(SqlStdOperatorTable.CBRT); // Cube root.
         register(SqlStdOperatorTable.COS); // Cosine
         register(SqlLibraryOperators.COSH); // Hyperbolic cosine.
         register(SqlStdOperatorTable.COT); // Cotangent.
+        register(SqlLibraryOperators.COTH); // Hyperbolic cotangent.
         register(SqlStdOperatorTable.DEGREES); // Radians to degrees.
         register(SqlStdOperatorTable.RADIANS); // Degrees to radians.
         register(SqlStdOperatorTable.ROUND);
@@ -173,6 +178,10 @@ public class IgniteStdSqlOperatorTable extends ReflectiveSqlOperatorTable {
         register(SqlLibraryOperators.SINH); // Hyperbolic sine.
         register(SqlStdOperatorTable.TAN); // Tangent.
         register(SqlLibraryOperators.TANH); // Hyperbolic tangent.
+        register(SqlLibraryOperators.SEC); // Secant.
+        register(SqlLibraryOperators.SECH); // Hyperbolic secant.
+        register(SqlLibraryOperators.CSC); // Cosecant.
+        register(SqlLibraryOperators.CSCH); // Hyperbolic cosecant.
         register(SqlStdOperatorTable.TRUNCATE);
         register(SqlStdOperatorTable.PI);
 
@@ -291,6 +300,9 @@ public class IgniteStdSqlOperatorTable extends ReflectiveSqlOperatorTable {
         register(SqlStdOperatorTable.IS_NOT_JSON_ARRAY);
         register(SqlStdOperatorTable.IS_NOT_JSON_SCALAR);
 
+        // Aggregate functions.
+        register(SqlInternalOperators.LITERAL_AGG); // Internal operator, not implemented, required for serialization.
+
         // Current time functions.
         register(SqlStdOperatorTable.CURRENT_TIME);
         register(SqlStdOperatorTable.CURRENT_TIMESTAMP);
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/generated/IgniteSqlParserImpl.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/generated/IgniteSqlParserImpl.java
index a8697f89e9d..b2c95bb19eb 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/generated/IgniteSqlParserImpl.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/generated/IgniteSqlParserImpl.java
@@ -33,6 +33,7 @@ import org.apache.calcite.sql.SqlDynamicParam;
 import org.apache.calcite.sql.SqlExplain;
 import org.apache.calcite.sql.SqlExplainFormat;
 import org.apache.calcite.sql.SqlExplainLevel;
+import org.apache.calcite.sql.SqlFunction;
 import org.apache.calcite.sql.SqlFunctionCategory;
 import org.apache.calcite.sql.SqlHint;
 import org.apache.calcite.sql.SqlIdentifier;
@@ -51,9 +52,11 @@ import org.apache.calcite.sql.SqlJsonQueryWrapperBehavior;
 import org.apache.calcite.sql.SqlJsonValueEmptyOrErrorBehavior;
 import org.apache.calcite.sql.SqlJsonValueReturning;
 import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.SqlLambda;
 import org.apache.calcite.sql.SqlLiteral;
 import org.apache.calcite.sql.SqlMatchRecognize;
 import org.apache.calcite.sql.SqlMerge;
+import org.apache.calcite.sql.SqlMapTypeNameSpec;
 import org.apache.calcite.sql.SqlNode;
 import org.apache.calcite.sql.SqlNodeList;
 import org.apache.calcite.sql.SqlNumericLiteral;
@@ -92,6 +95,7 @@ import org.apache.calcite.sql.parser.SqlParserPos;
 import org.apache.calcite.sql.parser.SqlParserUtil;
 import org.apache.calcite.sql.type.SqlTypeName;
 import org.apache.calcite.sql.validate.SqlConformance;
+import org.apache.calcite.sql.validate.SqlConformanceEnum;
 import org.apache.calcite.util.Glossary;
 import org.apache.calcite.util.Pair;
 import org.apache.calcite.util.SourceStringReader;
@@ -133,6 +137,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO);
     private static final SqlLiteral LITERAL_MINUS_ONE =
         SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO);
+    private static final BigDecimal ONE_HUNDRED = BigDecimal.valueOf(100L);
 
     private static Metadata metadata;
 
@@ -684,19 +689,29 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * Parses a LIMIT clause in an ORDER BY expression.
  */
   final public void LimitClause(Span s, SqlNode[] offsetFetch) throws ParseException {
+    final String error;
     jj_consume_token(LIMIT);
               s.add(this);
-    if (jj_2_21(2)) {
+    if (jj_2_23(2)) {
       offsetFetch[0] = UnsignedNumericLiteralOrParam();
       jj_consume_token(COMMA);
-      offsetFetch[1] = UnsignedNumericLiteralOrParam();
+      if (jj_2_21(2)) {
+        offsetFetch[1] = UnsignedNumericLiteralOrParam();
+                error = "count";
+      } else if (jj_2_22(2)) {
+        jj_consume_token(ALL);
+                error = "ALL";
+      } else {
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
             if (!this.conformance.isLimitStartCountAllowed()) {
                 {if (true) throw SqlUtil.newContextException(s.end(this),
-                    RESOURCE.limitStartCountNotAllowed());}
+                    RESOURCE.limitStartCountOrAllNotAllowed(error));}
             }
-    } else if (jj_2_22(2)) {
+    } else if (jj_2_24(2)) {
       offsetFetch[1] = UnsignedNumericLiteralOrParam();
-    } else if (jj_2_23(2)) {
+    } else if (jj_2_25(2)) {
       jj_consume_token(ALL);
     } else {
       jj_consume_token(-1);
@@ -709,15 +724,15 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public SqlNode LeafQuery(ExprContext exprContext) throws ParseException {
     SqlNode e;
-    if (jj_2_24(2)) {
+    if (jj_2_26(2)) {
         // ensure a query is legal in this context
         checkQueryExpression(exprContext);
       e = SqlSelect();
                       {if (true) return e;}
-    } else if (jj_2_25(2)) {
+    } else if (jj_2_27(2)) {
       e = TableConstructor();
                              {if (true) return e;}
-    } else if (jj_2_26(2)) {
+    } else if (jj_2_28(2)) {
       e = ExplicitTable(getPos());
                                   {if (true) return e;}
     } else {
@@ -796,7 +811,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                                                list.add(e);
     label_3:
     while (true) {
-      if (jj_2_27(2)) {
+      if (jj_2_29(2)) {
         ;
       } else {
         break label_3;
@@ -831,10 +846,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             firstExprContext = ExprContext.ACCEPT_ALL;
             break;
         }
-    if (jj_2_28(2)) {
+    if (jj_2_30(2)) {
       e = OrderedQueryOrExpr(firstExprContext);
                                                    list.add(e);
-    } else if (jj_2_29(2)) {
+    } else if (jj_2_31(2)) {
       e = Default();
                         list.add(e);
     } else {
@@ -843,7 +858,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     }
     label_4:
     while (true) {
-      if (jj_2_30(2)) {
+      if (jj_2_32(2)) {
         ;
       } else {
         break label_4;
@@ -851,10 +866,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       jj_consume_token(COMMA);
             // a comma-list can't appear where only a query is expected
             checkNonQueryExpression(exprContext);
-      if (jj_2_31(2)) {
+      if (jj_2_33(2)) {
         e = Expression(exprContext);
                                           list.add(e);
-      } else if (jj_2_32(2)) {
+      } else if (jj_2_34(2)) {
         e = Default();
                             list.add(e);
       } else {
@@ -887,7 +902,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlLiteral qualifier;
     final List<SqlNode> list = new ArrayList<SqlNode>();
     jj_consume_token(LPAREN);
-    if (jj_2_33(2)) {
+    if (jj_2_35(2)) {
       qualifier = AllOrDistinct();
                                       list.add(qualifier);
     } else {
@@ -896,7 +911,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     AddArg0(list, exprContext);
     label_5:
     while (true) {
-      if (jj_2_34(2)) {
+      if (jj_2_36(2)) {
         ;
       } else {
         break label_5;
@@ -912,10 +927,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public SqlLiteral AllOrDistinct() throws ParseException {
-    if (jj_2_35(2)) {
+    if (jj_2_37(2)) {
       jj_consume_token(DISTINCT);
                  {if (true) return SqlSelectKeyword.DISTINCT.symbol(getPos());}
-    } else if (jj_2_36(2)) {
+    } else if (jj_2_38(2)) {
       jj_consume_token(ALL);
             {if (true) return SqlSelectKeyword.ALL.symbol(getPos());}
     } else {
@@ -944,17 +959,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             break;
         }
     }
-    if (jj_2_37(2)) {
+    if (jj_2_39(2)) {
       name = SimpleIdentifier();
       jj_consume_token(NAMED_ARGUMENT_ASSIGNMENT);
     } else {
           name = null;
     }
-    if (jj_2_38(2)) {
+    if (jj_2_40(2)) {
       e = Default();
-    } else if (jj_2_39(3)) {
+    } else if (jj_2_41(2147483647)) {
+      e = LambdaExpression();
+    } else if (jj_2_42(3)) {
       e = TableParam();
-    } else if (jj_2_40(2)) {
+    } else if (jj_2_43(2)) {
       e = PartitionedQueryOrQueryOrExpr(firstExprContext);
     } else {
       jj_consume_token(-1);
@@ -970,17 +987,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public void AddArg(List<SqlNode> list, ExprContext exprContext) throws ParseException {
     final SqlIdentifier name;
     SqlNode e;
-    if (jj_2_41(2)) {
+    if (jj_2_44(2)) {
       name = SimpleIdentifier();
       jj_consume_token(NAMED_ARGUMENT_ASSIGNMENT);
     } else {
           name = null;
     }
-    if (jj_2_42(2)) {
+    if (jj_2_45(2)) {
       e = Default();
-    } else if (jj_2_43(2)) {
+    } else if (jj_2_46(2147483647)) {
+      e = LambdaExpression();
+    } else if (jj_2_47(2)) {
       e = Expression(exprContext);
-    } else if (jj_2_44(2)) {
+    } else if (jj_2_48(2)) {
       e = TableParam();
     } else {
       jj_consume_token(-1);
@@ -1023,13 +1042,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         stmtList.add(stmt);
     label_6:
     while (true) {
-      if (jj_2_45(2)) {
+      if (jj_2_49(2)) {
         ;
       } else {
         break label_6;
       }
       jj_consume_token(SEMICOLON);
-      if (jj_2_46(2)) {
+      if (jj_2_50(2)) {
         stmt = SqlStmt();
                 stmtList.add(stmt);
       } else {
@@ -1046,55 +1065,55 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public SqlNode SqlStmt() throws ParseException {
     SqlNode stmt;
-    if (jj_2_47(2)) {
+    if (jj_2_51(2)) {
       stmt = SqlAlterTable();
-    } else if (jj_2_48(2)) {
+    } else if (jj_2_52(2)) {
       stmt = SqlAlterUser();
-    } else if (jj_2_49(2)) {
+    } else if (jj_2_53(2)) {
       stmt = SqlKillScanQuery();
-    } else if (jj_2_50(2)) {
+    } else if (jj_2_54(2)) {
       stmt = SqlKillContinuousQuery();
-    } else if (jj_2_51(2)) {
+    } else if (jj_2_55(2)) {
       stmt = SqlKillService();
-    } else if (jj_2_52(2)) {
+    } else if (jj_2_56(2)) {
       stmt = SqlKillTransaction();
-    } else if (jj_2_53(2)) {
+    } else if (jj_2_57(2)) {
       stmt = SqlKillComputeTask();
-    } else if (jj_2_54(2)) {
+    } else if (jj_2_58(2)) {
       stmt = SqlKillQuery();
-    } else if (jj_2_55(2)) {
+    } else if (jj_2_59(2)) {
       stmt = SqlCommitTransaction();
-    } else if (jj_2_56(2)) {
+    } else if (jj_2_60(2)) {
       stmt = SqlRollbackTransaction();
-    } else if (jj_2_57(2)) {
+    } else if (jj_2_61(2)) {
       stmt = SqlStatisticsAnalyze();
-    } else if (jj_2_58(2)) {
+    } else if (jj_2_62(2)) {
       stmt = SqlStatisticsRefresh();
-    } else if (jj_2_59(2)) {
+    } else if (jj_2_63(2)) {
       stmt = SqlStatisticsDrop();
-    } else if (jj_2_60(2)) {
+    } else if (jj_2_64(2)) {
       stmt = SqlSetOption(Span.of(), null);
-    } else if (jj_2_61(2)) {
+    } else if (jj_2_65(2)) {
       stmt = SqlAlter();
-    } else if (jj_2_62(2)) {
+    } else if (jj_2_66(2)) {
       stmt = SqlCreate();
-    } else if (jj_2_63(2)) {
+    } else if (jj_2_67(2)) {
       stmt = SqlDrop();
-    } else if (jj_2_64(2)) {
+    } else if (jj_2_68(2)) {
       stmt = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY);
-    } else if (jj_2_65(2)) {
+    } else if (jj_2_69(2)) {
       stmt = SqlExplain();
-    } else if (jj_2_66(2)) {
+    } else if (jj_2_70(2)) {
       stmt = SqlDescribe();
-    } else if (jj_2_67(2)) {
+    } else if (jj_2_71(2)) {
       stmt = SqlInsert();
-    } else if (jj_2_68(2)) {
+    } else if (jj_2_72(2)) {
       stmt = SqlDelete();
-    } else if (jj_2_69(2)) {
+    } else if (jj_2_73(2)) {
       stmt = SqlUpdate();
-    } else if (jj_2_70(2)) {
+    } else if (jj_2_74(2)) {
       stmt = SqlMerge();
-    } else if (jj_2_71(2)) {
+    } else if (jj_2_75(2)) {
       stmt = SqlProcedureCall();
     } else {
       jj_consume_token(-1);
@@ -1116,7 +1135,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public boolean IfNotExistsOpt() throws ParseException {
-    if (jj_2_72(2)) {
+    if (jj_2_76(2)) {
       jj_consume_token(IF);
       jj_consume_token(NOT);
       jj_consume_token(EXISTS);
@@ -1130,20 +1149,20 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlNodeList WithCreateTableOptionList() throws ParseException {
     List<SqlNode> list = new ArrayList<SqlNode>();
     final Span s;
-    if (jj_2_76(2)) {
+    if (jj_2_80(2)) {
       jj_consume_token(WITH);
                  s = span();
-      if (jj_2_74(2)) {
+      if (jj_2_78(2)) {
         jj_consume_token(QUOTED_IDENTIFIER);
                 {if (true) return IgniteSqlCreateTableOption.parseOptionList(
                     SqlParserUtil.stripQuotes(token.image, DQ, DQ, DQDQ, quotedCasing),
                     getPos().withQuoting(true)
                 );}
-      } else if (jj_2_75(2)) {
+      } else if (jj_2_79(2)) {
         CreateTableOption(list);
         label_7:
         while (true) {
-          if (jj_2_73(2)) {
+          if (jj_2_77(2)) {
             ;
           } else {
             break label_7;
@@ -1165,37 +1184,37 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public SqlLiteral CreateTableOptionKey() throws ParseException {
-    if (jj_2_77(2)) {
+    if (jj_2_81(2)) {
       jj_consume_token(TEMPLATE);
                  {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.TEMPLATE, getPos());}
-    } else if (jj_2_78(2)) {
+    } else if (jj_2_82(2)) {
       jj_consume_token(BACKUPS);
                 {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.BACKUPS, getPos());}
-    } else if (jj_2_79(2)) {
+    } else if (jj_2_83(2)) {
       jj_consume_token(AFFINITY_KEY);
                      {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.AFFINITY_KEY, getPos());}
-    } else if (jj_2_80(2)) {
+    } else if (jj_2_84(2)) {
       jj_consume_token(ATOMICITY);
                   {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.ATOMICITY, getPos());}
-    } else if (jj_2_81(2)) {
+    } else if (jj_2_85(2)) {
       jj_consume_token(WRITE_SYNCHRONIZATION_MODE);
                                    {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.WRITE_SYNCHRONIZATION_MODE, getPos());}
-    } else if (jj_2_82(2)) {
+    } else if (jj_2_86(2)) {
       jj_consume_token(CACHE_GROUP);
                     {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.CACHE_GROUP, getPos());}
-    } else if (jj_2_83(2)) {
+    } else if (jj_2_87(2)) {
       jj_consume_token(CACHE_NAME);
                    {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.CACHE_NAME, getPos());}
-    } else if (jj_2_84(2)) {
+    } else if (jj_2_88(2)) {
       jj_consume_token(DATA_REGION);
                     {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.DATA_REGION, getPos());}
-    } else if (jj_2_85(2)) {
+    } else if (jj_2_89(2)) {
       jj_consume_token(KEY_TYPE);
                  {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.KEY_TYPE, getPos());}
-    } else if (jj_2_86(2)) {
+    } else if (jj_2_90(2)) {
       jj_consume_token(VALUE_TYPE);
                    {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.VALUE_TYPE, getPos());}
-    } else if (jj_2_87(2)) {
+    } else if (jj_2_91(2)) {
       jj_consume_token(ENCRYPTED);
                   {if (true) return SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.ENCRYPTED, getPos());}
     } else {
@@ -1212,9 +1231,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     key = CreateTableOptionKey();
                                    s = span();
     jj_consume_token(EQ);
-    if (jj_2_88(2)) {
+    if (jj_2_92(2)) {
       val = Literal();
-    } else if (jj_2_89(2)) {
+    } else if (jj_2_93(2)) {
       val = SimpleIdentifier();
     } else {
       jj_consume_token(-1);
@@ -1225,9 +1244,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
   final public SqlDataTypeSpec DataTypeEx() throws ParseException {
     final SqlDataTypeSpec dt;
-    if (jj_2_90(2)) {
+    if (jj_2_94(2)) {
       dt = DataType();
-    } else if (jj_2_91(2)) {
+    } else if (jj_2_95(2)) {
       dt = IntervalType();
     } else {
       jj_consume_token(-1);
@@ -1255,11 +1274,11 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final ColumnStrategy strategy;
     final SqlNode dflt;
     SqlIdentifier id = null;
-    if (jj_2_95(2)) {
+    if (jj_2_99(2)) {
       id = SimpleIdentifier();
       type = DataTypeEx();
       nullable = NullableOptDefaultTrue();
-      if (jj_2_92(2)) {
+      if (jj_2_96(2)) {
         jj_consume_token(DEFAULT_);
                      s.add(this);
         dflt = Literal();
@@ -1269,7 +1288,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             strategy = nullable ? ColumnStrategy.NULLABLE
                 : ColumnStrategy.NOT_NULLABLE;
       }
-      if (jj_2_93(2)) {
+      if (jj_2_97(2)) {
         jj_consume_token(PRIMARY);
                     s.add(this);
         jj_consume_token(KEY);
@@ -1281,8 +1300,8 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         list.add(
             SqlDdlNodes.column(s.add(id).end(this), id,
                 type.withNullable(nullable), dflt, strategy));
-    } else if (jj_2_96(2)) {
-      if (jj_2_94(2)) {
+    } else if (jj_2_100(2)) {
+      if (jj_2_98(2)) {
         jj_consume_token(CONSTRAINT);
                      s.add(this);
         id = SimpleIdentifier();
@@ -1308,7 +1327,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     TableElement(list);
     label_8:
     while (true) {
-      if (jj_2_97(2)) {
+      if (jj_2_101(2)) {
         ;
       } else {
         break label_8;
@@ -1330,12 +1349,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(TABLE);
     ifNotExists = IfNotExistsOpt();
     id = CompoundIdentifier();
-    if (jj_2_99(3)) {
+    if (jj_2_103(3)) {
       columnList = TableElementList();
       optionList = WithCreateTableOptionList();
           query = null;
-    } else if (jj_2_100(2)) {
-      if (jj_2_98(2)) {
+    } else if (jj_2_104(2)) {
+      if (jj_2_102(2)) {
         columnList = ParenthesizedSimpleIdentifierList();
       } else {
               columnList = null;
@@ -1356,10 +1375,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     SqlNode col;
     col = SimpleIdentifier();
-    if (jj_2_103(2)) {
-      if (jj_2_101(2)) {
+    if (jj_2_107(2)) {
+      if (jj_2_105(2)) {
         jj_consume_token(ASC);
-      } else if (jj_2_102(2)) {
+      } else if (jj_2_106(2)) {
         jj_consume_token(DESC);
             col = SqlStdOperatorTable.DESC.createCall(getPos(), col);
       } else {
@@ -1383,7 +1402,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                             list.add(col);
     label_9:
     while (true) {
-      if (jj_2_104(2)) {
+      if (jj_2_108(2)) {
         ;
       } else {
         break label_9;
@@ -1406,7 +1425,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlNumericLiteral inlineSize = null;
     jj_consume_token(INDEX);
     ifNotExists = IfNotExistsOpt();
-    if (jj_2_105(2)) {
+    if (jj_2_109(2)) {
       idxId = SimpleIdentifier();
     } else {
       ;
@@ -1416,19 +1435,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     columnList = IndexedColumnList();
     label_10:
     while (true) {
-      if (jj_2_106(2)) {
+      if (jj_2_110(2)) {
         ;
       } else {
         break label_10;
       }
-      if (jj_2_107(2)) {
+      if (jj_2_111(2)) {
         jj_consume_token(PARALLEL);
         jj_consume_token(UNSIGNED_INTEGER_LITERAL);
             if (parallel != null)
                 {if (true) throw SqlUtil.newContextException(getPos(), IgniteResource.INSTANCE.optionAlreadyDefined("PARALLEL"));}
 
             parallel = SqlLiteral.createExactNumeric(token.image, getPos());
-      } else if (jj_2_108(2)) {
+      } else if (jj_2_112(2)) {
         jj_consume_token(INLINE_SIZE);
         jj_consume_token(UNSIGNED_INTEGER_LITERAL);
             if (inlineSize != null)
@@ -1445,7 +1464,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public boolean IfExistsOpt() throws ParseException {
-    if (jj_2_109(2)) {
+    if (jj_2_113(2)) {
       jj_consume_token(IF);
       jj_consume_token(EXISTS);
                     {if (true) return true;}
@@ -1496,7 +1515,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                              list.add(col);
     label_11:
     while (true) {
-      if (jj_2_110(2)) {
+      if (jj_2_114(2)) {
         ;
       } else {
         break label_11;
@@ -1517,7 +1536,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s = Span.of();
     id = SimpleIdentifier();
     type = DataTypeEx();
-    if (jj_2_111(2)) {
+    if (jj_2_115(2)) {
       jj_consume_token(NOT);
       jj_consume_token(NULL);
             nullable = false;
@@ -1531,10 +1550,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlNodeList ColumnWithTypeOrList() throws ParseException {
     SqlNode col;
     SqlNodeList list;
-    if (jj_2_112(2)) {
+    if (jj_2_116(2)) {
       col = ColumnWithType();
                              {if (true) return new SqlNodeList(Collections.singletonList(col), col.getParserPosition());}
-    } else if (jj_2_113(2)) {
+    } else if (jj_2_117(2)) {
       list = ColumnWithTypeList();
                                   {if (true) return list;}
     } else {
@@ -1556,15 +1575,15 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(TABLE);
     ifExists = IfExistsOpt();
     id = CompoundIdentifier();
-    if (jj_2_116(2)) {
+    if (jj_2_120(2)) {
       jj_consume_token(LOGGING);
                     {if (true) return new IgniteSqlAlterTable(s.end(this), ifExists, id, true);}
-    } else if (jj_2_117(2)) {
+    } else if (jj_2_121(2)) {
       jj_consume_token(NOLOGGING);
                        {if (true) return new IgniteSqlAlterTable(s.end(this), ifExists, id, false);}
-    } else if (jj_2_118(2)) {
+    } else if (jj_2_122(2)) {
       jj_consume_token(ADD);
-      if (jj_2_114(2)) {
+      if (jj_2_118(2)) {
         jj_consume_token(COLUMN);
       } else {
         ;
@@ -1572,9 +1591,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       colIgnoreErr = IfNotExistsOpt();
       cols = ColumnWithTypeOrList();
             {if (true) return new IgniteSqlAlterTableAddColumn(s.end(this), ifExists, id, colIgnoreErr, cols);}
-    } else if (jj_2_119(2)) {
+    } else if (jj_2_123(2)) {
       jj_consume_token(DROP);
-      if (jj_2_115(2)) {
+      if (jj_2_119(2)) {
         jj_consume_token(COLUMN);
       } else {
         ;
@@ -1626,16 +1645,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
   final public SqlNumericLiteral SignedIntegerLiteral() throws ParseException {
     final Span s;
-    if (jj_2_120(2)) {
+    if (jj_2_124(2)) {
       jj_consume_token(PLUS);
       jj_consume_token(UNSIGNED_INTEGER_LITERAL);
         {if (true) return SqlLiteral.createExactNumeric(token.image, getPos());}
-    } else if (jj_2_121(2)) {
+    } else if (jj_2_125(2)) {
       jj_consume_token(MINUS);
               s = span();
       jj_consume_token(UNSIGNED_INTEGER_LITERAL);
         {if (true) return SqlLiteral.createNegative(SqlLiteral.createExactNumeric(token.image, getPos()), s.end(this));}
-    } else if (jj_2_122(2)) {
+    } else if (jj_2_126(2)) {
       jj_consume_token(UNSIGNED_INTEGER_LITERAL);
         {if (true) return SqlLiteral.createExactNumeric(token.image, getPos());}
     } else {
@@ -1739,7 +1758,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public boolean IsAsyncOpt() throws ParseException {
-    if (jj_2_123(2)) {
+    if (jj_2_127(2)) {
       jj_consume_token(ASYNC);
               {if (true) return true;}
     } else {
@@ -1770,7 +1789,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     jj_consume_token(COMMIT);
                s = span();
-    if (jj_2_124(2)) {
+    if (jj_2_128(2)) {
       jj_consume_token(TRANSACTION);
     } else {
       ;
@@ -1783,7 +1802,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     jj_consume_token(ROLLBACK);
                  s = span();
-    if (jj_2_125(2)) {
+    if (jj_2_129(2)) {
       jj_consume_token(TRANSACTION);
     } else {
       ;
@@ -1797,7 +1816,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlIdentifier id;
     final SqlNodeList columnList;
     id = CompoundIdentifier();
-    if (jj_2_126(2)) {
+    if (jj_2_130(2)) {
       columnList = ParenthesizedSimpleIdentifierList();
     } else {
           columnList = null;
@@ -1814,7 +1833,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                               tbls.add(tbl);
     label_12:
     while (true) {
-      if (jj_2_127(2)) {
+      if (jj_2_131(2)) {
         ;
       } else {
         break label_12;
@@ -1830,14 +1849,14 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlNodeList WithStatisticsAnalyzeOptionList() throws ParseException {
     List<SqlNode> list = new ArrayList<SqlNode>();
     final Span s;
-    if (jj_2_131(2)) {
+    if (jj_2_135(2)) {
       jj_consume_token(WITH);
                  s = span();
-      if (jj_2_129(2)) {
+      if (jj_2_133(2)) {
         StatisticsAnalyzeOption(list);
         label_13:
         while (true) {
-          if (jj_2_128(2)) {
+          if (jj_2_132(2)) {
             ;
           } else {
             break label_13;
@@ -1847,7 +1866,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
           StatisticsAnalyzeOption(list);
         }
                 {if (true) return new SqlNodeList(list, s.end(this));}
-      } else if (jj_2_130(2)) {
+      } else if (jj_2_134(2)) {
         jj_consume_token(QUOTED_IDENTIFIER);
                 {if (true) return IgniteSqlStatisticsAnalyzeOption.parseOptionList(
                     SqlParserUtil.stripQuotes(token.image, DQ, DQ, DQDQ, quotedCasing),
@@ -1865,19 +1884,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public SqlLiteral StatisticsAnalyzeOptionKey() throws ParseException {
-    if (jj_2_132(2)) {
+    if (jj_2_136(2)) {
       jj_consume_token(DISTINCT);
                  {if (true) return SqlLiteral.createSymbol(IgniteSqlStatisticsAnalyzeOptionEnum.DISTINCT, getPos());}
-    } else if (jj_2_133(2)) {
+    } else if (jj_2_137(2)) {
       jj_consume_token(TOTAL);
               {if (true) return SqlLiteral.createSymbol(IgniteSqlStatisticsAnalyzeOptionEnum.TOTAL, getPos());}
-    } else if (jj_2_134(2)) {
+    } else if (jj_2_138(2)) {
       jj_consume_token(SIZE);
              {if (true) return SqlLiteral.createSymbol(IgniteSqlStatisticsAnalyzeOptionEnum.SIZE, getPos());}
-    } else if (jj_2_135(2)) {
+    } else if (jj_2_139(2)) {
       jj_consume_token(NULLS);
               {if (true) return SqlLiteral.createSymbol(IgniteSqlStatisticsAnalyzeOptionEnum.NULLS, getPos());}
-    } else if (jj_2_136(2)) {
+    } else if (jj_2_140(2)) {
       jj_consume_token(MAX_CHANGED_PARTITION_ROWS_PERCENT);
                                            {if (true) return SqlLiteral.createSymbol(IgniteSqlStatisticsAnalyzeOptionEnum.MAX_CHANGED_PARTITION_ROWS_PERCENT, getPos());}
     } else {
@@ -1894,9 +1913,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     key = StatisticsAnalyzeOptionKey();
                                          s = span();
     jj_consume_token(EQ);
-    if (jj_2_137(2)) {
+    if (jj_2_141(2)) {
       val = Literal();
-    } else if (jj_2_138(2)) {
+    } else if (jj_2_142(2)) {
       val = SimpleIdentifier();
     } else {
       jj_consume_token(-1);
@@ -1947,7 +1966,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     AddKeyValueOption(list);
     label_14:
     while (true) {
-      if (jj_2_139(2)) {
+      if (jj_2_143(2)) {
         ;
       } else {
         break label_14;
@@ -1967,9 +1986,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public void AddKeyValueOption(List<SqlNode> list) throws ParseException {
     final SqlNode key;
     final SqlNode value;
-    if (jj_2_140(2)) {
+    if (jj_2_144(2)) {
       key = SimpleIdentifier();
-    } else if (jj_2_141(2)) {
+    } else if (jj_2_145(2)) {
       key = StringLiteral();
     } else {
       jj_consume_token(-1);
@@ -1984,10 +2003,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 /** Parses an option value (either a string or a numeric) and adds to a list. */
   final public void AddOptionValue(List<SqlNode> list) throws ParseException {
     final SqlNode value;
-    if (jj_2_142(2)) {
+    if (jj_2_146(2)) {
       value = NumericLiteral();
                                    list.add(value);
-    } else if (jj_2_143(2)) {
+    } else if (jj_2_147(2)) {
       value = StringLiteral();
                                   list.add(value);
     } else {
@@ -2007,7 +2026,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     AddOptionValue(list);
     label_15:
     while (true) {
-      if (jj_2_144(2)) {
+      if (jj_2_148(2)) {
         ;
       } else {
         break label_15;
@@ -2025,17 +2044,17 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlNodeList hintOptions;
     final SqlHint.HintOptionFormat optionFormat;
     hintName = SimpleIdentifier();
-    if (jj_2_146(5)) {
+    if (jj_2_150(5)) {
       hintOptions = ParenthesizedKeyValueOptionCommaList();
             optionFormat = SqlHint.HintOptionFormat.KV_LIST;
-    } else if (jj_2_147(3)) {
+    } else if (jj_2_151(3)) {
       hintOptions = ParenthesizedSimpleIdentifierList();
             optionFormat = SqlHint.HintOptionFormat.ID_LIST;
-    } else if (jj_2_148(3)) {
+    } else if (jj_2_152(3)) {
       hintOptions = ParenthesizedLiteralOptionCommaList();
             optionFormat = SqlHint.HintOptionFormat.LITERAL_LIST;
     } else {
-      if (jj_2_145(2)) {
+      if (jj_2_149(2)) {
         jj_consume_token(LPAREN);
         jj_consume_token(RPAREN);
       } else {
@@ -2057,7 +2076,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     AddHint(hints);
     label_16:
     while (true) {
-      if (jj_2_149(2)) {
+      if (jj_2_153(2)) {
         ;
       } else {
         break label_16;
@@ -2090,12 +2109,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     jj_consume_token(SELECT);
                s = span();
-    if (jj_2_151(2)) {
+    if (jj_2_155(2)) {
       jj_consume_token(HINT_BEG);
       AddHint(hints);
       label_17:
       while (true) {
-        if (jj_2_150(2)) {
+        if (jj_2_154(2)) {
           ;
         } else {
           break label_17;
@@ -2108,13 +2127,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       ;
     }
     SqlSelectKeywords(keywords);
-    if (jj_2_152(2)) {
+    if (jj_2_156(2)) {
       jj_consume_token(STREAM);
             keywords.add(SqlSelectKeyword.STREAM.symbol(getPos()));
     } else {
       ;
     }
-    if (jj_2_153(2)) {
+    if (jj_2_157(2)) {
       keyword = AllOrDistinct();
                                     keywords.add(keyword);
     } else {
@@ -2124,7 +2143,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     AddSelectItem(selectList);
     label_18:
     while (true) {
-      if (jj_2_154(2)) {
+      if (jj_2_158(2)) {
         ;
       } else {
         break label_18;
@@ -2132,30 +2151,30 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       jj_consume_token(COMMA);
       AddSelectItem(selectList);
     }
-    if (jj_2_160(2)) {
+    if (jj_2_164(2)) {
       jj_consume_token(FROM);
       fromClause = FromClause();
-      if (jj_2_155(2)) {
+      if (jj_2_159(2)) {
         where = Where();
       } else {
                               where = null;
       }
-      if (jj_2_156(2)) {
+      if (jj_2_160(2)) {
         groupBy = GroupBy();
       } else {
                                   groupBy = null;
       }
-      if (jj_2_157(2)) {
+      if (jj_2_161(2)) {
         having = Having();
       } else {
                                 having = null;
       }
-      if (jj_2_158(2)) {
+      if (jj_2_162(2)) {
         windowDecls = Window();
       } else {
                                      windowDecls = null;
       }
-      if (jj_2_159(2)) {
+      if (jj_2_163(2)) {
         qualify = Qualify();
       } else {
                                   qualify = null;
@@ -2194,21 +2213,21 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlExplainFormat format;
     jj_consume_token(EXPLAIN);
     jj_consume_token(PLAN);
-    if (jj_2_161(2)) {
+    if (jj_2_165(2)) {
       detailLevel = ExplainDetailLevel();
     } else {
       ;
     }
     depth = ExplainDepth();
-    if (jj_2_162(2)) {
+    if (jj_2_166(2)) {
       jj_consume_token(AS);
       jj_consume_token(XML);
                      format = SqlExplainFormat.XML;
-    } else if (jj_2_163(2)) {
+    } else if (jj_2_167(2)) {
       jj_consume_token(AS);
       jj_consume_token(JSON);
                       format = SqlExplainFormat.JSON;
-    } else if (jj_2_164(2)) {
+    } else if (jj_2_168(2)) {
       jj_consume_token(AS);
       jj_consume_token(DOT_FORMAT);
                             format = SqlExplainFormat.DOT;
@@ -2230,15 +2249,15 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * or DML statement (INSERT, UPDATE, DELETE, MERGE). */
   final public SqlNode SqlQueryOrDml() throws ParseException {
     SqlNode stmt;
-    if (jj_2_165(2)) {
+    if (jj_2_169(2)) {
       stmt = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY);
-    } else if (jj_2_166(2)) {
+    } else if (jj_2_170(2)) {
       stmt = SqlInsert();
-    } else if (jj_2_167(2)) {
+    } else if (jj_2_171(2)) {
       stmt = SqlDelete();
-    } else if (jj_2_168(2)) {
+    } else if (jj_2_172(2)) {
       stmt = SqlUpdate();
-    } else if (jj_2_169(2)) {
+    } else if (jj_2_173(2)) {
       stmt = SqlMerge();
     } else {
       jj_consume_token(-1);
@@ -2253,15 +2272,15 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * EXPLAIN PLAN.
  */
   final public SqlExplain.Depth ExplainDepth() throws ParseException {
-    if (jj_2_170(2)) {
+    if (jj_2_174(2)) {
       jj_consume_token(WITH);
       jj_consume_token(TYPE);
             {if (true) return SqlExplain.Depth.TYPE;}
-    } else if (jj_2_171(2)) {
+    } else if (jj_2_175(2)) {
       jj_consume_token(WITH);
       jj_consume_token(IMPLEMENTATION);
             {if (true) return SqlExplain.Depth.PHYSICAL;}
-    } else if (jj_2_172(2)) {
+    } else if (jj_2_176(2)) {
       jj_consume_token(WITHOUT);
       jj_consume_token(IMPLEMENTATION);
             {if (true) return SqlExplain.Depth.LOGICAL;}
@@ -2276,13 +2295,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public SqlExplainLevel ExplainDetailLevel() throws ParseException {
     SqlExplainLevel level = SqlExplainLevel.EXPPLAN_ATTRIBUTES;
-    if (jj_2_174(2)) {
+    if (jj_2_178(2)) {
       jj_consume_token(EXCLUDING);
       jj_consume_token(ATTRIBUTES);
             level = SqlExplainLevel.NO_ATTRIBUTES;
-    } else if (jj_2_175(2)) {
+    } else if (jj_2_179(2)) {
       jj_consume_token(INCLUDING);
-      if (jj_2_173(2)) {
+      if (jj_2_177(2)) {
         jj_consume_token(ALL);
                   level = SqlExplainLevel.ALL_ATTRIBUTES;
       } else {
@@ -2309,12 +2328,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
    final SqlNode stmt;
     jj_consume_token(DESCRIBE);
                  s = span();
-    if (jj_2_181(2)) {
-      if (jj_2_176(2)) {
+    if (jj_2_185(2)) {
+      if (jj_2_180(2)) {
         jj_consume_token(DATABASE);
-      } else if (jj_2_177(2)) {
+      } else if (jj_2_181(2)) {
         jj_consume_token(CATALOG);
-      } else if (jj_2_178(2)) {
+      } else if (jj_2_182(2)) {
         jj_consume_token(SCHEMA);
       } else {
         jj_consume_token(-1);
@@ -2325,21 +2344,21 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             // DESCRIBE SCHEMA but should be different. See
             //   [CALCITE-1221] Implement DESCRIBE DATABASE, CATALOG, STATEMENT
             {if (true) return new SqlDescribeSchema(s.end(id), id);}
-    } else if (jj_2_182(2147483647)) {
-      if (jj_2_179(2)) {
+    } else if (jj_2_186(2147483647)) {
+      if (jj_2_183(2)) {
         jj_consume_token(TABLE);
       } else {
         ;
       }
       table = CompoundIdentifier();
-      if (jj_2_180(2)) {
+      if (jj_2_184(2)) {
         column = SimpleIdentifier();
       } else {
                                           column = null;
       }
             {if (true) return new SqlDescribeTable(s.add(table).addIf(column).pos(),
                 table, column);}
-    } else if (jj_2_183(2)) {
+    } else if (jj_2_187(2)) {
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
       case STATEMENT:
         jj_consume_token(STATEMENT);
@@ -2390,11 +2409,11 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     name = CompoundIdentifier();
         s = span();
     jj_consume_token(LPAREN);
-    if (jj_2_185(2)) {
+    if (jj_2_189(2)) {
       AddArg0(list, exprContext);
       label_19:
       while (true) {
-        if (jj_2_184(2)) {
+        if (jj_2_188(2)) {
           ;
         } else {
           break label_19;
@@ -2423,14 +2442,14 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlNode tableRef;
       s = span();
     tableRef = ExplicitTable(getPos());
-    if (jj_2_186(2)) {
+    if (jj_2_190(2)) {
       jj_consume_token(PARTITION);
       jj_consume_token(BY);
       partitionList = SimpleIdentifierOrList();
     } else {
           partitionList = SqlNodeList.EMPTY;
     }
-    if (jj_2_187(2)) {
+    if (jj_2_191(2)) {
       orderList = OrderByOfSetSemanticsTable();
     } else {
           orderList = SqlNodeList.EMPTY;
@@ -2452,14 +2471,14 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlNodeList partitionList;
     final SqlNodeList orderList;
       s = span();
-    if (jj_2_188(2)) {
+    if (jj_2_192(2)) {
       jj_consume_token(PARTITION);
       jj_consume_token(BY);
       partitionList = SimpleIdentifierOrList();
     } else {
           partitionList = SqlNodeList.EMPTY;
     }
-    if (jj_2_189(2)) {
+    if (jj_2_193(2)) {
       orderList = OrderByOfSetSemanticsTable();
     } else {
           orderList = SqlNodeList.EMPTY;
@@ -2474,12 +2493,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(ORDER);
     s = span();
     jj_consume_token(BY);
-    if (jj_2_191(2)) {
+    if (jj_2_195(2)) {
       jj_consume_token(LPAREN);
       AddOrderItem(list);
       label_20:
       while (true) {
-        if (jj_2_190(2)) {
+        if (jj_2_194(2)) {
           ;
         } else {
           break label_20;
@@ -2489,7 +2508,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       }
       jj_consume_token(RPAREN);
           {if (true) return new SqlNodeList(list, s.addAll(list).pos());}
-    } else if (jj_2_192(2)) {
+    } else if (jj_2_196(2)) {
       AddOrderItem(list);
           {if (true) return new SqlNodeList(list, s.addAll(list).pos());}
     } else {
@@ -2524,9 +2543,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlNodeList columnList;
     final Span s;
     final Pair<SqlNodeList, SqlNodeList> p;
-    if (jj_2_193(2)) {
+    if (jj_2_197(2)) {
       jj_consume_token(INSERT);
-    } else if (jj_2_194(2)) {
+    } else if (jj_2_198(2)) {
       jj_consume_token(UPSERT);
                    keywords.add(SqlInsertKeyword.UPSERT.symbol(getPos()));
     } else {
@@ -2538,17 +2557,17 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         keywordList = new SqlNodeList(keywords, s.addAll(keywords).pos());
     jj_consume_token(INTO);
     tableName = CompoundTableIdentifier();
-    if (jj_2_195(2)) {
+    if (jj_2_199(2)) {
       tableRef = TableHints(tableName);
     } else {
                                            tableRef = tableName;
     }
-    if (jj_2_196(5)) {
+    if (jj_2_200(5)) {
       tableRef = ExtendTable(tableRef);
     } else {
       ;
     }
-    if (jj_2_197(2)) {
+    if (jj_2_201(2)) {
       p = ParenthesizedCompoundIdentifierList();
             if (p.right.size() > 0) {
                 tableRef = extend(tableRef, p.right);
@@ -2588,18 +2607,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         s = span();
     jj_consume_token(FROM);
     tableName = CompoundTableIdentifier();
-    if (jj_2_198(2)) {
+    if (jj_2_202(2)) {
       tableRef = TableHints(tableName);
     } else {
                                            tableRef = tableName;
     }
-    if (jj_2_199(2)) {
+    if (jj_2_203(2)) {
       tableRef = ExtendTable(tableRef);
     } else {
       ;
     }
-    if (jj_2_201(2)) {
-      if (jj_2_200(2)) {
+    if (jj_2_205(2)) {
+      if (jj_2_204(2)) {
         jj_consume_token(AS);
       } else {
         ;
@@ -2608,7 +2627,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     } else {
                                               alias = null;
     }
-    if (jj_2_202(2)) {
+    if (jj_2_206(2)) {
       where = Where();
     } else {
                           where = null;
@@ -2635,18 +2654,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         targetColumnList = new SqlNodeList(s.pos());
         sourceExpressionList = new SqlNodeList(s.pos());
     tableName = CompoundTableIdentifier();
-    if (jj_2_203(2)) {
+    if (jj_2_207(2)) {
       tableRef = TableHints(tableName);
     } else {
                                            tableRef = tableName;
     }
-    if (jj_2_204(2)) {
+    if (jj_2_208(2)) {
       tableRef = ExtendTable(tableRef);
     } else {
       ;
     }
-    if (jj_2_206(2)) {
-      if (jj_2_205(2)) {
+    if (jj_2_210(2)) {
+      if (jj_2_209(2)) {
         jj_consume_token(AS);
       } else {
         ;
@@ -2662,7 +2681,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     AddExpression(sourceExpressionList, ExprContext.ACCEPT_SUB_QUERY);
     label_21:
     while (true) {
-      if (jj_2_207(2)) {
+      if (jj_2_211(2)) {
         ;
       } else {
         break label_21;
@@ -2673,7 +2692,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       jj_consume_token(EQ);
       AddExpression(sourceExpressionList, ExprContext.ACCEPT_SUB_QUERY);
     }
-    if (jj_2_208(2)) {
+    if (jj_2_212(2)) {
       where = Where();
     } else {
                           where = null;
@@ -2701,18 +2720,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
               s = span();
     jj_consume_token(INTO);
     tableName = CompoundTableIdentifier();
-    if (jj_2_209(2)) {
+    if (jj_2_213(2)) {
       tableRef = TableHints(tableName);
     } else {
                                            tableRef = tableName;
     }
-    if (jj_2_210(2)) {
+    if (jj_2_214(2)) {
       tableRef = ExtendTable(tableRef);
     } else {
       ;
     }
-    if (jj_2_212(2)) {
-      if (jj_2_211(2)) {
+    if (jj_2_216(2)) {
+      if (jj_2_215(2)) {
         jj_consume_token(AS);
       } else {
         ;
@@ -2725,14 +2744,14 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     sourceTableRef = TableRef();
     jj_consume_token(ON);
     condition = Expression(ExprContext.ACCEPT_SUB_QUERY);
-    if (jj_2_214(2)) {
+    if (jj_2_218(2)) {
       updateCall = WhenMatchedClause(tableRef, alias);
-      if (jj_2_213(2)) {
+      if (jj_2_217(2)) {
         insertCall = WhenNotMatchedClause(tableRef);
       } else {
                                                           insertCall = null;
       }
-    } else if (jj_2_215(2)) {
+    } else if (jj_2_219(2)) {
           updateCall = null;
       insertCall = WhenNotMatchedClause(tableRef);
     } else {
@@ -2762,7 +2781,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     AddExpression(updateExprList, ExprContext.ACCEPT_SUB_QUERY);
     label_22:
     while (true) {
-      if (jj_2_216(2)) {
+      if (jj_2_220(2)) {
         ;
       } else {
         break label_22;
@@ -2793,18 +2812,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         insertSpan = span();
     SqlInsertKeywords(keywords);
         keywordList = new SqlNodeList(keywords, insertSpan.end(this));
-    if (jj_2_217(2)) {
+    if (jj_2_221(2)) {
       insertColumnList = ParenthesizedSimpleIdentifierList();
     } else {
           insertColumnList = null;
     }
-    if (jj_2_218(2)) {
+    if (jj_2_222(2)) {
       jj_consume_token(LPAREN);
       jj_consume_token(VALUES);
                    valuesSpan = span();
       rowConstructor = RowConstructor();
       jj_consume_token(RPAREN);
-    } else if (jj_2_219(2)) {
+    } else if (jj_2_223(2)) {
       jj_consume_token(VALUES);
                    valuesSpan = span();
       rowConstructor = RowConstructor();
@@ -2829,13 +2848,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlNode e;
     final SqlIdentifier id;
     e = SelectExpression();
-    if (jj_2_222(2)) {
-      if (jj_2_220(2)) {
+    if (jj_2_226(2)) {
+      if (jj_2_224(2)) {
         jj_consume_token(AS);
       } else {
         ;
       }
-      if (jj_2_221(2)) {
+      if (jj_2_225(2)) {
         id = SimpleIdentifier();
       } else {
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2859,10 +2878,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public SqlNode SelectExpression() throws ParseException {
     SqlNode e;
-    if (jj_2_223(2)) {
+    if (jj_2_227(2)) {
       jj_consume_token(STAR);
         {if (true) return SqlIdentifier.star(getPos());}
-    } else if (jj_2_224(2)) {
+    } else if (jj_2_228(2)) {
       e = Expression(ExprContext.ACCEPT_SUB_QUERY);
         {if (true) return e;}
     } else {
@@ -2873,7 +2892,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public SqlLiteral Natural() throws ParseException {
-    if (jj_2_225(2)) {
+    if (jj_2_229(2)) {
       jj_consume_token(NATURAL);
                 {if (true) return SqlLiteral.createBoolean(true, getPos());}
     } else {
@@ -2884,41 +2903,41 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
   final public SqlLiteral JoinType() throws ParseException {
     JoinType joinType;
-    if (jj_2_229(3)) {
+    if (jj_2_233(2)) {
       jj_consume_token(JOIN);
                  joinType = JoinType.INNER;
-    } else if (jj_2_230(2)) {
+    } else if (jj_2_234(2)) {
       jj_consume_token(INNER);
       jj_consume_token(JOIN);
                          joinType = JoinType.INNER;
-    } else if (jj_2_231(2)) {
+    } else if (jj_2_235(2)) {
       jj_consume_token(LEFT);
-      if (jj_2_226(2)) {
+      if (jj_2_230(2)) {
         jj_consume_token(OUTER);
       } else {
         ;
       }
       jj_consume_token(JOIN);
                                     joinType = JoinType.LEFT;
-    } else if (jj_2_232(2)) {
+    } else if (jj_2_236(2)) {
       jj_consume_token(RIGHT);
-      if (jj_2_227(2)) {
+      if (jj_2_231(2)) {
         jj_consume_token(OUTER);
       } else {
         ;
       }
       jj_consume_token(JOIN);
                                      joinType = JoinType.RIGHT;
-    } else if (jj_2_233(2)) {
+    } else if (jj_2_237(2)) {
       jj_consume_token(FULL);
-      if (jj_2_228(2)) {
+      if (jj_2_232(2)) {
         jj_consume_token(OUTER);
       } else {
         ;
       }
       jj_consume_token(JOIN);
                                     joinType = JoinType.FULL;
-    } else if (jj_2_234(2)) {
+    } else if (jj_2_238(2)) {
       jj_consume_token(CROSS);
       jj_consume_token(JOIN);
                          joinType = JoinType.CROSS;
@@ -2971,7 +2990,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     e = TableRef1(ExprContext.ACCEPT_QUERY_OR_JOIN);
     label_24:
     while (true) {
-      if (jj_2_235(2)) {
+      if (jj_2_239(2)) {
         ;
       } else {
         break label_24;
@@ -2987,11 +3006,11 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlNode e2, condition;
     final SqlLiteral natural, joinType, on, using;
     SqlNodeList list;
-    if (jj_2_238(3)) {
+    if (jj_2_242(3)) {
       natural = Natural();
       joinType = JoinType();
       e2 = TableRef1(ExprContext.ACCEPT_QUERY_OR_JOIN);
-      if (jj_2_236(2)) {
+      if (jj_2_240(2)) {
         jj_consume_token(ON);
                on = JoinConditionType.ON.symbol(getPos());
         condition = Expression(ExprContext.ACCEPT_SUB_QUERY);
@@ -3002,7 +3021,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                 e2,
                 on,
                 condition);}
-      } else if (jj_2_237(2)) {
+      } else if (jj_2_241(2)) {
         jj_consume_token(USING);
                   using = JoinConditionType.USING.symbol(getPos());
         list = ParenthesizedSimpleIdentifierList();
@@ -3022,7 +3041,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                 JoinConditionType.NONE.symbol(joinType.getParserPosition()),
                 null);}
       }
-    } else if (jj_2_239(2)) {
+    } else if (jj_2_243(2)) {
       jj_consume_token(CROSS);
               joinType = JoinType.CROSS.symbol(getPos());
       jj_consume_token(APPLY);
@@ -3037,7 +3056,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             e2,
             JoinConditionType.NONE.symbol(SqlParserPos.ZERO),
             null);}
-    } else if (jj_2_240(2)) {
+    } else if (jj_2_244(2)) {
       jj_consume_token(OUTER);
               joinType = JoinType.LEFT.symbol(getPos());
       jj_consume_token(APPLY);
@@ -3095,31 +3114,36 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlNodeList args;
     final SqlNodeList columnAliasList;
     SqlUnnestOperator unnestOp = SqlStdOperatorTable.UNNEST;
-    if (jj_2_249(2)) {
+    if (jj_2_254(2)) {
       tableName = CompoundTableIdentifier();
-      if (jj_2_241(2)) {
-        tableRef = TableHints(tableName);
+                                                s = span();
+      if (jj_2_249(3)) {
+        tableRef = ImplicitTableFunctionCallArgs(tableName);
       } else {
-                                               tableRef = tableName;
-      }
-      if (jj_2_242(2)) {
-        tableRef = ExtendTable(tableRef);
-      } else {
-        ;
-      }
-      tableRef = Over(tableRef);
-      if (jj_2_243(2)) {
-        tableRef = Snapshot(tableRef);
-      } else {
-        ;
-      }
-      if (jj_2_244(2)) {
-        tableRef = MatchRecognize(tableRef);
-      } else {
-        ;
+        if (jj_2_245(2)) {
+          tableRef = TableHints(tableName);
+        } else {
+                                                   tableRef = tableName;
+        }
+        if (jj_2_246(2)) {
+          tableRef = ExtendTable(tableRef);
+        } else {
+          ;
+        }
+        tableRef = Over(tableRef);
+        if (jj_2_247(2)) {
+          tableRef = Snapshot(tableRef);
+        } else {
+          ;
+        }
+        if (jj_2_248(2)) {
+          tableRef = MatchRecognize(tableRef);
+        } else {
+          ;
+        }
       }
-    } else if (jj_2_250(2)) {
-      if (jj_2_245(2)) {
+    } else if (jj_2_255(2)) {
+      if (jj_2_250(2)) {
         jj_consume_token(LATERAL);
                       lateral = true;
       } else {
@@ -3128,16 +3152,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       tableRef = ParenthesizedExpression(exprContext);
       tableRef = Over(tableRef);
       tableRef = addLateral(tableRef, lateral);
-      if (jj_2_246(2)) {
+      if (jj_2_251(2)) {
         tableRef = MatchRecognize(tableRef);
       } else {
         ;
       }
-    } else if (jj_2_251(2)) {
+    } else if (jj_2_256(2)) {
       jj_consume_token(UNNEST);
                    s = span();
       args = ParenthesizedQueryOrCommaList(ExprContext.ACCEPT_SUB_QUERY);
-      if (jj_2_247(2)) {
+      if (jj_2_252(2)) {
         jj_consume_token(WITH);
         jj_consume_token(ORDINALITY);
                 unnestOp = SqlStdOperatorTable.UNNEST_WITH_ORDINALITY;
@@ -3145,8 +3169,8 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         ;
       }
             tableRef = unnestOp.createCall(s.end(this), (List<SqlNode>) args);
-    } else if (jj_2_252(2)) {
-      if (jj_2_248(2)) {
+    } else if (jj_2_257(2)) {
+      if (jj_2_253(2)) {
         jj_consume_token(LATERAL);
                       lateral = true;
       } else {
@@ -3154,30 +3178,30 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       }
       tableRef = TableFunctionCall();
       tableRef = addLateral(tableRef, lateral);
-    } else if (jj_2_253(2)) {
+    } else if (jj_2_258(2)) {
       tableRef = ExtendedTableRef();
     } else {
       jj_consume_token(-1);
       throw new ParseException();
     }
-    if (jj_2_254(2)) {
+    if (jj_2_259(2)) {
       tableRef = Pivot(tableRef);
     } else {
       ;
     }
-    if (jj_2_255(2)) {
+    if (jj_2_260(2)) {
       tableRef = Unpivot(tableRef);
     } else {
       ;
     }
-    if (jj_2_258(2)) {
-      if (jj_2_256(2)) {
+    if (jj_2_263(2)) {
+      if (jj_2_261(2)) {
         jj_consume_token(AS);
       } else {
         ;
       }
       alias = SimpleIdentifier();
-      if (jj_2_257(2)) {
+      if (jj_2_262(2)) {
         columnAliasList = ParenthesizedSimpleIdentifierList();
       } else {
               columnAliasList = null;
@@ -3202,7 +3226,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     } else {
       ;
     }
-    if (jj_2_259(2)) {
+    if (jj_2_264(2)) {
       tableRef = Tablesample(tableRef);
     } else {
       ;
@@ -3220,7 +3244,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     int repeatableSeed = 0;
     jj_consume_token(TABLESAMPLE);
                     s = span(); checkNotJoin(tableRef);
-    if (jj_2_263(2)) {
+    if (jj_2_268(2)) {
       jj_consume_token(SUBSTITUTE);
       jj_consume_token(LPAREN);
       sample = StringLiteral();
@@ -3230,13 +3254,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             SqlSampleSpec sampleSpec = SqlSampleSpec.createNamed(sampleName);
             final SqlLiteral sampleLiteral =
                 SqlLiteral.createSample(sampleSpec, s.end(this));
-            tableRef = SqlStdOperatorTable.TABLESAMPLE.createCall(
-                s.add(tableRef).end(this), tableRef, sampleLiteral);
-    } else if (jj_2_264(2)) {
-      if (jj_2_260(2)) {
+            {if (true) return SqlStdOperatorTable.TABLESAMPLE.createCall(
+                s.add(tableRef).end(this), tableRef, sampleLiteral);}
+    } else if (jj_2_269(2)) {
+      if (jj_2_265(2)) {
         jj_consume_token(BERNOULLI);
                           isBernoulli = true;
-      } else if (jj_2_261(2)) {
+      } else if (jj_2_266(2)) {
         jj_consume_token(SYSTEM);
                        isBernoulli = false;
       } else {
@@ -3246,7 +3270,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       jj_consume_token(LPAREN);
       samplePercentage = UnsignedNumericLiteral();
       jj_consume_token(RPAREN);
-      if (jj_2_262(2)) {
+      if (jj_2_267(2)) {
         jj_consume_token(REPEATABLE);
         jj_consume_token(LPAREN);
         repeatableSeed = IntLiteral();
@@ -3255,38 +3279,21 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       } else {
         ;
       }
-            final BigDecimal ONE_HUNDRED = BigDecimal.valueOf(100L);
-            BigDecimal rate = samplePercentage.bigDecimalValue();
-            if (rate.compareTo(BigDecimal.ZERO) < 0
-                || rate.compareTo(ONE_HUNDRED) > 0)
-            {
-                {if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.invalidSampleSize());}
-            }
-
-            // Treat TABLESAMPLE(0) and TABLESAMPLE(100) as no table
-            // sampling at all.  Not strictly correct: TABLESAMPLE(0)
-            // should produce no output, but it simplifies implementation
-            // to know that some amount of sampling will occur.
-            // In practice values less than ~1E-43% are treated as 0.0 and
-            // values greater than ~99.999997% are treated as 1.0
-            float fRate = rate.divide(ONE_HUNDRED).floatValue();
-            if (fRate > 0.0f && fRate < 1.0f) {
-                SqlSampleSpec tableSampleSpec =
-                    isRepeatable
-                        ? SqlSampleSpec.createTableSample(
-                            isBernoulli, fRate, repeatableSeed)
-                        : SqlSampleSpec.createTableSample(isBernoulli, fRate);
-
-                SqlLiteral tableSampleLiteral =
-                    SqlLiteral.createSample(tableSampleSpec, s.end(this));
-                tableRef = SqlStdOperatorTable.TABLESAMPLE.createCall(
-                    s.end(this), tableRef, tableSampleLiteral);
-            }
+            BigDecimal rate =
+                samplePercentage.bigDecimalValue().divide(ONE_HUNDRED);
+            SqlSampleSpec tableSampleSpec =
+                isRepeatable
+                    ? SqlSampleSpec.createTableSample(isBernoulli, rate,
+                        repeatableSeed)
+                    : SqlSampleSpec.createTableSample(isBernoulli, rate);
+            SqlLiteral tableSampleLiteral =
+                SqlLiteral.createSample(tableSampleSpec, s.end(this));
+            {if (true) return SqlStdOperatorTable.TABLESAMPLE.createCall(
+                s.end(this), tableRef, tableSampleLiteral);}
     } else {
       jj_consume_token(-1);
       throw new ParseException();
     }
-      {if (true) return tableRef;}
     throw new Error("Missing return statement in function");
   }
 
@@ -3294,7 +3301,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * is present. */
   final public SqlNode ExtendTable(SqlNode tableRef) throws ParseException {
     final SqlNodeList extendList;
-    if (jj_2_265(2)) {
+    if (jj_2_270(2)) {
       jj_consume_token(EXTEND);
     } else {
       ;
@@ -3312,7 +3319,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     AddColumnType(list);
     label_25:
     while (true) {
-      if (jj_2_266(2)) {
+      if (jj_2_271(2)) {
         ;
       } else {
         break label_25;
@@ -3344,7 +3351,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlDataTypeSpec type;
     final boolean nullable;
     name = CompoundIdentifier();
-    if (jj_2_267(2)) {
+    if (jj_2_272(2)) {
       type = DataType();
       nullable = NotNullOpt();
     } else {
@@ -3361,6 +3368,39 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         list.add(name);
   }
 
+  final public SqlNode ImplicitTableFunctionCallArgs(SqlIdentifier name) throws ParseException {
+    final List<SqlNode> tableFuncArgs = new ArrayList<SqlNode>();
+    final SqlNode call;
+    final Span s;
+      s = span();
+    jj_consume_token(LPAREN);
+    if (jj_2_274(2)) {
+      AddArg0(tableFuncArgs, ExprContext.ACCEPT_CURSOR);
+      label_26:
+      while (true) {
+        if (jj_2_273(2)) {
+          ;
+        } else {
+          break label_26;
+        }
+        jj_consume_token(COMMA);
+                // a comma-list can't appear where only a query is expected
+                checkNonQueryExpression(ExprContext.ACCEPT_CURSOR);
+        AddArg(tableFuncArgs, ExprContext.ACCEPT_CURSOR);
+      }
+    } else {
+      ;
+    }
+    jj_consume_token(RPAREN);
+        final SqlParserPos pos = s.end(this);
+        call = createCall(name, pos,
+            SqlFunctionCategory.USER_DEFINED_TABLE_FUNCTION, null,
+            tableFuncArgs);
+        {if (true) return SqlStdOperatorTable.COLLECTION_TABLE.createCall(pos,
+            call);}
+    throw new Error("Missing return statement in function");
+  }
+
   final public SqlNode TableFunctionCall() throws ParseException {
     final Span s;
     final SqlNode call;
@@ -3368,7 +3408,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(TABLE);
               s = span();
     jj_consume_token(LPAREN);
-    if (jj_2_268(2)) {
+    if (jj_2_275(2)) {
       jj_consume_token(SPECIFIC);
             funcType = SqlFunctionCategory.USER_DEFINED_TABLE_SPECIFIC_FUNCTION;
     } else {
@@ -3414,10 +3454,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlNode TableConstructor() throws ParseException {
     final List<SqlNode> list = new ArrayList<SqlNode>();
     final Span s;
-    if (jj_2_269(2)) {
+    if (jj_2_276(2)) {
       jj_consume_token(VALUES);
                    s = span();
-    } else if (jj_2_270(2)) {
+    } else if (jj_2_277(2)) {
       jj_consume_token(VALUE);
             s = span();
             if (!this.conformance.isValueAllowed()) {
@@ -3428,12 +3468,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       throw new ParseException();
     }
     AddRowConstructor(list);
-    label_26:
+    label_27:
     while (true) {
-      if (jj_2_271(2)) {
+      if (jj_2_278(2)) {
         ;
       } else {
-        break label_26;
+        break label_27;
       }
       jj_consume_token(COMMA);
       AddRowConstructor(list);
@@ -3456,22 +3496,22 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlNodeList valueList;
     final SqlNode value;
     final Span s;
-    if (jj_2_273(3)) {
+    if (jj_2_280(3)) {
       jj_consume_token(LPAREN);
                    s = span();
       jj_consume_token(ROW);
       valueList = ParenthesizedQueryOrCommaListWithDefault(ExprContext.ACCEPT_NONCURSOR);
       jj_consume_token(RPAREN);
                    s.add(this);
-    } else if (jj_2_274(3)) {
-      if (jj_2_272(2)) {
+    } else if (jj_2_281(3)) {
+      if (jj_2_279(2)) {
         jj_consume_token(ROW);
                     s = span();
       } else {
               s = Span.of();
       }
       valueList = ParenthesizedQueryOrCommaListWithDefault(ExprContext.ACCEPT_NONCURSOR);
-    } else if (jj_2_275(2)) {
+    } else if (jj_2_282(2)) {
       value = Expression(ExprContext.ACCEPT_NONCURSOR);
             // NOTE: A bare value here is standard SQL syntax, believe it or
             // not.  Taken together with multi-row table constructors, it leads
@@ -3511,10 +3551,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(GROUP);
               s = span();
     jj_consume_token(BY);
-    if (jj_2_276(2)) {
+    if (jj_2_283(2)) {
       jj_consume_token(DISTINCT);
                      distinct = true;
-    } else if (jj_2_277(2)) {
+    } else if (jj_2_284(2)) {
       jj_consume_token(ALL);
                 distinct = false;
     } else {
@@ -3533,12 +3573,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public List<SqlNode> GroupingElementList() throws ParseException {
     final List<SqlNode> list = new ArrayList<SqlNode>();
     AddGroupingElement(list);
-    label_27:
+    label_28:
     while (true) {
-      if (jj_2_278(2)) {
+      if (jj_2_285(2)) {
         ;
       } else {
-        break label_27;
+        break label_28;
       }
       jj_consume_token(COMMA);
       AddGroupingElement(list);
@@ -3551,7 +3591,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final List<SqlNode> subList;
     final SqlNodeList nodes;
     final Span s;
-    if (jj_2_279(2)) {
+    if (jj_2_286(2)) {
       jj_consume_token(GROUPING);
                  s = span();
       jj_consume_token(SETS);
@@ -3560,7 +3600,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       jj_consume_token(RPAREN);
         list.add(
             SqlStdOperatorTable.GROUPING_SETS.createCall(s.end(this), subList));
-    } else if (jj_2_280(2)) {
+    } else if (jj_2_287(2)) {
       jj_consume_token(ROLLUP);
                s = span();
       jj_consume_token(LPAREN);
@@ -3568,7 +3608,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       jj_consume_token(RPAREN);
         list.add(
             SqlStdOperatorTable.ROLLUP.createCall(s.end(this), nodes.getList()));
-    } else if (jj_2_281(2)) {
+    } else if (jj_2_288(2)) {
       jj_consume_token(CUBE);
              s = span();
       jj_consume_token(LPAREN);
@@ -3576,12 +3616,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       jj_consume_token(RPAREN);
         list.add(
             SqlStdOperatorTable.CUBE.createCall(s.end(this), nodes.getList()));
-    } else if (jj_2_282(3)) {
+    } else if (jj_2_289(3)) {
       jj_consume_token(LPAREN);
                s = span();
       jj_consume_token(RPAREN);
         list.add(new SqlNodeList(s.end(this)));
-    } else if (jj_2_283(2)) {
+    } else if (jj_2_290(2)) {
       AddExpression(list, ExprContext.ACCEPT_SUB_QUERY);
     } else {
       jj_consume_token(-1);
@@ -3606,12 +3646,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public void AddExpressions(List<SqlNode> list, ExprContext exprContext) throws ParseException {
     AddExpression(list, exprContext);
-    label_28:
+    label_29:
     while (true) {
-      if (jj_2_284(2)) {
+      if (jj_2_291(2)) {
         ;
       } else {
-        break label_28;
+        break label_29;
       }
       jj_consume_token(COMMA);
       AddExpression(list, ExprContext.ACCEPT_SUB_QUERY);
@@ -3634,12 +3674,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(WINDOW);
                s = span();
     AddWindowSpec(list);
-    label_29:
+    label_30:
     while (true) {
-      if (jj_2_285(2)) {
+      if (jj_2_292(2)) {
         ;
       } else {
-        break label_29;
+        break label_30;
       }
       jj_consume_token(COMMA);
       AddWindowSpec(list);
@@ -3671,12 +3711,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlLiteral allowPartial;
     jj_consume_token(LPAREN);
                s = span();
-    if (jj_2_286(2)) {
+    if (jj_2_293(2)) {
       id = SimpleIdentifier();
     } else {
           id = null;
     }
-    if (jj_2_287(2)) {
+    if (jj_2_294(2)) {
       jj_consume_token(PARTITION);
                       s1 = span();
       jj_consume_token(BY);
@@ -3684,28 +3724,28 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     } else {
           partitionList = SqlNodeList.EMPTY;
     }
-    if (jj_2_288(2)) {
+    if (jj_2_295(2)) {
       orderList = OrderBy(true);
     } else {
           orderList = SqlNodeList.EMPTY;
     }
-    if (jj_2_293(2)) {
-      if (jj_2_289(2)) {
+    if (jj_2_300(2)) {
+      if (jj_2_296(2)) {
         jj_consume_token(ROWS);
                      isRows = SqlLiteral.createBoolean(true, getPos());
-      } else if (jj_2_290(2)) {
+      } else if (jj_2_297(2)) {
         jj_consume_token(RANGE);
                       isRows = SqlLiteral.createBoolean(false, getPos());
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
-      if (jj_2_291(2)) {
+      if (jj_2_298(2)) {
         jj_consume_token(BETWEEN);
         lowerBound = WindowRange();
         jj_consume_token(AND);
         upperBound = WindowRange();
-      } else if (jj_2_292(2)) {
+      } else if (jj_2_299(2)) {
         lowerBound = WindowRange();
               upperBound = null;
       } else {
@@ -3716,12 +3756,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             isRows = SqlLiteral.createBoolean(false, SqlParserPos.ZERO);
             lowerBound = upperBound = null;
     }
-    if (jj_2_294(2)) {
+    if (jj_2_301(2)) {
       jj_consume_token(ALLOW);
                   s2 = span();
       jj_consume_token(PARTIAL);
             allowPartial = SqlLiteral.createBoolean(true, s2.end(this));
-    } else if (jj_2_295(2)) {
+    } else if (jj_2_302(2)) {
       jj_consume_token(DISALLOW);
                      s2 = span();
       jj_consume_token(PARTIAL);
@@ -3738,30 +3778,30 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlNode WindowRange() throws ParseException {
     final SqlNode e;
     final Span s;
-    if (jj_2_300(2)) {
+    if (jj_2_307(2)) {
       jj_consume_token(CURRENT);
                 s = span();
       jj_consume_token(ROW);
         {if (true) return SqlWindow.createCurrentRow(s.end(this));}
-    } else if (jj_2_301(2)) {
+    } else if (jj_2_308(2)) {
       jj_consume_token(UNBOUNDED);
                   s = span();
-      if (jj_2_296(2)) {
+      if (jj_2_303(2)) {
         jj_consume_token(PRECEDING);
             {if (true) return SqlWindow.createUnboundedPreceding(s.end(this));}
-      } else if (jj_2_297(2)) {
+      } else if (jj_2_304(2)) {
         jj_consume_token(FOLLOWING);
             {if (true) return SqlWindow.createUnboundedFollowing(s.end(this));}
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
-    } else if (jj_2_302(2)) {
+    } else if (jj_2_309(2)) {
       e = Expression(ExprContext.ACCEPT_NON_QUERY);
-      if (jj_2_298(2)) {
+      if (jj_2_305(2)) {
         jj_consume_token(PRECEDING);
             {if (true) return SqlWindow.createPreceding(e, getPos());}
-      } else if (jj_2_299(2)) {
+      } else if (jj_2_306(2)) {
         jj_consume_token(FOLLOWING);
             {if (true) return SqlWindow.createFollowing(e, getPos());}
       } else {
@@ -3800,12 +3840,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         }
     jj_consume_token(BY);
     AddOrderItem(list);
-    label_30:
+    label_31:
     while (true) {
-      if (jj_2_303(2)) {
+      if (jj_2_310(2)) {
         ;
       } else {
-        break label_30;
+        break label_31;
       }
       jj_consume_token(COMMA);
       AddOrderItem(list);
@@ -3820,10 +3860,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public void AddOrderItem(List<SqlNode> list) throws ParseException {
     SqlNode e;
     e = Expression(ExprContext.ACCEPT_SUB_QUERY);
-    if (jj_2_306(2)) {
-      if (jj_2_304(2)) {
+    if (jj_2_313(2)) {
+      if (jj_2_311(2)) {
         jj_consume_token(ASC);
-      } else if (jj_2_305(2)) {
+      } else if (jj_2_312(2)) {
         jj_consume_token(DESC);
             e = SqlStdOperatorTable.DESC.createCall(getPos(), e);
       } else {
@@ -3833,12 +3873,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     } else {
       ;
     }
-    if (jj_2_309(2)) {
-      if (jj_2_307(2)) {
+    if (jj_2_316(2)) {
+      if (jj_2_314(2)) {
         jj_consume_token(NULLS);
         jj_consume_token(FIRST);
             e = SqlStdOperatorTable.NULLS_FIRST.createCall(getPos(), e);
-      } else if (jj_2_308(2)) {
+      } else if (jj_2_315(2)) {
         jj_consume_token(NULLS);
         jj_consume_token(LAST);
             e = SqlStdOperatorTable.NULLS_LAST.createCall(getPos(), e);
@@ -3910,12 +3950,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
               s = span(); checkNotJoin(tableRef);
     jj_consume_token(LPAREN);
     AddPivotAgg(aggList);
-    label_31:
+    label_32:
     while (true) {
-      if (jj_2_310(2)) {
+      if (jj_2_317(2)) {
         ;
       } else {
-        break label_31;
+        break label_32;
       }
       jj_consume_token(COMMA);
       AddPivotAgg(aggList);
@@ -3925,14 +3965,14 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(IN);
     jj_consume_token(LPAREN);
                     s2 = span();
-    if (jj_2_312(2)) {
+    if (jj_2_319(2)) {
       AddPivotValue(valueList);
-      label_32:
+      label_33:
       while (true) {
-        if (jj_2_311(2)) {
+        if (jj_2_318(2)) {
           ;
         } else {
-          break label_32;
+          break label_33;
         }
         jj_consume_token(COMMA);
         AddPivotValue(valueList);
@@ -3954,7 +3994,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlIdentifier alias;
     e = NamedFunctionCall();
     if (getToken(1).kind != COMMA && getToken(1).kind != FOR) {
-      if (jj_2_313(2)) {
+      if (jj_2_320(2)) {
         jj_consume_token(AS);
       } else {
         ;
@@ -3974,8 +4014,8 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlIdentifier alias;
     e = RowConstructor();
                            tuple = SqlParserUtil.stripRow(e);
-    if (jj_2_315(2)) {
-      if (jj_2_314(2)) {
+    if (jj_2_322(2)) {
+      if (jj_2_321(2)) {
         jj_consume_token(AS);
       } else {
         ;
@@ -4000,11 +4040,11 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlNodeList inList;
     jj_consume_token(UNPIVOT);
                 s = span(); checkNotJoin(tableRef);
-    if (jj_2_316(2)) {
+    if (jj_2_323(2)) {
       jj_consume_token(INCLUDE);
       jj_consume_token(NULLS);
                             includeNulls = true;
-    } else if (jj_2_317(2)) {
+    } else if (jj_2_324(2)) {
       jj_consume_token(EXCLUDE);
       jj_consume_token(NULLS);
                             includeNulls = false;
@@ -4019,12 +4059,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(LPAREN);
                s2 = span();
     AddUnpivotValue(values);
-    label_33:
+    label_34:
     while (true) {
-      if (jj_2_318(2)) {
+      if (jj_2_325(2)) {
         ;
       } else {
-        break label_33;
+        break label_34;
       }
       jj_consume_token(COMMA);
       AddUnpivotValue(values);
@@ -4041,7 +4081,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlNodeList columnList;
     final SqlNode values;
     columnList = SimpleIdentifierOrList();
-    if (jj_2_319(2)) {
+    if (jj_2_326(2)) {
       jj_consume_token(AS);
       values = RowConstructor();
             final SqlNodeList valueList = SqlParserUtil.stripRow(values);
@@ -4073,7 +4113,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(MATCH_RECOGNIZE);
                         s = span(); checkNotJoin(tableRef);
     jj_consume_token(LPAREN);
-    if (jj_2_320(2)) {
+    if (jj_2_327(2)) {
       jj_consume_token(PARTITION);
                       s2 = span();
       jj_consume_token(BY);
@@ -4081,25 +4121,25 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     } else {
           partitionList = SqlNodeList.EMPTY;
     }
-    if (jj_2_321(2)) {
+    if (jj_2_328(2)) {
       orderList = OrderBy(true);
     } else {
           orderList = SqlNodeList.EMPTY;
     }
-    if (jj_2_322(2)) {
+    if (jj_2_329(2)) {
       jj_consume_token(MEASURES);
       measureList = MeasureColumnCommaList(span());
     } else {
           measureList = SqlNodeList.EMPTY;
     }
-    if (jj_2_323(2)) {
+    if (jj_2_330(2)) {
       jj_consume_token(ONE);
                 s0 = span();
       jj_consume_token(ROW);
       jj_consume_token(PER);
       jj_consume_token(MATCH);
             rowsPerMatch = SqlMatchRecognize.RowsPerMatchOption.ONE_ROW.symbol(s0.end(this));
-    } else if (jj_2_324(2)) {
+    } else if (jj_2_331(2)) {
       jj_consume_token(ALL);
                 s0 = span();
       jj_consume_token(ROWS);
@@ -4109,25 +4149,25 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     } else {
           rowsPerMatch = null;
     }
-    if (jj_2_330(2)) {
+    if (jj_2_337(2)) {
       jj_consume_token(AFTER);
                   s1 = span();
       jj_consume_token(MATCH);
       jj_consume_token(SKIP_);
-      if (jj_2_328(2)) {
+      if (jj_2_335(2)) {
         jj_consume_token(TO);
-        if (jj_2_326(2)) {
+        if (jj_2_333(2)) {
           jj_consume_token(NEXT);
           jj_consume_token(ROW);
                     after = SqlMatchRecognize.AfterOption.SKIP_TO_NEXT_ROW
                         .symbol(s1.end(this));
-        } else if (jj_2_327(2)) {
+        } else if (jj_2_334(2)) {
           jj_consume_token(FIRST);
           var = SimpleIdentifier();
                     after = SqlMatchRecognize.SKIP_TO_FIRST.createCall(
                         s1.end(var), var);
         } else if (true) {
-          if (jj_2_325(2)) {
+          if (jj_2_332(2)) {
             jj_consume_token(LAST);
           } else {
             ;
@@ -4139,7 +4179,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
           jj_consume_token(-1);
           throw new ParseException();
         }
-      } else if (jj_2_329(2)) {
+      } else if (jj_2_336(2)) {
         jj_consume_token(PAST);
         jj_consume_token(LAST);
         jj_consume_token(ROW);
@@ -4154,27 +4194,27 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     }
     jj_consume_token(PATTERN);
     jj_consume_token(LPAREN);
-    if (jj_2_331(2)) {
+    if (jj_2_338(2)) {
       jj_consume_token(CARET);
                   isStrictStarts = SqlLiteral.createBoolean(true, getPos());
     } else {
           isStrictStarts = SqlLiteral.createBoolean(false, getPos());
     }
     pattern = PatternExpression();
-    if (jj_2_332(2)) {
+    if (jj_2_339(2)) {
       jj_consume_token(DOLLAR);
                    isStrictEnds = SqlLiteral.createBoolean(true, getPos());
     } else {
           isStrictEnds = SqlLiteral.createBoolean(false, getPos());
     }
     jj_consume_token(RPAREN);
-    if (jj_2_333(2)) {
+    if (jj_2_340(2)) {
       jj_consume_token(WITHIN);
       interval = IntervalLiteral();
     } else {
           interval = null;
     }
-    if (jj_2_334(2)) {
+    if (jj_2_341(2)) {
       jj_consume_token(SUBSET);
       subsetList = SubsetDefinitionCommaList(span());
     } else {
@@ -4192,12 +4232,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlNodeList MeasureColumnCommaList(Span s) throws ParseException {
     final List<SqlNode> list = new ArrayList<SqlNode>();
     AddMeasureColumn(list);
-    label_34:
+    label_35:
     while (true) {
-      if (jj_2_335(2)) {
+      if (jj_2_342(2)) {
         ;
       } else {
-        break label_34;
+        break label_35;
       }
       jj_consume_token(COMMA);
       AddMeasureColumn(list);
@@ -4219,12 +4259,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlNode left;
     SqlNode right;
     left = PatternTerm();
-    label_35:
+    label_36:
     while (true) {
-      if (jj_2_336(2)) {
+      if (jj_2_343(2)) {
         ;
       } else {
-        break label_35;
+        break label_36;
       }
       jj_consume_token(VERTICAL_BAR);
       right = PatternTerm();
@@ -4239,12 +4279,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlNode left;
     SqlNode right;
     left = PatternFactor();
-    label_36:
+    label_37:
     while (true) {
-      if (jj_2_337(2)) {
+      if (jj_2_344(2)) {
         ;
       } else {
-        break label_36;
+        break label_37;
       }
       right = PatternFactor();
             left = SqlStdOperatorTable.PATTERN_CONCAT.createCall(
@@ -4266,25 +4306,25 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     case HOOK:
     case PLUS:
     case STAR:
-      if (jj_2_343(2)) {
+      if (jj_2_350(2)) {
         jj_consume_token(STAR);
                 startNum = LITERAL_ZERO;
                 endNum = LITERAL_MINUS_ONE;
-      } else if (jj_2_344(2)) {
+      } else if (jj_2_351(2)) {
         jj_consume_token(PLUS);
                 startNum = LITERAL_ONE;
                 endNum = LITERAL_MINUS_ONE;
-      } else if (jj_2_345(2)) {
+      } else if (jj_2_352(2)) {
         jj_consume_token(HOOK);
                 startNum = LITERAL_ZERO;
                 endNum = LITERAL_ONE;
-      } else if (jj_2_346(2)) {
+      } else if (jj_2_353(2)) {
         jj_consume_token(LBRACE);
-        if (jj_2_340(2)) {
+        if (jj_2_347(2)) {
           startNum = UnsignedNumericLiteral();
-          if (jj_2_339(2)) {
+          if (jj_2_346(2)) {
             jj_consume_token(COMMA);
-            if (jj_2_338(2)) {
+            if (jj_2_345(2)) {
               endNum = UnsignedNumericLiteral();
             } else {
                           endNum = LITERAL_MINUS_ONE;
@@ -4293,12 +4333,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                        endNum = startNum;
           }
           jj_consume_token(RBRACE);
-        } else if (jj_2_341(2)) {
+        } else if (jj_2_348(2)) {
           jj_consume_token(COMMA);
           endNum = UnsignedNumericLiteral();
           jj_consume_token(RBRACE);
                   startNum = LITERAL_MINUS_ONE;
-        } else if (jj_2_342(2)) {
+        } else if (jj_2_349(2)) {
           jj_consume_token(MINUS);
           extra = PatternExpression();
           jj_consume_token(MINUS);
@@ -4315,7 +4355,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         jj_consume_token(-1);
         throw new ParseException();
       }
-      if (jj_2_347(2)) {
+      if (jj_2_354(2)) {
         jj_consume_token(HOOK);
                 reluctant = SqlLiteral.createBoolean(
                     startNum.intValue(true) != endNum.intValue(true),
@@ -4337,15 +4377,15 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     SqlNode e;
     final List<SqlNode> list;
-    if (jj_2_349(2)) {
+    if (jj_2_356(2)) {
       e = SimpleIdentifier();
                              {if (true) return e;}
-    } else if (jj_2_350(2)) {
+    } else if (jj_2_357(2)) {
       jj_consume_token(LPAREN);
       e = PatternExpression();
       jj_consume_token(RPAREN);
                                                 {if (true) return e;}
-    } else if (jj_2_351(2)) {
+    } else if (jj_2_358(2)) {
       jj_consume_token(LBRACE);
                s = span();
       jj_consume_token(MINUS);
@@ -4353,18 +4393,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       jj_consume_token(MINUS);
       jj_consume_token(RBRACE);
         {if (true) return SqlStdOperatorTable.PATTERN_EXCLUDE.createCall(s.end(this), e);}
-    } else if (jj_2_352(2)) {
+    } else if (jj_2_359(2)) {
       jj_consume_token(PERMUTE);
                     s = span(); list = new ArrayList<SqlNode>();
       jj_consume_token(LPAREN);
       e = PatternExpression();
                                   list.add(e);
-      label_37:
+      label_38:
       while (true) {
-        if (jj_2_348(2)) {
+        if (jj_2_355(2)) {
           ;
         } else {
-          break label_37;
+          break label_38;
         }
         jj_consume_token(COMMA);
         e = PatternExpression();
@@ -4383,12 +4423,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlNodeList SubsetDefinitionCommaList(Span s) throws ParseException {
     final List<SqlNode> list = new ArrayList<SqlNode>();
     AddSubsetDefinition(list);
-    label_38:
+    label_39:
     while (true) {
-      if (jj_2_353(2)) {
+      if (jj_2_360(2)) {
         ;
       } else {
-        break label_38;
+        break label_39;
       }
       jj_consume_token(COMMA);
       AddSubsetDefinition(list);
@@ -4415,12 +4455,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final List<SqlNode> eList = new ArrayList<SqlNode>();
     e = PatternDefinition();
         eList.add(e);
-    label_39:
+    label_40:
     while (true) {
-      if (jj_2_354(2)) {
+      if (jj_2_361(2)) {
         ;
       } else {
-        break label_39;
+        break label_40;
       }
       jj_consume_token(COMMA);
       e = PatternDefinition();
@@ -4479,19 +4519,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlNodeList withList = null;
     final SqlNode e;
     final List<Object> list = new ArrayList<Object>();
-    if (jj_2_355(2)) {
+    if (jj_2_362(2)) {
       withList = WithList();
     } else {
       ;
     }
     e = LeafQueryOrExpr(exprContext);
                                        list.add(e);
-    label_40:
+    label_41:
     while (true) {
-      if (jj_2_356(2)) {
+      if (jj_2_363(2)) {
         ;
       } else {
-        break label_40;
+        break label_41;
       }
       AddSetOpQuery(list, exprContext);
     }
@@ -4503,19 +4543,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlNodeList withList = null;
     final SqlNode e;
     final List<Object> list = new ArrayList<Object>();
-    if (jj_2_357(2)) {
+    if (jj_2_364(2)) {
       withList = WithList();
     } else {
       ;
     }
     e = LeafQuery(exprContext);
                                  list.add(e);
-    label_41:
+    label_42:
     while (true) {
-      if (jj_2_358(2)) {
+      if (jj_2_365(2)) {
         ;
       } else {
-        break label_41;
+        break label_42;
       }
       AddSetOpQuery(list, exprContext);
     }
@@ -4576,36 +4616,43 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlNodeList WithList() throws ParseException {
     final Span s;
     final List<SqlWithItem> list = new ArrayList<SqlWithItem>();
+    boolean recursive = false;
     jj_consume_token(WITH);
-             s = span();
-    AddWithItem(list);
-    label_42:
+    if (jj_2_366(2)) {
+      jj_consume_token(RECURSIVE);
+                           recursive = true;
+    } else {
+      ;
+    }
+                                                  s = span();
+    AddWithItem(list, SqlLiteral.createBoolean(recursive, getPos()));
+    label_43:
     while (true) {
-      if (jj_2_359(2)) {
+      if (jj_2_367(2)) {
         ;
       } else {
-        break label_42;
+        break label_43;
       }
       jj_consume_token(COMMA);
-      AddWithItem(list);
+      AddWithItem(list, SqlLiteral.createBoolean(recursive, getPos()));
     }
       {if (true) return new SqlNodeList(list, s.end(this));}
     throw new Error("Missing return statement in function");
   }
 
-  final public void AddWithItem(List<SqlWithItem> list) throws ParseException {
+  final public void AddWithItem(List<SqlWithItem> list, SqlLiteral recursive) throws ParseException {
     final SqlIdentifier id;
     final SqlNodeList columnList;
     final SqlNode definition;
     id = SimpleIdentifier();
-    if (jj_2_360(2)) {
+    if (jj_2_368(2)) {
       columnList = ParenthesizedSimpleIdentifierList();
     } else {
                                                            columnList = null;
     }
     jj_consume_token(AS);
     definition = ParenthesizedExpression(ExprContext.ACCEPT_QUERY);
-      list.add(new SqlWithItem(id.getParserPosition(), id, columnList, definition));
+      list.add(new SqlWithItem(id.getParserPosition(), id, columnList, definition, recursive));
   }
 
 /**
@@ -4614,10 +4661,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public SqlNode LeafQueryOrExpr(ExprContext exprContext) throws ParseException {
     SqlNode e;
-    if (jj_2_361(2)) {
+    if (jj_2_369(2)) {
       e = LeafQuery(exprContext);
                                  {if (true) return e;}
-    } else if (jj_2_362(2)) {
+    } else if (jj_2_370(2)) {
       e = Expression(exprContext);
                                   {if (true) return e;}
     } else {
@@ -4648,7 +4695,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlNode e;
     SqlOperator op;
     SqlNode ext;
-    label_43:
+    label_44:
     while (true) {
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
       case EXISTS:
@@ -4660,7 +4707,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         break;
       default:
         jj_la1[4] = jj_gen;
-        break label_43;
+        break label_44;
       }
       op = PrefixRowOperator();
             checkNonQueryExpression(exprContext);
@@ -4668,12 +4715,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     }
     e = Expression3(exprContext);
         list.add(e);
-    label_44:
+    label_45:
     while (true) {
-      if (jj_2_363(2)) {
+      if (jj_2_371(2)) {
         ;
       } else {
-        break label_44;
+        break label_45;
       }
       jj_consume_token(DOT);
       ext = RowExpressionExtension();
@@ -4704,32 +4751,33 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final List<Object> list3 = new ArrayList();
     SqlNodeList nodeList;
     SqlNode e;
+    SqlOperator itemOp;
     SqlOperator op;
     SqlIdentifier p;
     final Span s = span();
     AddExpression2b(list, exprContext);
-    if (jj_2_402(2)) {
-      label_45:
+    if (jj_2_410(2)) {
+      label_46:
       while (true) {
-        if (jj_2_394(2)) {
+        if (jj_2_402(2)) {
                     checkNonQueryExpression(exprContext);
-          if (jj_2_367(2)) {
+          if (jj_2_375(2)) {
             jj_consume_token(NOT);
             jj_consume_token(IN);
                                  op = SqlStdOperatorTable.NOT_IN;
-          } else if (jj_2_368(2)) {
+          } else if (jj_2_376(2)) {
             jj_consume_token(IN);
                            op = SqlStdOperatorTable.IN;
-          } else if (jj_2_369(2)) {
+          } else if (jj_2_377(2)) {
                       final SqlKind k;
             k = comp();
-            if (jj_2_364(2)) {
+            if (jj_2_372(2)) {
               jj_consume_token(SOME);
                                  op = SqlStdOperatorTable.some(k);
-            } else if (jj_2_365(2)) {
+            } else if (jj_2_373(2)) {
               jj_consume_token(ANY);
                                 op = SqlStdOperatorTable.some(k);
-            } else if (jj_2_366(2)) {
+            } else if (jj_2_374(2)) {
               jj_consume_token(ALL);
                                 op = SqlStdOperatorTable.all(k);
             } else {
@@ -4755,18 +4803,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                     } else {
                         list.add(nodeList);
                     }
-        } else if (jj_2_395(2)) {
+        } else if (jj_2_403(2)) {
                     checkNonQueryExpression(exprContext);
-          if (jj_2_376(2)) {
+          if (jj_2_384(2)) {
             jj_consume_token(NOT);
             jj_consume_token(BETWEEN);
                         op = SqlStdOperatorTable.NOT_BETWEEN;
                         s.clear().add(this);
-            if (jj_2_372(2)) {
-              if (jj_2_370(2)) {
+            if (jj_2_380(2)) {
+              if (jj_2_378(2)) {
                 jj_consume_token(SYMMETRIC);
                                       op = SqlStdOperatorTable.SYMMETRIC_NOT_BETWEEN;
-              } else if (jj_2_371(2)) {
+              } else if (jj_2_379(2)) {
                 jj_consume_token(ASYMMETRIC);
               } else {
                 jj_consume_token(-1);
@@ -4775,15 +4823,15 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             } else {
               ;
             }
-          } else if (jj_2_377(2)) {
+          } else if (jj_2_385(2)) {
             jj_consume_token(BETWEEN);
                         op = SqlStdOperatorTable.BETWEEN;
                         s.clear().add(this);
-            if (jj_2_375(2)) {
-              if (jj_2_373(2)) {
+            if (jj_2_383(2)) {
+              if (jj_2_381(2)) {
                 jj_consume_token(SYMMETRIC);
                                       op = SqlStdOperatorTable.SYMMETRIC_BETWEEN;
-              } else if (jj_2_374(2)) {
+              } else if (jj_2_382(2)) {
                 jj_consume_token(ASYMMETRIC);
               } else {
                 jj_consume_token(-1);
@@ -4800,22 +4848,22 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                     list.add(new SqlParserUtil.ToTreeListItem(op, s.pos()));
                     list.addAll(list3);
                     list3.clear();
-        } else if (jj_2_396(2)) {
+        } else if (jj_2_404(2)) {
                     checkNonQueryExpression(exprContext);
                     s.clear().add(this);
-          if (jj_2_389(2)) {
-            if (jj_2_382(2)) {
+          if (jj_2_397(2)) {
+            if (jj_2_390(2)) {
               jj_consume_token(NOT);
-              if (jj_2_378(2)) {
+              if (jj_2_386(2)) {
                 jj_consume_token(LIKE);
                                      op = SqlStdOperatorTable.NOT_LIKE;
-              } else if (jj_2_379(2)) {
+              } else if (jj_2_387(2)) {
                 jj_consume_token(ILIKE);
                                       op = SqlLibraryOperators.NOT_ILIKE;
-              } else if (jj_2_380(2)) {
+              } else if (jj_2_388(2)) {
                 jj_consume_token(RLIKE);
                                       op = SqlLibraryOperators.NOT_RLIKE;
-              } else if (jj_2_381(2)) {
+              } else if (jj_2_389(2)) {
                 jj_consume_token(SIMILAR);
                 jj_consume_token(TO);
                                              op = SqlStdOperatorTable.NOT_SIMILAR_TO;
@@ -4823,16 +4871,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                 jj_consume_token(-1);
                 throw new ParseException();
               }
-            } else if (jj_2_383(2)) {
+            } else if (jj_2_391(2)) {
               jj_consume_token(LIKE);
                                  op = SqlStdOperatorTable.LIKE;
-            } else if (jj_2_384(2)) {
+            } else if (jj_2_392(2)) {
               jj_consume_token(ILIKE);
                                   op = SqlLibraryOperators.ILIKE;
-            } else if (jj_2_385(2)) {
+            } else if (jj_2_393(2)) {
               jj_consume_token(RLIKE);
                                   op = SqlLibraryOperators.RLIKE;
-            } else if (jj_2_386(2)) {
+            } else if (jj_2_394(2)) {
               jj_consume_token(SIMILAR);
               jj_consume_token(TO);
                                          op = SqlStdOperatorTable.SIMILAR_TO;
@@ -4840,20 +4888,20 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
               jj_consume_token(-1);
               throw new ParseException();
             }
-          } else if (jj_2_390(2)) {
+          } else if (jj_2_398(2)) {
             jj_consume_token(NEGATE);
             jj_consume_token(TILDE);
                                        op = SqlStdOperatorTable.NEGATED_POSIX_REGEX_CASE_SENSITIVE;
-            if (jj_2_387(2)) {
+            if (jj_2_395(2)) {
               jj_consume_token(STAR);
                                op = SqlStdOperatorTable.NEGATED_POSIX_REGEX_CASE_INSENSITIVE;
             } else {
               ;
             }
-          } else if (jj_2_391(2)) {
+          } else if (jj_2_399(2)) {
             jj_consume_token(TILDE);
                               op = SqlStdOperatorTable.POSIX_REGEX_CASE_SENSITIVE;
-            if (jj_2_388(2)) {
+            if (jj_2_396(2)) {
               jj_consume_token(STAR);
                                op = SqlStdOperatorTable.POSIX_REGEX_CASE_INSENSITIVE;
             } else {
@@ -4866,7 +4914,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
           list2 = Expression2(ExprContext.ACCEPT_SUB_QUERY);
                     list.add(new SqlParserUtil.ToTreeListItem(op, s.pos()));
                     list.addAll(list2);
-          if (jj_2_392(2)) {
+          if (jj_2_400(2)) {
             jj_consume_token(ESCAPE);
             e = Expression3(ExprContext.ACCEPT_SUB_QUERY);
                         s.clear().add(this);
@@ -4877,27 +4925,28 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
           } else {
             ;
           }
-        } else if (jj_2_397(2)) {
+        } else if (jj_2_405(2)) {
           InfixCast(list, exprContext, s);
-        } else if (jj_2_398(3)) {
+        } else if (jj_2_406(3)) {
           op = BinaryRowOperator();
                     checkNonQueryExpression(exprContext);
                     list.add(new SqlParserUtil.ToTreeListItem(op, getPos()));
           AddExpression2b(list, ExprContext.ACCEPT_SUB_QUERY);
-        } else if (jj_2_399(2)) {
+        } else if (jj_2_407(2)) {
           jj_consume_token(LBRACKET);
+          itemOp = getItemOp();
           e = Expression(ExprContext.ACCEPT_SUB_QUERY);
           jj_consume_token(RBRACKET);
                     list.add(
                         new SqlParserUtil.ToTreeListItem(
-                            SqlStdOperatorTable.ITEM, getPos()));
+                            itemOp, getPos()));
                     list.add(e);
-          label_46:
+          label_47:
           while (true) {
-            if (jj_2_393(2)) {
+            if (jj_2_401(2)) {
               ;
             } else {
-              break label_46;
+              break label_47;
             }
             jj_consume_token(DOT);
             p = SimpleIdentifier();
@@ -4906,7 +4955,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                                 SqlStdOperatorTable.DOT, getPos()));
                         list.add(p);
           }
-        } else if (jj_2_400(2)) {
+        } else if (jj_2_408(2)) {
                     checkNonQueryExpression(exprContext);
           op = PostfixRowOperator();
                     list.add(new SqlParserUtil.ToTreeListItem(op, getPos()));
@@ -4914,10 +4963,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
           jj_consume_token(-1);
           throw new ParseException();
         }
-        if (jj_2_401(2)) {
+        if (jj_2_409(2)) {
           ;
         } else {
-          break label_45;
+          break label_46;
         }
       }
             {if (true) return list;}
@@ -4927,27 +4976,47 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     throw new Error("Missing return statement in function");
   }
 
+/** Returns the appropriate ITEM operator for indexing arrays. */
+  final public SqlOperator getItemOp() throws ParseException {
+    if (jj_2_411(2)) {
+      jj_consume_token(OFFSET);
+               {if (true) return SqlLibraryOperators.OFFSET;}
+    } else if (jj_2_412(2)) {
+      jj_consume_token(ORDINAL);
+                {if (true) return SqlLibraryOperators.ORDINAL;}
+    } else if (jj_2_413(2)) {
+      jj_consume_token(SAFE_OFFSET);
+                    {if (true) return SqlLibraryOperators.SAFE_OFFSET;}
+    } else if (jj_2_414(2)) {
+      jj_consume_token(SAFE_ORDINAL);
+                     {if (true) return SqlLibraryOperators.SAFE_ORDINAL;}
+    } else {
+      {if (true) return SqlStdOperatorTable.ITEM;}
+    }
+    throw new Error("Missing return statement in function");
+  }
+
 /** Parses a comparison operator inside a SOME / ALL predicate. */
   final public SqlKind comp() throws ParseException {
-    if (jj_2_403(2)) {
+    if (jj_2_415(2)) {
       jj_consume_token(LT);
            {if (true) return SqlKind.LESS_THAN;}
-    } else if (jj_2_404(2)) {
+    } else if (jj_2_416(2)) {
       jj_consume_token(LE);
            {if (true) return SqlKind.LESS_THAN_OR_EQUAL;}
-    } else if (jj_2_405(2)) {
+    } else if (jj_2_417(2)) {
       jj_consume_token(GT);
            {if (true) return SqlKind.GREATER_THAN;}
-    } else if (jj_2_406(2)) {
+    } else if (jj_2_418(2)) {
       jj_consume_token(GE);
            {if (true) return SqlKind.GREATER_THAN_OR_EQUAL;}
-    } else if (jj_2_407(2)) {
+    } else if (jj_2_419(2)) {
       jj_consume_token(EQ);
            {if (true) return SqlKind.EQUALS;}
-    } else if (jj_2_408(2)) {
+    } else if (jj_2_420(2)) {
       jj_consume_token(NE);
            {if (true) return SqlKind.NOT_EQUALS;}
-    } else if (jj_2_409(2)) {
+    } else if (jj_2_421(2)) {
       jj_consume_token(NE2);
         if (!this.conformance.isBangEqualAllowed()) {
             {if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.bangEqualNotAllowed());}
@@ -4970,14 +5039,14 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlNodeList list1;
     final Span s;
     final Span rowSpan;
-    if (jj_2_412(2)) {
+    if (jj_2_424(2)) {
       e = AtomicRowExpression();
         checkNonQueryExpression(exprContext);
         {if (true) return e;}
-    } else if (jj_2_413(2)) {
+    } else if (jj_2_425(2)) {
       e = CursorExpression(exprContext);
                                         {if (true) return e;}
-    } else if (jj_2_414(3)) {
+    } else if (jj_2_426(3)) {
       jj_consume_token(ROW);
         s = span();
       list = ParenthesizedQueryOrCommaList(exprContext);
@@ -4989,8 +5058,8 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                 RESOURCE.illegalRowExpression());}
         }
         {if (true) return SqlStdOperatorTable.ROW.createCall(list);}
-    } else if (jj_2_415(2)) {
-      if (jj_2_410(2)) {
+    } else if (jj_2_427(2)) {
+      if (jj_2_422(2)) {
         jj_consume_token(ROW);
                 rowSpan = span();
       } else {
@@ -5002,7 +5071,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             {if (true) return SqlStdOperatorTable.ROW.createCall(rowSpan.end(list1),
                 (List<SqlNode>) list1);}
         }
-      if (jj_2_411(2)) {
+      if (jj_2_423(2)) {
         e = IntervalQualifier();
                 if ((list1.size() == 1)
                     && list1.get(0) instanceof SqlCall)
@@ -5035,25 +5104,64 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     throw new Error("Missing return statement in function");
   }
 
+/**
+ * Parses a lambda expression.
+ */
+  final public SqlNode LambdaExpression() throws ParseException {
+    final SqlNodeList parameters;
+    final SqlNode expression;
+    final Span s;
+    parameters = SimpleIdentifierOrListOrEmpty();
+    jj_consume_token(LAMBDA);
+               s = span();
+    expression = Expression(ExprContext.ACCEPT_NON_QUERY);
+        {if (true) return new SqlLambda(s.end(this), parameters, expression);}
+    throw new Error("Missing return statement in function");
+  }
+
+/**
+ * List of simple identifiers in parentheses or empty parentheses or one simple identifier.
+ * <ul>Examples:
+ * <li>{@code ()}
+ * <li>{@code DEPTNO}
+ * <li>{@code (EMPNO, DEPTNO)}
+ * </ul>
+ */
+  final public SqlNodeList SimpleIdentifierOrListOrEmpty() throws ParseException {
+    SqlNodeList list;
+    if (jj_2_428(2)) {
+      jj_consume_token(LPAREN);
+      jj_consume_token(RPAREN);
+                        {if (true) return SqlNodeList.EMPTY;}
+    } else if (jj_2_429(2)) {
+      list = SimpleIdentifierOrList();
+                                      {if (true) return list;}
+    } else {
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+    throw new Error("Missing return statement in function");
+  }
+
   final public SqlOperator periodOperator() throws ParseException {
-    if (jj_2_416(2)) {
+    if (jj_2_430(2)) {
       jj_consume_token(OVERLAPS);
                   {if (true) return SqlStdOperatorTable.OVERLAPS;}
-    } else if (jj_2_417(2)) {
+    } else if (jj_2_431(2)) {
       jj_consume_token(IMMEDIATELY);
       jj_consume_token(PRECEDES);
                                 {if (true) return SqlStdOperatorTable.IMMEDIATELY_PRECEDES;}
-    } else if (jj_2_418(2)) {
+    } else if (jj_2_432(2)) {
       jj_consume_token(PRECEDES);
                   {if (true) return SqlStdOperatorTable.PRECEDES;}
-    } else if (jj_2_419(2)) {
+    } else if (jj_2_433(2)) {
       jj_consume_token(IMMEDIATELY);
       jj_consume_token(SUCCEEDS);
                                 {if (true) return SqlStdOperatorTable.IMMEDIATELY_SUCCEEDS;}
-    } else if (jj_2_420(2)) {
+    } else if (jj_2_434(2)) {
       jj_consume_token(SUCCEEDS);
                   {if (true) return SqlStdOperatorTable.SUCCEEDS;}
-    } else if (jj_2_421(2)) {
+    } else if (jj_2_435(2)) {
       jj_consume_token(EQUALS);
                 {if (true) return SqlStdOperatorTable.PERIOD_EQUALS;}
     } else {
@@ -5079,9 +5187,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public SqlNode UnsignedNumericLiteralOrParam() throws ParseException {
     final SqlNode e;
-    if (jj_2_422(2)) {
+    if (jj_2_436(2)) {
       e = UnsignedNumericLiteral();
-    } else if (jj_2_423(2)) {
+    } else if (jj_2_437(2)) {
       e = DynamicParam();
     } else {
       jj_consume_token(-1);
@@ -5102,20 +5210,20 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final List<SqlNode> args;
     final SqlLiteral quantifier;
     p = SimpleIdentifier();
-    if (jj_2_427(2147483647)) {
+    if (jj_2_441(2147483647)) {
                                 s = span();
-      if (jj_2_424(2)) {
+      if (jj_2_438(2)) {
         jj_consume_token(LPAREN);
         jj_consume_token(STAR);
                 quantifier = null;
                 args = ImmutableList.of(SqlIdentifier.star(getPos()));
         jj_consume_token(RPAREN);
-      } else if (jj_2_425(2)) {
+      } else if (jj_2_439(2)) {
         jj_consume_token(LPAREN);
         jj_consume_token(RPAREN);
                 quantifier = null;
                 args = ImmutableList.of();
-      } else if (jj_2_426(2)) {
+      } else if (jj_2_440(2)) {
         args = FunctionParameterList(ExprContext.ACCEPT_SUB_QUERY);
                 quantifier = (SqlLiteral) args.get(0);
                 args.remove(0);
@@ -5142,16 +5250,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlNodeList orderBy;
     final Pair<SqlParserPos, SqlOperator> nullTreatment;
     final SqlNode separator;
-    if (jj_2_428(2)) {
+    if (jj_2_442(2)) {
       jj_consume_token(ARRAY_AGG);
                       s = span(); op = SqlLibraryOperators.ARRAY_AGG;
-    } else if (jj_2_429(2)) {
+    } else if (jj_2_443(2)) {
       jj_consume_token(ARRAY_CONCAT_AGG);
                              s = span(); op = SqlLibraryOperators.ARRAY_CONCAT_AGG;
-    } else if (jj_2_430(2)) {
+    } else if (jj_2_444(2)) {
       jj_consume_token(GROUP_CONCAT);
                          s = span(); op = SqlLibraryOperators.GROUP_CONCAT;
-    } else if (jj_2_431(2)) {
+    } else if (jj_2_445(2)) {
       jj_consume_token(STRING_AGG);
                        s = span(); op = SqlLibraryOperators.STRING_AGG;
     } else {
@@ -5159,18 +5267,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       throw new ParseException();
     }
     jj_consume_token(LPAREN);
-    if (jj_2_432(2)) {
+    if (jj_2_446(2)) {
       qualifier = AllOrDistinct();
     } else {
           qualifier = null;
     }
     AddArg(args, ExprContext.ACCEPT_SUB_QUERY);
-    label_47:
+    label_48:
     while (true) {
-      if (jj_2_433(2)) {
+      if (jj_2_447(2)) {
         ;
       } else {
-        break label_47;
+        break label_48;
       }
       jj_consume_token(COMMA);
             // a comma-list can't appear where only a query is expected
@@ -5178,18 +5286,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             checkNonQueryExpression(ExprContext.ACCEPT_SUB_QUERY);
       AddArg(args, ExprContext.ACCEPT_SUB_QUERY);
     }
-    if (jj_2_434(2)) {
+    if (jj_2_448(2)) {
       nullTreatment = NullTreatment();
     } else {
           nullTreatment = null;
     }
-    if (jj_2_435(2)) {
+    if (jj_2_449(2)) {
       orderBy = OrderBy(true);
             args.add(orderBy);
     } else {
       ;
     }
-    if (jj_2_436(2)) {
+    if (jj_2_450(2)) {
       jj_consume_token(SEPARATOR);
                       s2 = span();
       separator = StringLiteral();
@@ -5207,38 +5315,96 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     throw new Error("Missing return statement in function");
   }
 
+/**
+ * Parses both the standard and the BigQuery PERCENTILE_CONT/PERCENTILE_DISC
+ * functions.
+ *
+ * <p>The standard is of the form "PERCENTILE_CONT(fraction)" while BigQuery is
+ * of the form "PERCENTILE_CONT(value, fraction [ {RESPECT | IGNORE} NULLS ] )".
+ * Handles the parsing of the operator and its operands but not the WITHIN GROUP
+ * (for the standard) or OVER (for BigQuery) clauses.
+ */
+  final public SqlCall PercentileFunctionCall() throws ParseException {
+   final Span s;
+   SqlOperator op;
+   final SqlNode e;
+   final List<SqlNode> args = new ArrayList<SqlNode>();
+   final Pair<SqlParserPos, SqlOperator> nullTreatment;
+    if (jj_2_451(2)) {
+      jj_consume_token(PERCENTILE_CONT);
+                           op = SqlStdOperatorTable.PERCENTILE_CONT;
+    } else if (jj_2_452(2)) {
+      jj_consume_token(PERCENTILE_DISC);
+                           op = SqlStdOperatorTable.PERCENTILE_DISC;
+    } else {
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+     s = span();
+    jj_consume_token(LPAREN);
+    AddArg(args, ExprContext.ACCEPT_SUB_QUERY);
+    if (jj_2_454(2)) {
+      jj_consume_token(RPAREN);
+           {if (true) return op.createCall(s.end(this), args);}
+    } else if (jj_2_455(2)) {
+      jj_consume_token(COMMA);
+      e = NumericLiteral();
+                              args.add(e);
+      if (jj_2_453(2)) {
+        nullTreatment = NullTreatment();
+      } else {
+             nullTreatment = null;
+      }
+      jj_consume_token(RPAREN);
+           op =
+               op == SqlStdOperatorTable.PERCENTILE_CONT
+                   ? SqlLibraryOperators.PERCENTILE_CONT2
+                   : SqlLibraryOperators.PERCENTILE_DISC2;
+           SqlCall call = op.createCall(s.end(this), args);
+           if (nullTreatment != null) {
+               // Wrap in RESPECT_NULLS or IGNORE_NULLS.
+               call = nullTreatment.right.createCall(nullTreatment.left, call);
+           }
+           {if (true) return call;}
+    } else {
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+    throw new Error("Missing return statement in function");
+  }
+
 /**
  * Parses an atomic row expression.
  */
   final public SqlNode AtomicRowExpression() throws ParseException {
     final SqlNode e;
-    if (jj_2_437(2)) {
+    if (jj_2_456(2)) {
       e = LiteralOrIntervalExpression();
-    } else if (jj_2_438(2)) {
+    } else if (jj_2_457(2)) {
       e = DynamicParam();
-    } else if (jj_2_439(2)) {
+    } else if (jj_2_458(2)) {
       e = BuiltinFunctionCall();
-    } else if (jj_2_440(2)) {
+    } else if (jj_2_459(2)) {
       e = JdbcFunctionCall();
-    } else if (jj_2_441(2)) {
+    } else if (jj_2_460(2)) {
       e = MultisetConstructor();
-    } else if (jj_2_442(2)) {
+    } else if (jj_2_461(2)) {
       e = ArrayConstructor();
-    } else if (jj_2_443(3)) {
+    } else if (jj_2_462(3)) {
       e = MapConstructor();
-    } else if (jj_2_444(2)) {
+    } else if (jj_2_463(2)) {
       e = PeriodConstructor();
-    } else if (jj_2_445(2147483647)) {
+    } else if (jj_2_464(2147483647)) {
       e = NamedFunctionCall();
-    } else if (jj_2_446(2)) {
+    } else if (jj_2_465(2)) {
       e = ContextVariable();
-    } else if (jj_2_447(2)) {
+    } else if (jj_2_466(2)) {
       e = CompoundIdentifier();
-    } else if (jj_2_448(2)) {
+    } else if (jj_2_467(2)) {
       e = NewSpecification();
-    } else if (jj_2_449(2)) {
+    } else if (jj_2_468(2)) {
       e = CaseExpression();
-    } else if (jj_2_450(2)) {
+    } else if (jj_2_469(2)) {
       e = SequenceExpression();
     } else {
       jj_consume_token(-1);
@@ -5259,12 +5425,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final List<SqlNode> thenList = new ArrayList<SqlNode>();
     jj_consume_token(CASE);
              s = span();
-    if (jj_2_451(2)) {
+    if (jj_2_470(2)) {
       caseIdentifier = Expression(ExprContext.ACCEPT_SUB_QUERY);
     } else {
           caseIdentifier = null;
     }
-    label_48:
+    label_49:
     while (true) {
       jj_consume_token(WHEN);
                  whenSpan.add(this);
@@ -5277,13 +5443,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                  thenSpan.add(this);
       e = Expression(ExprContext.ACCEPT_SUB_QUERY);
             thenList.add(e);
-      if (jj_2_452(2)) {
+      if (jj_2_471(2)) {
         ;
       } else {
-        break label_48;
+        break label_49;
       }
     }
-    if (jj_2_453(2)) {
+    if (jj_2_472(2)) {
       jj_consume_token(ELSE);
       elseClause = Expression(ExprContext.ACCEPT_SUB_QUERY);
     } else {
@@ -5301,10 +5467,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     final SqlOperator f;
     final SqlNode sequenceRef;
-    if (jj_2_454(2)) {
+    if (jj_2_473(2)) {
       jj_consume_token(NEXT);
                  f = SqlStdOperatorTable.NEXT_VALUE; s = span();
-    } else if (jj_2_455(3)) {
+    } else if (jj_2_474(3)) {
       jj_consume_token(CURRENT);
                     f = SqlStdOperatorTable.CURRENT_VALUE; s = span();
     } else {
@@ -5325,16 +5491,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlSetOption SqlSetOption(Span s, String scope) throws ParseException {
     SqlIdentifier name;
     final SqlNode val;
-    if (jj_2_461(2)) {
+    if (jj_2_480(2)) {
       jj_consume_token(SET);
             s.add(this);
       name = CompoundIdentifier();
       jj_consume_token(EQ);
-      if (jj_2_456(2)) {
+      if (jj_2_475(2)) {
         val = Literal();
-      } else if (jj_2_457(2)) {
+      } else if (jj_2_476(2)) {
         val = SimpleIdentifier();
-      } else if (jj_2_458(2)) {
+      } else if (jj_2_477(2)) {
         jj_consume_token(ON);
                 // OFF is handled by SimpleIdentifier, ON handled here.
                 val = new SqlIdentifier(token.image.toUpperCase(Locale.ROOT),
@@ -5344,12 +5510,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         throw new ParseException();
       }
             {if (true) return new SqlSetOption(s.end(val), scope, name, val);}
-    } else if (jj_2_462(2)) {
+    } else if (jj_2_481(2)) {
       jj_consume_token(RESET);
             s.add(this);
-      if (jj_2_459(2)) {
+      if (jj_2_478(2)) {
         name = CompoundIdentifier();
-      } else if (jj_2_460(2)) {
+      } else if (jj_2_479(2)) {
         jj_consume_token(ALL);
                 name = new SqlIdentifier(token.image.toUpperCase(Locale.ROOT),
                     getPos());
@@ -5382,9 +5548,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public String Scope() throws ParseException {
-    if (jj_2_463(2)) {
+    if (jj_2_482(2)) {
       jj_consume_token(SYSTEM);
-    } else if (jj_2_464(2)) {
+    } else if (jj_2_483(2)) {
       jj_consume_token(SESSION);
     } else {
       jj_consume_token(-1);
@@ -5403,18 +5569,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlCreate create;
     jj_consume_token(CREATE);
                s = span();
-    if (jj_2_465(2)) {
+    if (jj_2_484(2)) {
       jj_consume_token(OR);
       jj_consume_token(REPLACE);
             replace = true;
     } else {
       ;
     }
-    if (jj_2_466(2)) {
+    if (jj_2_485(2)) {
       create = SqlCreateTable(s, replace);
-    } else if (jj_2_467(2)) {
+    } else if (jj_2_486(2)) {
       create = SqlCreateIndex(s, replace);
-    } else if (jj_2_468(2)) {
+    } else if (jj_2_487(2)) {
       create = SqlCreateUser(s, replace);
     } else {
       jj_consume_token(-1);
@@ -5433,11 +5599,11 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlDrop drop;
     jj_consume_token(DROP);
              s = span();
-    if (jj_2_469(2)) {
+    if (jj_2_488(2)) {
       drop = SqlDropTable(s, replace);
-    } else if (jj_2_470(2)) {
+    } else if (jj_2_489(2)) {
       drop = SqlDropIndex(s, replace);
-    } else if (jj_2_471(2)) {
+    } else if (jj_2_490(2)) {
       drop = SqlDropUser(s, replace);
     } else {
       jj_consume_token(-1);
@@ -5459,9 +5625,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public SqlNode Literal() throws ParseException {
     SqlNode e;
-    if (jj_2_472(2)) {
+    if (jj_2_491(2)) {
       e = NonIntervalLiteral();
-    } else if (jj_2_473(2)) {
+    } else if (jj_2_492(2)) {
       e = IntervalLiteral();
     } else {
       jj_consume_token(-1);
@@ -5474,13 +5640,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 /** Parses a literal that is not an interval literal. */
   final public SqlNode NonIntervalLiteral() throws ParseException {
     final SqlNode e;
-    if (jj_2_474(2)) {
+    if (jj_2_493(2)) {
       e = NumericLiteral();
-    } else if (jj_2_475(2)) {
+    } else if (jj_2_494(2)) {
       e = StringLiteral();
-    } else if (jj_2_476(2)) {
+    } else if (jj_2_495(2)) {
       e = SpecialLiteral();
-    } else if (jj_2_477(2)) {
+    } else if (jj_2_496(2)) {
       e = DateTimeLiteral();
     } else {
       jj_consume_token(-1);
@@ -5498,9 +5664,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * LOOKAHEAD. */
   final public SqlNode LiteralOrIntervalExpression() throws ParseException {
     final SqlNode e;
-    if (jj_2_478(2)) {
+    if (jj_2_497(2)) {
       e = IntervalLiteralOrExpression();
-    } else if (jj_2_479(2)) {
+    } else if (jj_2_498(2)) {
       e = NonIntervalLiteral();
     } else {
       jj_consume_token(-1);
@@ -5512,13 +5678,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
 /** Parses a unsigned numeric literal */
   final public SqlNumericLiteral UnsignedNumericLiteral() throws ParseException {
-    if (jj_2_480(2)) {
+final String p;
+    if (jj_2_499(2)) {
       jj_consume_token(UNSIGNED_INTEGER_LITERAL);
         {if (true) return SqlLiteral.createExactNumeric(token.image, getPos());}
-    } else if (jj_2_481(2)) {
+    } else if (jj_2_500(2)) {
       jj_consume_token(DECIMAL_NUMERIC_LITERAL);
         {if (true) return SqlLiteral.createExactNumeric(token.image, getPos());}
-    } else if (jj_2_482(2)) {
+    } else if (jj_2_501(2)) {
+      jj_consume_token(DECIMAL);
+      p = SimpleStringLiteral();
+        {if (true) return SqlParserUtil.parseDecimalLiteral(SqlParserUtil.trim(p, " "), getPos());}
+    } else if (jj_2_502(2)) {
       jj_consume_token(APPROX_NUMERIC_LITERAL);
         {if (true) return SqlLiteral.createApproxNumeric(token.image, getPos());}
     } else {
@@ -5532,16 +5703,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlLiteral NumericLiteral() throws ParseException {
     final SqlNumericLiteral num;
     final Span s;
-    if (jj_2_483(2)) {
+    if (jj_2_503(2)) {
       jj_consume_token(PLUS);
       num = UnsignedNumericLiteral();
         {if (true) return num;}
-    } else if (jj_2_484(2)) {
+    } else if (jj_2_504(2)) {
       jj_consume_token(MINUS);
               s = span();
       num = UnsignedNumericLiteral();
         {if (true) return SqlLiteral.createNegative(num, s.end(this));}
-    } else if (jj_2_485(2)) {
+    } else if (jj_2_505(2)) {
       num = UnsignedNumericLiteral();
         {if (true) return num;}
     } else {
@@ -5553,16 +5724,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
 /** Parse a special literal keyword */
   final public SqlLiteral SpecialLiteral() throws ParseException {
-    if (jj_2_486(2)) {
+    if (jj_2_506(2)) {
       jj_consume_token(TRUE);
              {if (true) return SqlLiteral.createBoolean(true, getPos());}
-    } else if (jj_2_487(2)) {
+    } else if (jj_2_507(2)) {
       jj_consume_token(FALSE);
               {if (true) return SqlLiteral.createBoolean(false, getPos());}
-    } else if (jj_2_488(2)) {
+    } else if (jj_2_508(2)) {
       jj_consume_token(UNKNOWN);
                 {if (true) return SqlLiteral.createUnknown(getPos());}
-    } else if (jj_2_489(2)) {
+    } else if (jj_2_509(2)) {
       jj_consume_token(NULL);
              {if (true) return SqlLiteral.createNull(getPos());}
     } else {
@@ -5589,7 +5760,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     char unicodeEscapeChar = 0;
     String charSet = null;
     SqlCharStringLiteral literal;
-    if (jj_2_494(2)) {
+    if (jj_2_514(2)) {
       jj_consume_token(BINARY_STRING_LITERAL);
         frags = new ArrayList<SqlLiteral>();
         try {
@@ -5599,7 +5770,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             {if (true) throw SqlUtil.newContextException(getPos(),
                 RESOURCE.illegalBinaryString(token.image));}
         }
-      label_49:
+      label_50:
       while (true) {
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
         case QUOTED_STRING:
@@ -5607,7 +5778,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
           break;
         default:
           jj_la1[5] = jj_gen;
-          break label_49;
+          break label_50;
         }
         jj_consume_token(QUOTED_STRING);
             try {
@@ -5625,13 +5796,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             SqlParserPos pos2 = SqlParserPos.sum(frags);
             {if (true) return SqlStdOperatorTable.LITERAL_CHAIN.createCall(pos2, frags);}
         }
-    } else if (jj_2_495(2)) {
-      if (jj_2_490(2)) {
+    } else if (jj_2_515(2)) {
+      if (jj_2_510(2)) {
         jj_consume_token(PREFIXED_STRING_LITERAL);
           charSet = SqlParserUtil.getCharacterSet(token.image);
-      } else if (jj_2_491(2)) {
+      } else if (jj_2_511(2)) {
         jj_consume_token(QUOTED_STRING);
-      } else if (jj_2_492(2)) {
+      } else if (jj_2_512(2)) {
         jj_consume_token(UNICODE_STRING_LITERAL);
             // TODO jvs 2-Feb-2009:  support the explicit specification of
             // a character set for Unicode string literals, per SQL:2003
@@ -5650,7 +5821,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             {if (true) throw SqlUtil.newContextException(getPos(),
                 RESOURCE.unknownCharacterSet(charSet));}
         }
-      label_50:
+      label_51:
       while (true) {
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
         case QUOTED_STRING:
@@ -5658,7 +5829,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
           break;
         default:
           jj_la1[6] = jj_gen;
-          break label_50;
+          break label_51;
         }
         jj_consume_token(QUOTED_STRING);
             p = SqlParserUtil.parseString(token.image);
@@ -5670,7 +5841,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                     RESOURCE.unknownCharacterSet(charSet));}
             }
       }
-      if (jj_2_493(2)) {
+      if (jj_2_513(2)) {
         jj_consume_token(UESCAPE);
         jj_consume_token(QUOTED_STRING);
             if (unicodeEscapeChar == 0) {
@@ -5696,7 +5867,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             SqlParserPos pos2 = SqlParserPos.sum(rands);
             {if (true) return SqlStdOperatorTable.LITERAL_CHAIN.createCall(pos2, rands);}
         }
-    } else if (jj_2_496(2)) {
+    } else if (jj_2_516(2)) {
       jj_consume_token(C_STYLE_ESCAPED_STRING_LITERAL);
         try {
             p = SqlParserUtil.parseCString(getToken(0).image);
@@ -5705,7 +5876,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                 RESOURCE.unicodeEscapeMalformed(e.i));}
        }
        {if (true) return SqlLiteral.createCharString(p, "UTF16", getPos());}
-    } else if (jj_2_497(2)) {
+    } else if (jj_2_517(2)) {
       jj_consume_token(BIG_QUERY_DOUBLE_QUOTED_STRING);
         p = SqlParserUtil.stripQuotes(getToken(0).image, DQ, DQ, "\\\"",
             Casing.UNCHANGED);
@@ -5715,7 +5886,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             {if (true) throw SqlUtil.newContextException(getPos(),
                 RESOURCE.unknownCharacterSet(charSet));}
         }
-    } else if (jj_2_498(2)) {
+    } else if (jj_2_518(2)) {
       jj_consume_token(BIG_QUERY_QUOTED_STRING);
         p = SqlParserUtil.stripQuotes(getToken(0).image, "'", "'", "\\'",
             Casing.UNCHANGED);
@@ -5737,13 +5908,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * on BigQuery also matches a double-quoted string, such as "foo".
  * Returns the value of the string with quotes removed. */
   final public String SimpleStringLiteral() throws ParseException {
-    if (jj_2_499(2)) {
+    if (jj_2_519(2)) {
       jj_consume_token(QUOTED_STRING);
         {if (true) return SqlParserUtil.parseString(token.image);}
-    } else if (jj_2_500(2)) {
+    } else if (jj_2_520(2)) {
       jj_consume_token(BIG_QUERY_QUOTED_STRING);
         {if (true) return SqlParserUtil.stripQuotes(token.image, "'", "'", "\\'", Casing.UNCHANGED);}
-    } else if (jj_2_501(2)) {
+    } else if (jj_2_521(2)) {
       jj_consume_token(BIG_QUERY_DOUBLE_QUOTED_STRING);
         {if (true) return SqlParserUtil.stripQuotes(token.image, DQ, DQ, "\\\"", Casing.UNCHANGED);}
     } else {
@@ -5759,54 +5930,74 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlLiteral DateTimeLiteral() throws ParseException {
     final String p;
     final Span s;
-    if (jj_2_502(2)) {
+    boolean local = false;
+    if (jj_2_524(2)) {
       jj_consume_token(LBRACE_D);
       jj_consume_token(QUOTED_STRING);
         p = SqlParserUtil.parseString(token.image);
       jj_consume_token(RBRACE);
         {if (true) return SqlParserUtil.parseDateLiteral(p, getPos());}
-    } else if (jj_2_503(2)) {
+    } else if (jj_2_525(2)) {
       jj_consume_token(LBRACE_T);
       jj_consume_token(QUOTED_STRING);
         p = SqlParserUtil.parseString(token.image);
       jj_consume_token(RBRACE);
         {if (true) return SqlParserUtil.parseTimeLiteral(p, getPos());}
-    } else if (jj_2_504(2)) {
+    } else if (jj_2_526(2)) {
       jj_consume_token(LBRACE_TS);
                   s = span();
       jj_consume_token(QUOTED_STRING);
         p = SqlParserUtil.parseString(token.image);
       jj_consume_token(RBRACE);
         {if (true) return SqlParserUtil.parseTimestampLiteral(p, s.end(this));}
-    } else if (jj_2_505(2)) {
+    } else if (jj_2_527(2)) {
       jj_consume_token(DATE);
              s = span();
       p = SimpleStringLiteral();
       {if (true) return SqlLiteral.createUnknown("DATE", p, s.end(this));}
-    } else if (jj_2_506(2)) {
+    } else if (jj_2_528(2)) {
       jj_consume_token(DATETIME);
                  s = span();
       p = SimpleStringLiteral();
         {if (true) return SqlLiteral.createUnknown("DATETIME", p, s.end(this));}
-    } else if (jj_2_507(2)) {
+    } else if (jj_2_529(2)) {
       jj_consume_token(TIME);
              s = span();
       p = SimpleStringLiteral();
       {if (true) return SqlLiteral.createUnknown("TIME", p, s.end(this));}
-    } else if (jj_2_508(2)) {
+    } else if (jj_2_530(2)) {
       jj_consume_token(TIMESTAMP);
                   s = span();
       p = SimpleStringLiteral();
         {if (true) return SqlLiteral.createUnknown("TIMESTAMP", p, s.end(this));}
-    } else if (jj_2_509(2)) {
+    } else if (jj_2_531(2)) {
+      jj_consume_token(TIME);
+             s = span();
+      jj_consume_token(WITH);
+      if (jj_2_522(2)) {
+        jj_consume_token(LOCAL);
+                                              local = true;
+      } else {
+        ;
+      }
+      jj_consume_token(TIME);
+      jj_consume_token(ZONE);
+      p = SimpleStringLiteral();
+        {if (true) return SqlLiteral.createUnknown("TIME WITH " + (local ? "LOCAL " : "") + "TIME ZONE", p, s.end(this));}
+    } else if (jj_2_532(2)) {
       jj_consume_token(TIMESTAMP);
                   s = span();
       jj_consume_token(WITH);
-      jj_consume_token(LOCAL);
+      if (jj_2_523(2)) {
+        jj_consume_token(LOCAL);
+                                                   local = true;
+      } else {
+        ;
+      }
       jj_consume_token(TIME);
       jj_consume_token(ZONE);
       p = SimpleStringLiteral();
-        {if (true) return SqlLiteral.createUnknown("TIMESTAMP WITH LOCAL TIME ZONE", p, s.end(this));}
+        {if (true) return SqlLiteral.createUnknown("TIMESTAMP WITH " + (local ? "LOCAL " : "") + "TIME ZONE", p, s.end(this));}
     } else {
       jj_consume_token(-1);
       throw new ParseException();
@@ -5822,13 +6013,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     final SqlLiteral quantifier;
     final List<? extends SqlNode> args;
-    if (jj_2_510(2)) {
+    if (jj_2_533(2)) {
       jj_consume_token(DATE);
-    } else if (jj_2_511(2)) {
+    } else if (jj_2_534(2)) {
       jj_consume_token(TIME);
-    } else if (jj_2_512(2)) {
+    } else if (jj_2_535(2)) {
       jj_consume_token(DATETIME);
-    } else if (jj_2_513(2)) {
+    } else if (jj_2_536(2)) {
       jj_consume_token(TIMESTAMP);
     } else {
       jj_consume_token(-1);
@@ -5850,22 +6041,22 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     jj_consume_token(MULTISET);
                  s = span();
-    if (jj_2_515(2)) {
+    if (jj_2_538(2)) {
       jj_consume_token(LPAREN);
       // by sub query "MULTISET(SELECT * FROM T)"
               e = LeafQueryOrExpr(ExprContext.ACCEPT_QUERY);
       jj_consume_token(RPAREN);
             {if (true) return SqlStdOperatorTable.MULTISET_QUERY.createCall(
                 s.end(this), e);}
-    } else if (jj_2_516(2)) {
+    } else if (jj_2_539(2)) {
       jj_consume_token(LBRACKET);
       AddExpression(args, ExprContext.ACCEPT_NON_QUERY);
-      label_51:
+      label_52:
       while (true) {
-        if (jj_2_514(2)) {
+        if (jj_2_537(2)) {
           ;
         } else {
-          break label_51;
+          break label_52;
         }
         jj_consume_token(COMMA);
         AddExpression(args, ExprContext.ACCEPT_NON_QUERY);
@@ -5882,37 +6073,44 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
 /** Parses an ARRAY constructor */
   final public SqlNode ArrayConstructor() throws ParseException {
-    SqlNodeList args;
+    final SqlNodeList args;
     SqlNode e;
     final Span s;
     final String p;
     jj_consume_token(ARRAY);
               s = span();
-    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case LPAREN:
-      jj_consume_token(LPAREN);
-      // by sub query "MULTISET(SELECT * FROM T)"
-              e = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY);
-      jj_consume_token(RPAREN);
-            {if (true) return SqlStdOperatorTable.ARRAY_QUERY.createCall(
-                s.end(this), e);}
-      break;
-    default:
-      jj_la1[7] = jj_gen;
-      if (jj_2_518(2)) {
-        jj_consume_token(LBRACKET);
-        if (jj_2_517(2)) {
-          args = ExpressionCommaList(s, ExprContext.ACCEPT_NON_QUERY);
-        } else {
-              args = SqlNodeList.EMPTY;
-        }
-        jj_consume_token(RBRACKET);
-            {if (true) return SqlStdOperatorTable.ARRAY_VALUE_CONSTRUCTOR.createCall(
-                s.end(this), args.getList());}
+    if (jj_2_543(2)) {
+      if (jj_2_540(2)) {
+        jj_consume_token(LPAREN);
+        jj_consume_token(RPAREN);
+                                args = SqlNodeList.EMPTY;
+      } else if (jj_2_541(2)) {
+        args = ParenthesizedQueryOrCommaList(ExprContext.ACCEPT_ALL);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
+            if (args.size() == 1 && args.get(0).isA(SqlKind.QUERY)) {
+                // Array query constructor, 'ARRAY (SELECT * FROM t)'
+                {if (true) return SqlStdOperatorTable.ARRAY_QUERY.createCall(s.end(this), args.get(0));}
+            } else {
+                // Spark ARRAY function, 'ARRAY(1, 2)',
+                // equivalent to standard 'ARRAY [1, 2]'
+                {if (true) return SqlLibraryOperators.ARRAY.createCall(s.end(this), args.getList());}
+            }
+    } else if (jj_2_544(2)) {
+      jj_consume_token(LBRACKET);
+      if (jj_2_542(2)) {
+        args = ExpressionCommaList(s, ExprContext.ACCEPT_NON_QUERY);
+      } else {
+              args = SqlNodeList.EMPTY;
+      }
+      jj_consume_token(RBRACKET);
+            {if (true) return SqlStdOperatorTable.ARRAY_VALUE_CONSTRUCTOR.createCall(
+                s.end(this), args.getList());}
+    } else {
+      jj_consume_token(-1);
+      throw new ParseException();
     }
     throw new Error("Missing return statement in function");
   }
@@ -5923,29 +6121,29 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     jj_consume_token(LBRACE);
                s = span();
-    if (jj_2_521(2)) {
+    if (jj_2_547(2)) {
       e = Literal();
                         list = startList(e);
-      label_52:
+      label_53:
       while (true) {
-        if (jj_2_519(2)) {
+        if (jj_2_545(2)) {
           ;
         } else {
-          break label_52;
+          break label_53;
         }
         jj_consume_token(COMMA);
         e = Literal();
                                   list.add(e);
       }
-    } else if (jj_2_522(2)) {
+    } else if (jj_2_548(2)) {
       e = ArrayLiteral();
                              list = startList(e);
-      label_53:
+      label_54:
       while (true) {
-        if (jj_2_520(2)) {
+        if (jj_2_546(2)) {
           ;
         } else {
-          break label_53;
+          break label_54;
         }
         jj_consume_token(COMMA);
         e = ArrayLiteral();
@@ -5962,35 +6160,40 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 /** Parses a MAP constructor */
   final public SqlNode MapConstructor() throws ParseException {
     SqlNodeList args;
-    SqlNode e;
     final Span s;
     jj_consume_token(MAP);
             s = span();
-    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case LPAREN:
-      jj_consume_token(LPAREN);
-      // by sub query "MAP (SELECT empno, deptno FROM emp)"
-              e = LeafQueryOrExpr(ExprContext.ACCEPT_QUERY);
-      jj_consume_token(RPAREN);
-            {if (true) return SqlStdOperatorTable.MAP_QUERY.createCall(
-                s.end(this), e);}
-      break;
-    default:
-      jj_la1[8] = jj_gen;
-      if (jj_2_524(2)) {
-        jj_consume_token(LBRACKET);
-        if (jj_2_523(2)) {
-          args = ExpressionCommaList(s, ExprContext.ACCEPT_NON_QUERY);
-        } else {
-              args = SqlNodeList.EMPTY;
-        }
-        jj_consume_token(RBRACKET);
-            {if (true) return SqlStdOperatorTable.MAP_VALUE_CONSTRUCTOR.createCall(
-                s.end(this), args.getList());}
+    if (jj_2_552(2)) {
+      if (jj_2_549(2)) {
+        jj_consume_token(LPAREN);
+        jj_consume_token(RPAREN);
+                                args = SqlNodeList.EMPTY;
+      } else if (jj_2_550(2)) {
+        args = ParenthesizedQueryOrCommaList(ExprContext.ACCEPT_ALL);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
+            if (args.size() == 1 && args.get(0).isA(SqlKind.QUERY)) {
+                // MAP query constructor e.g. "MAP (SELECT empno, deptno FROM emps)"
+                {if (true) return SqlStdOperatorTable.MAP_QUERY.createCall(s.end(this), args.get(0));}
+            } else {
+                // MAP function e.g. "MAP(1, 2)" equivalent to standard "MAP[1, 2]"
+                {if (true) return SqlLibraryOperators.MAP.createCall(s.end(this), args.getList());}
+            }
+    } else if (jj_2_553(2)) {
+      jj_consume_token(LBRACKET);
+      if (jj_2_551(2)) {
+        args = ExpressionCommaList(s, ExprContext.ACCEPT_NON_QUERY);
+      } else {
+              args = SqlNodeList.EMPTY;
+      }
+      jj_consume_token(RBRACKET);
+            {if (true) return SqlStdOperatorTable.MAP_VALUE_CONSTRUCTOR.createCall(
+                s.end(this), args.getList());}
+    } else {
+      jj_consume_token(-1);
+      throw new ParseException();
     }
     throw new Error("Missing return statement in function");
   }
@@ -6020,11 +6223,11 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     jj_consume_token(INTERVAL);
                  s = span();
-    if (jj_2_527(2)) {
-      if (jj_2_525(2)) {
+    if (jj_2_556(2)) {
+      if (jj_2_554(2)) {
         jj_consume_token(MINUS);
                   sign = -1;
-      } else if (jj_2_526(2)) {
+      } else if (jj_2_555(2)) {
         jj_consume_token(PLUS);
                  sign = 1;
       } else {
@@ -6052,11 +6255,11 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlNode e;
     jj_consume_token(INTERVAL);
                  s = span();
-    if (jj_2_530(2)) {
-      if (jj_2_528(2)) {
+    if (jj_2_559(2)) {
+      if (jj_2_557(2)) {
         jj_consume_token(MINUS);
                   sign = -1;
-      } else if (jj_2_529(2)) {
+      } else if (jj_2_558(2)) {
         jj_consume_token(PLUS);
                  sign = 1;
       } else {
@@ -6066,20 +6269,20 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     } else {
       ;
     }
-    if (jj_2_534(2)) {
+    if (jj_2_563(2)) {
       // literal (with quoted string)
               p = SimpleStringLiteral();
       intervalQualifier = IntervalQualifier();
             {if (true) return SqlParserUtil.parseIntervalLiteral(s.end(intervalQualifier),
                 sign, p, intervalQualifier);}
-    } else if (jj_2_535(2)) {
-      if (jj_2_531(2)) {
+    } else if (jj_2_564(2)) {
+      if (jj_2_560(2)) {
         jj_consume_token(LPAREN);
         e = Expression(ExprContext.ACCEPT_SUB_QUERY);
         jj_consume_token(RPAREN);
-      } else if (jj_2_532(2)) {
+      } else if (jj_2_561(2)) {
         e = UnsignedNumericLiteral();
-      } else if (jj_2_533(2)) {
+      } else if (jj_2_562(2)) {
         e = CompoundIdentifier();
       } else {
         jj_consume_token(-1);
@@ -6099,10 +6302,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public TimeUnit Year() throws ParseException {
-    if (jj_2_536(2)) {
+    if (jj_2_565(2)) {
       jj_consume_token(YEAR);
              {if (true) return TimeUnit.YEAR;}
-    } else if (jj_2_537(2)) {
+    } else if (jj_2_566(2)) {
       jj_consume_token(YEARS);
               {if (true) return warn(TimeUnit.YEAR);}
     } else {
@@ -6113,10 +6316,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public TimeUnit Quarter() throws ParseException {
-    if (jj_2_538(2)) {
+    if (jj_2_567(2)) {
       jj_consume_token(QUARTER);
                 {if (true) return TimeUnit.QUARTER;}
-    } else if (jj_2_539(2)) {
+    } else if (jj_2_568(2)) {
       jj_consume_token(QUARTERS);
                  {if (true) return warn(TimeUnit.QUARTER);}
     } else {
@@ -6127,10 +6330,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public TimeUnit Month() throws ParseException {
-    if (jj_2_540(2)) {
+    if (jj_2_569(2)) {
       jj_consume_token(MONTH);
               {if (true) return TimeUnit.MONTH;}
-    } else if (jj_2_541(2)) {
+    } else if (jj_2_570(2)) {
       jj_consume_token(MONTHS);
                {if (true) return warn(TimeUnit.MONTH);}
     } else {
@@ -6141,10 +6344,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public TimeUnit Week() throws ParseException {
-    if (jj_2_542(2)) {
+    if (jj_2_571(2)) {
       jj_consume_token(WEEK);
              {if (true) return TimeUnit.WEEK;}
-    } else if (jj_2_543(2)) {
+    } else if (jj_2_572(2)) {
       jj_consume_token(WEEKS);
               {if (true) return warn(TimeUnit.WEEK);}
     } else {
@@ -6155,10 +6358,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public TimeUnit Day() throws ParseException {
-    if (jj_2_544(2)) {
+    if (jj_2_573(2)) {
       jj_consume_token(DAY);
             {if (true) return TimeUnit.DAY;}
-    } else if (jj_2_545(2)) {
+    } else if (jj_2_574(2)) {
       jj_consume_token(DAYS);
              {if (true) return warn(TimeUnit.DAY);}
     } else {
@@ -6169,10 +6372,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public TimeUnit Hour() throws ParseException {
-    if (jj_2_546(2)) {
+    if (jj_2_575(2)) {
       jj_consume_token(HOUR);
              {if (true) return TimeUnit.HOUR;}
-    } else if (jj_2_547(2)) {
+    } else if (jj_2_576(2)) {
       jj_consume_token(HOURS);
               {if (true) return warn(TimeUnit.HOUR);}
     } else {
@@ -6183,10 +6386,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public TimeUnit Minute() throws ParseException {
-    if (jj_2_548(2)) {
+    if (jj_2_577(2)) {
       jj_consume_token(MINUTE);
                {if (true) return TimeUnit.MINUTE;}
-    } else if (jj_2_549(2)) {
+    } else if (jj_2_578(2)) {
       jj_consume_token(MINUTES);
                 {if (true) return warn(TimeUnit.MINUTE);}
     } else {
@@ -6197,10 +6400,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public TimeUnit Second() throws ParseException {
-    if (jj_2_550(2)) {
+    if (jj_2_579(2)) {
       jj_consume_token(SECOND);
                {if (true) return TimeUnit.SECOND;}
-    } else if (jj_2_551(2)) {
+    } else if (jj_2_580(2)) {
       jj_consume_token(SECONDS);
                 {if (true) return warn(TimeUnit.SECOND);}
     } else {
@@ -6216,42 +6419,42 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final TimeUnit end;
     final int startPrec;
     int secondFracPrec = RelDataType.PRECISION_NOT_SPECIFIED;
-    if (jj_2_565(2)) {
+    if (jj_2_594(2)) {
       start = Year();
                          s = span();
       startPrec = PrecisionOpt();
-      if (jj_2_552(2)) {
+      if (jj_2_581(2)) {
         jj_consume_token(TO);
         end = Month();
       } else {
               end = null;
       }
-    } else if (jj_2_566(2)) {
+    } else if (jj_2_595(2)) {
       start = Quarter();
                             s = span();
       startPrec = PrecisionOpt();
           end = null;
-    } else if (jj_2_567(2)) {
+    } else if (jj_2_596(2)) {
       start = Month();
                           s = span();
       startPrec = PrecisionOpt();
           end = null;
-    } else if (jj_2_568(2)) {
+    } else if (jj_2_597(2)) {
       start = Week();
                          s = span();
       startPrec = PrecisionOpt();
           end = null;
-    } else if (jj_2_569(2)) {
+    } else if (jj_2_598(2)) {
       start = Day();
                         s = span();
       startPrec = PrecisionOpt();
-      if (jj_2_556(2)) {
+      if (jj_2_585(2)) {
         jj_consume_token(TO);
-        if (jj_2_553(2)) {
+        if (jj_2_582(2)) {
           end = Hour();
-        } else if (jj_2_554(2)) {
+        } else if (jj_2_583(2)) {
           end = Minute();
-        } else if (jj_2_555(2)) {
+        } else if (jj_2_584(2)) {
           end = Second();
           secondFracPrec = PrecisionOpt();
         } else {
@@ -6261,17 +6464,17 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       } else {
               end = null;
       }
-    } else if (jj_2_570(2)) {
+    } else if (jj_2_599(2)) {
       start = Hour();
                          s = span();
       startPrec = PrecisionOpt();
-      if (jj_2_560(2)) {
+      if (jj_2_589(2)) {
         jj_consume_token(TO);
-        if (jj_2_558(2)) {
+        if (jj_2_587(2)) {
           end = Minute();
-        } else if (jj_2_559(2)) {
+        } else if (jj_2_588(2)) {
           end = Second();
-          if (jj_2_557(2)) {
+          if (jj_2_586(2)) {
             jj_consume_token(LPAREN);
             secondFracPrec = UnsignedIntLiteral();
             jj_consume_token(RPAREN);
@@ -6285,14 +6488,14 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       } else {
               end = null;
       }
-    } else if (jj_2_571(2)) {
+    } else if (jj_2_600(2)) {
       start = Minute();
                            s = span();
       startPrec = PrecisionOpt();
-      if (jj_2_562(2)) {
+      if (jj_2_591(2)) {
         jj_consume_token(TO);
         end = Second();
-        if (jj_2_561(2)) {
+        if (jj_2_590(2)) {
           jj_consume_token(LPAREN);
           secondFracPrec = UnsignedIntLiteral();
           jj_consume_token(RPAREN);
@@ -6302,13 +6505,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       } else {
               end = null;
       }
-    } else if (jj_2_572(2)) {
+    } else if (jj_2_601(2)) {
       start = Second();
                            s = span();
-      if (jj_2_564(2)) {
+      if (jj_2_593(2)) {
         jj_consume_token(LPAREN);
         startPrec = UnsignedIntLiteral();
-        if (jj_2_563(2)) {
+        if (jj_2_592(2)) {
           jj_consume_token(COMMA);
           secondFracPrec = UnsignedIntLiteral();
         } else {
@@ -6334,20 +6537,20 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final TimeUnit start;
     int startPrec = RelDataType.PRECISION_NOT_SPECIFIED;
     int secondFracPrec = RelDataType.PRECISION_NOT_SPECIFIED;
-    if (jj_2_582(2)) {
-      if (jj_2_573(2)) {
+    if (jj_2_611(2)) {
+      if (jj_2_602(2)) {
         start = Year();
-      } else if (jj_2_574(2)) {
+      } else if (jj_2_603(2)) {
         start = Quarter();
-      } else if (jj_2_575(2)) {
+      } else if (jj_2_604(2)) {
         start = Month();
-      } else if (jj_2_576(2)) {
+      } else if (jj_2_605(2)) {
         start = Week();
-      } else if (jj_2_577(2)) {
+      } else if (jj_2_606(2)) {
         start = Day();
-      } else if (jj_2_578(2)) {
+      } else if (jj_2_607(2)) {
         start = Hour();
-      } else if (jj_2_579(2)) {
+      } else if (jj_2_608(2)) {
         start = Minute();
       } else {
         jj_consume_token(-1);
@@ -6355,13 +6558,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       }
           s = span();
       startPrec = PrecisionOpt();
-    } else if (jj_2_583(2)) {
+    } else if (jj_2_612(2)) {
       start = Second();
                            s = span();
-      if (jj_2_581(2)) {
+      if (jj_2_610(2)) {
         jj_consume_token(LPAREN);
         startPrec = UnsignedIntLiteral();
-        if (jj_2_580(2)) {
+        if (jj_2_609(2)) {
           jj_consume_token(COMMA);
           secondFracPrec = UnsignedIntLiteral();
         } else {
@@ -6398,10 +6601,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlIntervalQualifier TimeUnitOrName() throws ParseException {
     final SqlIdentifier unitName;
     final SqlIntervalQualifier intervalQualifier;
-    if (jj_2_584(2)) {
+    if (jj_2_613(2)) {
       intervalQualifier = TimeUnit();
         {if (true) return intervalQualifier;}
-    } else if (jj_2_585(2)) {
+    } else if (jj_2_614(2)) {
       unitName = SimpleIdentifier();
         {if (true) return new SqlIntervalQualifier(unitName.getSimple(),
             unitName.getParserPosition());}
@@ -6425,43 +6628,49 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlIntervalQualifier TimeUnit() throws ParseException {
     final Span span;
     final String w;
-    if (jj_2_587(2)) {
+    if (jj_2_616(2)) {
       jj_consume_token(NANOSECOND);
                    {if (true) return new SqlIntervalQualifier(TimeUnit.NANOSECOND, null, getPos());}
-    } else if (jj_2_588(2)) {
+    } else if (jj_2_617(2)) {
       jj_consume_token(MICROSECOND);
                     {if (true) return new SqlIntervalQualifier(TimeUnit.MICROSECOND, null, getPos());}
-    } else if (jj_2_589(2)) {
+    } else if (jj_2_618(2)) {
       jj_consume_token(MILLISECOND);
                     {if (true) return new SqlIntervalQualifier(TimeUnit.MILLISECOND, null, getPos());}
-    } else if (jj_2_590(2)) {
+    } else if (jj_2_619(2)) {
       jj_consume_token(SECOND);
                {if (true) return new SqlIntervalQualifier(TimeUnit.SECOND, null, getPos());}
-    } else if (jj_2_591(2)) {
+    } else if (jj_2_620(2)) {
       jj_consume_token(MINUTE);
                {if (true) return new SqlIntervalQualifier(TimeUnit.MINUTE, null, getPos());}
-    } else if (jj_2_592(2)) {
+    } else if (jj_2_621(2)) {
       jj_consume_token(HOUR);
              {if (true) return new SqlIntervalQualifier(TimeUnit.HOUR, null, getPos());}
-    } else if (jj_2_593(2)) {
+    } else if (jj_2_622(2)) {
       jj_consume_token(DAY);
             {if (true) return new SqlIntervalQualifier(TimeUnit.DAY, null, getPos());}
-    } else if (jj_2_594(2)) {
+    } else if (jj_2_623(2)) {
+      jj_consume_token(DAYOFWEEK);
+                  {if (true) return new SqlIntervalQualifier(TimeUnit.DOW, null, getPos());}
+    } else if (jj_2_624(2)) {
+      jj_consume_token(DAYOFYEAR);
+                  {if (true) return new SqlIntervalQualifier(TimeUnit.DOY, null, getPos());}
+    } else if (jj_2_625(2)) {
       jj_consume_token(DOW);
             {if (true) return new SqlIntervalQualifier(TimeUnit.DOW, null, getPos());}
-    } else if (jj_2_595(2)) {
+    } else if (jj_2_626(2)) {
       jj_consume_token(DOY);
             {if (true) return new SqlIntervalQualifier(TimeUnit.DOY, null, getPos());}
-    } else if (jj_2_596(2)) {
+    } else if (jj_2_627(2)) {
       jj_consume_token(ISODOW);
                {if (true) return new SqlIntervalQualifier(TimeUnit.ISODOW, null, getPos());}
-    } else if (jj_2_597(2)) {
+    } else if (jj_2_628(2)) {
       jj_consume_token(ISOYEAR);
                 {if (true) return new SqlIntervalQualifier(TimeUnit.ISOYEAR, null, getPos());}
-    } else if (jj_2_598(2)) {
+    } else if (jj_2_629(2)) {
       jj_consume_token(WEEK);
              span = span();
-      if (jj_2_586(2)) {
+      if (jj_2_615(2)) {
         jj_consume_token(LPAREN);
         w = weekdayName();
         jj_consume_token(RPAREN);
@@ -6469,25 +6678,25 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       } else {
           {if (true) return new SqlIntervalQualifier(TimeUnit.WEEK, null, getPos());}
       }
-    } else if (jj_2_599(2)) {
+    } else if (jj_2_630(2)) {
       jj_consume_token(MONTH);
               {if (true) return new SqlIntervalQualifier(TimeUnit.MONTH, null, getPos());}
-    } else if (jj_2_600(2)) {
+    } else if (jj_2_631(2)) {
       jj_consume_token(QUARTER);
                 {if (true) return new SqlIntervalQualifier(TimeUnit.QUARTER, null, getPos());}
-    } else if (jj_2_601(2)) {
+    } else if (jj_2_632(2)) {
       jj_consume_token(YEAR);
              {if (true) return new SqlIntervalQualifier(TimeUnit.YEAR, null, getPos());}
-    } else if (jj_2_602(2)) {
+    } else if (jj_2_633(2)) {
       jj_consume_token(EPOCH);
               {if (true) return new SqlIntervalQualifier(TimeUnit.EPOCH, null, getPos());}
-    } else if (jj_2_603(2)) {
+    } else if (jj_2_634(2)) {
       jj_consume_token(DECADE);
                {if (true) return new SqlIntervalQualifier(TimeUnit.DECADE, null, getPos());}
-    } else if (jj_2_604(2)) {
+    } else if (jj_2_635(2)) {
       jj_consume_token(CENTURY);
                 {if (true) return new SqlIntervalQualifier(TimeUnit.CENTURY, null, getPos());}
-    } else if (jj_2_605(2)) {
+    } else if (jj_2_636(2)) {
       jj_consume_token(MILLENNIUM);
                    {if (true) return new SqlIntervalQualifier(TimeUnit.MILLENNIUM, null, getPos());}
     } else {
@@ -6498,25 +6707,25 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public String weekdayName() throws ParseException {
-    if (jj_2_606(2)) {
+    if (jj_2_637(2)) {
       jj_consume_token(SUNDAY);
                {if (true) return "WEEK_SUNDAY";}
-    } else if (jj_2_607(2)) {
+    } else if (jj_2_638(2)) {
       jj_consume_token(MONDAY);
                {if (true) return "WEEK_MONDAY";}
-    } else if (jj_2_608(2)) {
+    } else if (jj_2_639(2)) {
       jj_consume_token(TUESDAY);
                 {if (true) return "WEEK_TUESDAY";}
-    } else if (jj_2_609(2)) {
+    } else if (jj_2_640(2)) {
       jj_consume_token(WEDNESDAY);
                   {if (true) return "WEEK_WEDNESDAY";}
-    } else if (jj_2_610(2)) {
+    } else if (jj_2_641(2)) {
       jj_consume_token(THURSDAY);
                  {if (true) return "WEEK_THURSDAY";}
-    } else if (jj_2_611(2)) {
+    } else if (jj_2_642(2)) {
       jj_consume_token(FRIDAY);
                {if (true) return "WEEK_FRIDAY";}
-    } else if (jj_2_612(2)) {
+    } else if (jj_2_643(2)) {
       jj_consume_token(SATURDAY);
                  {if (true) return "WEEK_SATURDAY";}
     } else {
@@ -6547,41 +6756,41 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     char unicodeEscapeChar = BACKSLASH;
     final SqlParserPos pos;
     final Span span;
-    if (jj_2_614(2)) {
+    if (jj_2_645(2)) {
       jj_consume_token(IDENTIFIER);
             id = unquotedIdentifier();
             pos = getPos();
-    } else if (jj_2_615(2)) {
+    } else if (jj_2_646(2)) {
       jj_consume_token(HYPHENATED_IDENTIFIER);
             id = unquotedIdentifier();
             pos = getPos();
-    } else if (jj_2_616(2)) {
+    } else if (jj_2_647(2)) {
       jj_consume_token(QUOTED_IDENTIFIER);
             id = SqlParserUtil.stripQuotes(getToken(0).image, DQ, DQ, DQDQ,
                 quotedCasing);
             pos = getPos().withQuoting(true);
-    } else if (jj_2_617(2)) {
+    } else if (jj_2_648(2)) {
       jj_consume_token(BACK_QUOTED_IDENTIFIER);
             id = SqlParserUtil.stripQuotes(getToken(0).image, "`", "`", "``",
                 quotedCasing);
             pos = getPos().withQuoting(true);
-    } else if (jj_2_618(2)) {
+    } else if (jj_2_649(2)) {
       jj_consume_token(BIG_QUERY_BACK_QUOTED_IDENTIFIER);
             id = SqlParserUtil.stripQuotes(getToken(0).image, "`", "`", "\\`",
                 quotedCasing);
             pos = getPos().withQuoting(true);
-    } else if (jj_2_619(2)) {
+    } else if (jj_2_650(2)) {
       jj_consume_token(BRACKET_QUOTED_IDENTIFIER);
             id = SqlParserUtil.stripQuotes(getToken(0).image, "[", "]", "]]",
                 quotedCasing);
             pos = getPos().withQuoting(true);
-    } else if (jj_2_620(2)) {
+    } else if (jj_2_651(2)) {
       jj_consume_token(UNICODE_QUOTED_IDENTIFIER);
             span = span();
             String image = getToken(0).image;
             image = image.substring(image.indexOf('"'));
             image = SqlParserUtil.stripQuotes(image, DQ, DQ, DQDQ, quotedCasing);
-      if (jj_2_613(2)) {
+      if (jj_2_644(2)) {
         jj_consume_token(UESCAPE);
         jj_consume_token(QUOTED_STRING);
                 String s = SqlParserUtil.parseString(token.image);
@@ -6593,7 +6802,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             SqlLiteral lit = SqlLiteral.createCharString(image, "UTF16", pos);
             lit = lit.unescapeUnicode(unicodeEscapeChar);
             id = lit.toValue();
-    } else if (jj_2_621(2)) {
+    } else if (jj_2_652(2)) {
       id = NonReservedKeyWord();
             pos = getPos();
     } else {
@@ -6676,12 +6885,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlIdentifier id;
     id = SimpleIdentifier();
                              list.add(id);
-    label_54:
+    label_55:
     while (true) {
-      if (jj_2_622(2)) {
+      if (jj_2_653(2)) {
         ;
       } else {
-        break label_54;
+        break label_55;
       }
       jj_consume_token(COMMA);
       id = SimpleIdentifier();
@@ -6714,10 +6923,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlNodeList SimpleIdentifierOrList() throws ParseException {
     SqlIdentifier id;
     SqlNodeList list;
-    if (jj_2_623(2)) {
+    if (jj_2_654(2)) {
       id = SimpleIdentifier();
         {if (true) return new SqlNodeList(Collections.singletonList(id), id.getParserPosition());}
-    } else if (jj_2_624(2)) {
+    } else if (jj_2_655(2)) {
       list = ParenthesizedSimpleIdentifierList();
         {if (true) return list;}
     } else {
@@ -6735,17 +6944,17 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final List<SqlParserPos> posList = new ArrayList<SqlParserPos>();
     boolean star = false;
     AddIdentifierSegment(nameList, posList);
-    label_55:
+    label_56:
     while (true) {
-      if (jj_2_625(2)) {
+      if (jj_2_656(2)) {
         ;
       } else {
-        break label_55;
+        break label_56;
       }
       jj_consume_token(DOT);
       AddIdentifierSegment(nameList, posList);
     }
-    if (jj_2_626(2)) {
+    if (jj_2_657(2)) {
       jj_consume_token(DOT);
       jj_consume_token(STAR);
             star = true;
@@ -6769,12 +6978,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final List<String> nameList = new ArrayList<String>();
     final List<SqlParserPos> posList = new ArrayList<SqlParserPos>();
     AddTableIdentifierSegment(nameList, posList);
-    label_56:
+    label_57:
     while (true) {
-      if (jj_2_627(2)) {
+      if (jj_2_658(2)) {
         ;
       } else {
-        break label_56;
+        break label_57;
       }
       jj_consume_token(DOT);
       AddTableIdentifierSegment(nameList, posList);
@@ -6789,12 +6998,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public void AddCompoundIdentifierTypes(List<SqlNode> list, List<SqlNode> extendList) throws ParseException {
     AddCompoundIdentifierType(list, extendList);
-    label_57:
+    label_58:
     while (true) {
-      if (jj_2_628(2)) {
+      if (jj_2_659(2)) {
         ;
       } else {
-        break label_57;
+        break label_58;
       }
       jj_consume_token(COMMA);
       AddCompoundIdentifierType(list, extendList);
@@ -6846,10 +7055,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
   final public int IntLiteral() throws ParseException {
     Token t;
-    if (jj_2_631(2)) {
-      if (jj_2_629(2)) {
+    if (jj_2_662(2)) {
+      if (jj_2_660(2)) {
         t = jj_consume_token(UNSIGNED_INTEGER_LITERAL);
-      } else if (jj_2_630(2)) {
+      } else if (jj_2_661(2)) {
         jj_consume_token(PLUS);
         t = jj_consume_token(UNSIGNED_INTEGER_LITERAL);
       } else {
@@ -6862,7 +7071,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             {if (true) throw SqlUtil.newContextException(getPos(),
                 RESOURCE.invalidLiteral(t.image, Integer.class.getCanonicalName()));}
         }
-    } else if (jj_2_632(2)) {
+    } else if (jj_2_663(2)) {
       jj_consume_token(MINUS);
       t = jj_consume_token(UNSIGNED_INTEGER_LITERAL);
         try {
@@ -6884,12 +7093,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     typeName = TypeName();
         s = Span.of(typeName.getParserPos());
-    label_58:
+    label_59:
     while (true) {
-      if (jj_2_633(2)) {
+      if (jj_2_664(2)) {
         ;
       } else {
-        break label_58;
+        break label_59;
       }
       typeName = CollectionsTypeName(typeName);
     }
@@ -6903,11 +7112,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlTypeNameSpec typeNameSpec;
     final SqlIdentifier typeName;
     final Span s = Span.of();
-    if (jj_2_634(2)) {
+    if (jj_2_665(2)) {
       typeNameSpec = SqlTypeName(s);
-    } else if (jj_2_635(2)) {
+    } else if (jj_2_666(2)) {
       typeNameSpec = RowTypeName();
-    } else if (jj_2_636(2)) {
+    } else if (jj_2_667(2)) {
+      typeNameSpec = MapTypeName();
+    } else if (jj_2_668(2)) {
       typeName = CompoundIdentifier();
             typeNameSpec = new SqlUserDefinedTypeNameSpec(typeName, s.end(this));
     } else {
@@ -6921,15 +7132,15 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 // Types used for JDBC and ODBC scalar conversion function
   final public SqlTypeNameSpec SqlTypeName(Span s) throws ParseException {
     final SqlTypeNameSpec sqlTypeNameSpec;
-    if (jj_2_637(2)) {
+    if (jj_2_669(2)) {
       sqlTypeNameSpec = SqlTypeName1(s);
-    } else if (jj_2_638(2)) {
+    } else if (jj_2_670(2)) {
       sqlTypeNameSpec = SqlTypeName2(s);
-    } else if (jj_2_639(2)) {
+    } else if (jj_2_671(2)) {
       sqlTypeNameSpec = SqlTypeName3(s);
-    } else if (jj_2_640(2)) {
+    } else if (jj_2_672(2)) {
       sqlTypeNameSpec = CharacterTypeName(s);
-    } else if (jj_2_641(2)) {
+    } else if (jj_2_673(2)) {
       sqlTypeNameSpec = DateTimeTypeName();
     } else {
       jj_consume_token(-1);
@@ -6943,48 +7154,48 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 // For extra specification, we mean precision, scale, charSet, etc.
   final public SqlTypeNameSpec SqlTypeName1(Span s) throws ParseException {
     final SqlTypeName sqlTypeName;
-    if (jj_2_645(2)) {
+    if (jj_2_677(2)) {
       jj_consume_token(GEOMETRY);
             if (!this.conformance.allowGeometry()) {
                 {if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.geometryDisabled());}
             }
             s.add(this);
             sqlTypeName = SqlTypeName.GEOMETRY;
-    } else if (jj_2_646(2)) {
+    } else if (jj_2_678(2)) {
       jj_consume_token(BOOLEAN);
                     s.add(this); sqlTypeName = SqlTypeName.BOOLEAN;
-    } else if (jj_2_647(2)) {
-      if (jj_2_642(2)) {
+    } else if (jj_2_679(2)) {
+      if (jj_2_674(2)) {
         jj_consume_token(INTEGER);
-      } else if (jj_2_643(2)) {
+      } else if (jj_2_675(2)) {
         jj_consume_token(INT);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                 s.add(this); sqlTypeName = SqlTypeName.INTEGER;
-    } else if (jj_2_648(2)) {
+    } else if (jj_2_680(2)) {
       jj_consume_token(TINYINT);
                     s.add(this); sqlTypeName = SqlTypeName.TINYINT;
-    } else if (jj_2_649(2)) {
+    } else if (jj_2_681(2)) {
       jj_consume_token(SMALLINT);
                      s.add(this); sqlTypeName = SqlTypeName.SMALLINT;
-    } else if (jj_2_650(2)) {
+    } else if (jj_2_682(2)) {
       jj_consume_token(BIGINT);
                    s.add(this); sqlTypeName = SqlTypeName.BIGINT;
-    } else if (jj_2_651(2)) {
+    } else if (jj_2_683(2)) {
       jj_consume_token(REAL);
                  s.add(this); sqlTypeName = SqlTypeName.REAL;
-    } else if (jj_2_652(2)) {
+    } else if (jj_2_684(2)) {
       jj_consume_token(DOUBLE);
                    s.add(this);
-      if (jj_2_644(2)) {
+      if (jj_2_676(2)) {
         jj_consume_token(PRECISION);
       } else {
         ;
       }
                           sqlTypeName = SqlTypeName.DOUBLE;
-    } else if (jj_2_653(2)) {
+    } else if (jj_2_685(2)) {
       jj_consume_token(FLOAT);
                   s.add(this); sqlTypeName = SqlTypeName.FLOAT;
     } else {
@@ -6999,16 +7210,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlTypeNameSpec SqlTypeName2(Span s) throws ParseException {
     final SqlTypeName sqlTypeName;
     int precision = -1;
-    if (jj_2_655(2)) {
+    if (jj_2_687(2)) {
       jj_consume_token(BINARY);
                    s.add(this);
-      if (jj_2_654(2)) {
+      if (jj_2_686(2)) {
         jj_consume_token(VARYING);
                         sqlTypeName = SqlTypeName.VARBINARY;
       } else {
               sqlTypeName = SqlTypeName.BINARY;
       }
-    } else if (jj_2_656(2)) {
+    } else if (jj_2_688(2)) {
       jj_consume_token(VARBINARY);
                       s.add(this); sqlTypeName = SqlTypeName.VARBINARY;
     } else {
@@ -7025,29 +7236,29 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlTypeName sqlTypeName;
     int precision = -1;
     int scale = -1;
-    if (jj_2_660(2)) {
-      if (jj_2_657(2)) {
+    if (jj_2_692(2)) {
+      if (jj_2_689(2)) {
         jj_consume_token(DECIMAL);
-      } else if (jj_2_658(2)) {
+      } else if (jj_2_690(2)) {
         jj_consume_token(DEC);
-      } else if (jj_2_659(2)) {
+      } else if (jj_2_691(2)) {
         jj_consume_token(NUMERIC);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                           s.add(this); sqlTypeName = SqlTypeName.DECIMAL;
-    } else if (jj_2_661(2)) {
+    } else if (jj_2_693(2)) {
       jj_consume_token(ANY);
                 s.add(this); sqlTypeName = SqlTypeName.ANY;
     } else {
       jj_consume_token(-1);
       throw new ParseException();
     }
-    if (jj_2_663(2)) {
+    if (jj_2_695(2)) {
       jj_consume_token(LPAREN);
       precision = UnsignedIntLiteral();
-      if (jj_2_662(2)) {
+      if (jj_2_694(2)) {
         jj_consume_token(COMMA);
         scale = UnsignedIntLiteral();
       } else {
@@ -7063,213 +7274,213 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
 // Types used for for JDBC and ODBC scalar conversion function
   final public SqlJdbcDataTypeName JdbcOdbcDataTypeName() throws ParseException {
-    if (jj_2_698(2)) {
-      if (jj_2_664(2)) {
+    if (jj_2_730(2)) {
+      if (jj_2_696(2)) {
         jj_consume_token(SQL_CHAR);
-      } else if (jj_2_665(2)) {
+      } else if (jj_2_697(2)) {
         jj_consume_token(CHAR);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                             {if (true) return SqlJdbcDataTypeName.SQL_CHAR;}
-    } else if (jj_2_699(2)) {
-      if (jj_2_666(2)) {
+    } else if (jj_2_731(2)) {
+      if (jj_2_698(2)) {
         jj_consume_token(SQL_VARCHAR);
-      } else if (jj_2_667(2)) {
+      } else if (jj_2_699(2)) {
         jj_consume_token(VARCHAR);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                   {if (true) return SqlJdbcDataTypeName.SQL_VARCHAR;}
-    } else if (jj_2_700(2)) {
-      if (jj_2_668(2)) {
+    } else if (jj_2_732(2)) {
+      if (jj_2_700(2)) {
         jj_consume_token(SQL_DATE);
-      } else if (jj_2_669(2)) {
+      } else if (jj_2_701(2)) {
         jj_consume_token(DATE);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                             {if (true) return SqlJdbcDataTypeName.SQL_DATE;}
-    } else if (jj_2_701(2)) {
-      if (jj_2_670(2)) {
+    } else if (jj_2_733(2)) {
+      if (jj_2_702(2)) {
         jj_consume_token(SQL_TIME);
-      } else if (jj_2_671(2)) {
+      } else if (jj_2_703(2)) {
         jj_consume_token(TIME);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                             {if (true) return SqlJdbcDataTypeName.SQL_TIME;}
-    } else if (jj_2_702(2)) {
-      if (jj_2_672(2)) {
+    } else if (jj_2_734(2)) {
+      if (jj_2_704(2)) {
         jj_consume_token(SQL_TIMESTAMP);
-      } else if (jj_2_673(2)) {
+      } else if (jj_2_705(2)) {
         jj_consume_token(TIMESTAMP);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                       {if (true) return SqlJdbcDataTypeName.SQL_TIMESTAMP;}
-    } else if (jj_2_703(2)) {
-      if (jj_2_674(2)) {
+    } else if (jj_2_735(2)) {
+      if (jj_2_706(2)) {
         jj_consume_token(SQL_DECIMAL);
-      } else if (jj_2_675(2)) {
+      } else if (jj_2_707(2)) {
         jj_consume_token(DECIMAL);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                   {if (true) return SqlJdbcDataTypeName.SQL_DECIMAL;}
-    } else if (jj_2_704(2)) {
-      if (jj_2_676(2)) {
+    } else if (jj_2_736(2)) {
+      if (jj_2_708(2)) {
         jj_consume_token(SQL_NUMERIC);
-      } else if (jj_2_677(2)) {
+      } else if (jj_2_709(2)) {
         jj_consume_token(NUMERIC);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                   {if (true) return SqlJdbcDataTypeName.SQL_NUMERIC;}
-    } else if (jj_2_705(2)) {
-      if (jj_2_678(2)) {
+    } else if (jj_2_737(2)) {
+      if (jj_2_710(2)) {
         jj_consume_token(SQL_BOOLEAN);
-      } else if (jj_2_679(2)) {
+      } else if (jj_2_711(2)) {
         jj_consume_token(BOOLEAN);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                   {if (true) return SqlJdbcDataTypeName.SQL_BOOLEAN;}
-    } else if (jj_2_706(2)) {
-      if (jj_2_680(2)) {
+    } else if (jj_2_738(2)) {
+      if (jj_2_712(2)) {
         jj_consume_token(SQL_INTEGER);
-      } else if (jj_2_681(2)) {
+      } else if (jj_2_713(2)) {
         jj_consume_token(INTEGER);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                   {if (true) return SqlJdbcDataTypeName.SQL_INTEGER;}
-    } else if (jj_2_707(2)) {
-      if (jj_2_682(2)) {
+    } else if (jj_2_739(2)) {
+      if (jj_2_714(2)) {
         jj_consume_token(SQL_BINARY);
-      } else if (jj_2_683(2)) {
+      } else if (jj_2_715(2)) {
         jj_consume_token(BINARY);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                 {if (true) return SqlJdbcDataTypeName.SQL_BINARY;}
-    } else if (jj_2_708(2)) {
-      if (jj_2_684(2)) {
+    } else if (jj_2_740(2)) {
+      if (jj_2_716(2)) {
         jj_consume_token(SQL_VARBINARY);
-      } else if (jj_2_685(2)) {
+      } else if (jj_2_717(2)) {
         jj_consume_token(VARBINARY);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                       {if (true) return SqlJdbcDataTypeName.SQL_VARBINARY;}
-    } else if (jj_2_709(2)) {
-      if (jj_2_686(2)) {
+    } else if (jj_2_741(2)) {
+      if (jj_2_718(2)) {
         jj_consume_token(SQL_TINYINT);
-      } else if (jj_2_687(2)) {
+      } else if (jj_2_719(2)) {
         jj_consume_token(TINYINT);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                   {if (true) return SqlJdbcDataTypeName.SQL_TINYINT;}
-    } else if (jj_2_710(2)) {
-      if (jj_2_688(2)) {
+    } else if (jj_2_742(2)) {
+      if (jj_2_720(2)) {
         jj_consume_token(SQL_SMALLINT);
-      } else if (jj_2_689(2)) {
+      } else if (jj_2_721(2)) {
         jj_consume_token(SMALLINT);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                     {if (true) return SqlJdbcDataTypeName.SQL_SMALLINT;}
-    } else if (jj_2_711(2)) {
-      if (jj_2_690(2)) {
+    } else if (jj_2_743(2)) {
+      if (jj_2_722(2)) {
         jj_consume_token(SQL_BIGINT);
-      } else if (jj_2_691(2)) {
+      } else if (jj_2_723(2)) {
         jj_consume_token(BIGINT);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                 {if (true) return SqlJdbcDataTypeName.SQL_BIGINT;}
-    } else if (jj_2_712(2)) {
-      if (jj_2_692(2)) {
+    } else if (jj_2_744(2)) {
+      if (jj_2_724(2)) {
         jj_consume_token(SQL_REAL);
-      } else if (jj_2_693(2)) {
+      } else if (jj_2_725(2)) {
         jj_consume_token(REAL);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                            {if (true) return SqlJdbcDataTypeName.SQL_REAL;}
-    } else if (jj_2_713(2)) {
-      if (jj_2_694(2)) {
+    } else if (jj_2_745(2)) {
+      if (jj_2_726(2)) {
         jj_consume_token(SQL_DOUBLE);
-      } else if (jj_2_695(2)) {
+      } else if (jj_2_727(2)) {
         jj_consume_token(DOUBLE);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                 {if (true) return SqlJdbcDataTypeName.SQL_DOUBLE;}
-    } else if (jj_2_714(2)) {
-      if (jj_2_696(2)) {
+    } else if (jj_2_746(2)) {
+      if (jj_2_728(2)) {
         jj_consume_token(SQL_FLOAT);
-      } else if (jj_2_697(2)) {
+      } else if (jj_2_729(2)) {
         jj_consume_token(FLOAT);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                               {if (true) return SqlJdbcDataTypeName.SQL_FLOAT;}
-    } else if (jj_2_715(2)) {
+    } else if (jj_2_747(2)) {
       jj_consume_token(SQL_INTERVAL_YEAR);
                           {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_YEAR;}
-    } else if (jj_2_716(2)) {
+    } else if (jj_2_748(2)) {
       jj_consume_token(SQL_INTERVAL_YEAR_TO_MONTH);
                                    {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_YEAR_TO_MONTH;}
-    } else if (jj_2_717(2)) {
+    } else if (jj_2_749(2)) {
       jj_consume_token(SQL_INTERVAL_MONTH);
                            {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_MONTH;}
-    } else if (jj_2_718(2)) {
+    } else if (jj_2_750(2)) {
       jj_consume_token(SQL_INTERVAL_DAY);
                          {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_DAY;}
-    } else if (jj_2_719(2)) {
+    } else if (jj_2_751(2)) {
       jj_consume_token(SQL_INTERVAL_DAY_TO_HOUR);
                                  {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_DAY_TO_HOUR;}
-    } else if (jj_2_720(2)) {
+    } else if (jj_2_752(2)) {
       jj_consume_token(SQL_INTERVAL_DAY_TO_MINUTE);
                                    {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_DAY_TO_MINUTE;}
-    } else if (jj_2_721(2)) {
+    } else if (jj_2_753(2)) {
       jj_consume_token(SQL_INTERVAL_DAY_TO_SECOND);
                                    {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_DAY_TO_SECOND;}
-    } else if (jj_2_722(2)) {
+    } else if (jj_2_754(2)) {
       jj_consume_token(SQL_INTERVAL_HOUR);
                           {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_HOUR;}
-    } else if (jj_2_723(2)) {
+    } else if (jj_2_755(2)) {
       jj_consume_token(SQL_INTERVAL_HOUR_TO_MINUTE);
                                     {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_HOUR_TO_MINUTE;}
-    } else if (jj_2_724(2)) {
+    } else if (jj_2_756(2)) {
       jj_consume_token(SQL_INTERVAL_HOUR_TO_SECOND);
                                     {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_HOUR_TO_SECOND;}
-    } else if (jj_2_725(2)) {
+    } else if (jj_2_757(2)) {
       jj_consume_token(SQL_INTERVAL_MINUTE);
                             {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_MINUTE;}
-    } else if (jj_2_726(2)) {
+    } else if (jj_2_758(2)) {
       jj_consume_token(SQL_INTERVAL_MINUTE_TO_SECOND);
                                       {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_MINUTE_TO_SECOND;}
-    } else if (jj_2_727(2)) {
+    } else if (jj_2_759(2)) {
       jj_consume_token(SQL_INTERVAL_SECOND);
                             {if (true) return SqlJdbcDataTypeName.SQL_INTERVAL_SECOND;}
     } else {
@@ -7292,10 +7503,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 */
   final public SqlTypeNameSpec CollectionsTypeName(SqlTypeNameSpec elementTypeName) throws ParseException {
     final SqlTypeName collectionTypeName;
-    if (jj_2_728(2)) {
+    if (jj_2_760(2)) {
       jj_consume_token(MULTISET);
                      collectionTypeName = SqlTypeName.MULTISET;
-    } else if (jj_2_729(2)) {
+    } else if (jj_2_761(2)) {
       jj_consume_token(ARRAY);
                   collectionTypeName = SqlTypeName.ARRAY;
     } else {
@@ -7311,10 +7522,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 * Parse a nullable option, default is true.
 */
   final public boolean NullableOptDefaultTrue() throws ParseException {
-    if (jj_2_730(2)) {
+    if (jj_2_762(2)) {
       jj_consume_token(NULL);
              {if (true) return true;}
-    } else if (jj_2_731(2)) {
+    } else if (jj_2_763(2)) {
       jj_consume_token(NOT);
       jj_consume_token(NULL);
                    {if (true) return false;}
@@ -7328,10 +7539,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 * Parse a nullable option, default is false.
 */
   final public boolean NullableOptDefaultFalse() throws ParseException {
-    if (jj_2_732(2)) {
+    if (jj_2_764(2)) {
       jj_consume_token(NULL);
              {if (true) return true;}
-    } else if (jj_2_733(2)) {
+    } else if (jj_2_765(2)) {
       jj_consume_token(NOT);
       jj_consume_token(NULL);
                    {if (true) return false;}
@@ -7343,7 +7554,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
 /** Parses NOT NULL and returns false, or parses nothing and returns true. */
   final public boolean NotNullOpt() throws ParseException {
-    if (jj_2_734(2)) {
+    if (jj_2_766(2)) {
       jj_consume_token(NOT);
       jj_consume_token(NULL);
                    {if (true) return false;}
@@ -7360,12 +7571,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public void AddFieldNameTypes(List<SqlIdentifier> fieldNames,
     List<SqlDataTypeSpec> fieldTypes) throws ParseException {
     AddFieldNameType(fieldNames, fieldTypes);
-    label_59:
+    label_60:
     while (true) {
-      if (jj_2_735(2)) {
+      if (jj_2_767(2)) {
         ;
       } else {
-        break label_59;
+        break label_60;
       }
       jj_consume_token(COMMA);
       AddFieldNameType(fieldNames, fieldTypes);
@@ -7400,6 +7611,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     throw new Error("Missing return statement in function");
   }
 
+  final public SqlTypeNameSpec MapTypeName() throws ParseException {
+    SqlDataTypeSpec keyType = null;
+    SqlDataTypeSpec valType = null;
+    jj_consume_token(MAP);
+    jj_consume_token(LT);
+    keyType = DataType();
+    jj_consume_token(COMMA);
+    valType = DataType();
+    jj_consume_token(GT);
+        {if (true) return new SqlMapTypeNameSpec(keyType, valType, getPos());}
+    throw new Error("Missing return statement in function");
+  }
+
 /**
 * Parse character types: char, varchar.
 */
@@ -7407,23 +7631,23 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     int precision = -1;
     final SqlTypeName sqlTypeName;
     String charSetName = null;
-    if (jj_2_739(2)) {
-      if (jj_2_736(2)) {
+    if (jj_2_771(2)) {
+      if (jj_2_768(2)) {
         jj_consume_token(CHARACTER);
-      } else if (jj_2_737(2)) {
+      } else if (jj_2_769(2)) {
         jj_consume_token(CHAR);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
                                  s.add(this);
-      if (jj_2_738(2)) {
+      if (jj_2_770(2)) {
         jj_consume_token(VARYING);
                         sqlTypeName = SqlTypeName.VARCHAR;
       } else {
               sqlTypeName = SqlTypeName.CHAR;
       }
-    } else if (jj_2_740(2)) {
+    } else if (jj_2_772(2)) {
       jj_consume_token(VARCHAR);
                     s.add(this); sqlTypeName = SqlTypeName.VARCHAR;
     } else {
@@ -7431,7 +7655,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       throw new ParseException();
     }
     precision = PrecisionOpt();
-    if (jj_2_741(2)) {
+    if (jj_2_773(2)) {
       jj_consume_token(CHARACTER);
       jj_consume_token(SET);
       charSetName = Identifier();
@@ -7448,33 +7672,22 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlTypeNameSpec DateTimeTypeName() throws ParseException {
     int precision = -1;
     SqlTypeName typeName;
-    boolean withLocalTimeZone = false;
     final Span s;
-    if (jj_2_742(2)) {
+    if (jj_2_774(2)) {
       jj_consume_token(DATE);
         typeName = SqlTypeName.DATE;
         {if (true) return new SqlBasicTypeNameSpec(typeName, getPos());}
-    } else if (jj_2_743(2)) {
+    } else if (jj_2_775(2)) {
       jj_consume_token(TIME);
              s = span();
       precision = PrecisionOpt();
-      withLocalTimeZone = TimeZoneOpt();
-        if (withLocalTimeZone) {
-            typeName = SqlTypeName.TIME_WITH_LOCAL_TIME_ZONE;
-        } else {
-            typeName = SqlTypeName.TIME;
-        }
+      typeName = TimeZoneOpt(true);
         {if (true) return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));}
-    } else if (jj_2_744(2)) {
+    } else if (jj_2_776(2)) {
       jj_consume_token(TIMESTAMP);
                   s = span();
       precision = PrecisionOpt();
-      withLocalTimeZone = TimeZoneOpt();
-        if (withLocalTimeZone) {
-            typeName = SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE;
-        } else {
-            typeName = SqlTypeName.TIMESTAMP;
-        }
+      typeName = TimeZoneOpt(false);
         {if (true) return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));}
     } else {
       jj_consume_token(-1);
@@ -7486,7 +7699,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 // Parse an optional data type precision, default is -1.
   final public int PrecisionOpt() throws ParseException {
     int precision = -1;
-    if (jj_2_745(2)) {
+    if (jj_2_777(2)) {
       jj_consume_token(LPAREN);
       precision = UnsignedIntLiteral();
       jj_consume_token(RPAREN);
@@ -7499,27 +7712,30 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
 /**
 * Parse a time zone suffix for DateTime types. According to SQL-2011,
-* "with time zone" and "without time zone" belong to standard SQL but we
-* only implement the "without time zone".
-*
-* <p>We also support "with local time zone".
-*
-* @return true if this is "with local time zone".
+* "with time zone" and "without time zone" belong to standard SQL.
+* We also support "with local time zone".
 */
-  final public boolean TimeZoneOpt() throws ParseException {
-    if (jj_2_746(3)) {
+  final public SqlTypeName TimeZoneOpt(boolean timeType) throws ParseException {
+    boolean local = false;
+    if (jj_2_779(3)) {
       jj_consume_token(WITHOUT);
       jj_consume_token(TIME);
       jj_consume_token(ZONE);
-                              {if (true) return false;}
-    } else if (jj_2_747(2)) {
+                              {if (true) return timeType ? SqlTypeName.TIME : SqlTypeName.TIMESTAMP;}
+    } else if (jj_2_780(2)) {
       jj_consume_token(WITH);
-      jj_consume_token(LOCAL);
+      if (jj_2_778(2)) {
+        jj_consume_token(LOCAL);
+                       local = true;
+      } else {
+        ;
+      }
       jj_consume_token(TIME);
       jj_consume_token(ZONE);
-                                   {if (true) return true;}
+        {if (true) return timeType ? (local ? SqlTypeName.TIME_WITH_LOCAL_TIME_ZONE : SqlTypeName.TIME_TZ)
+                        : (local ? SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE : SqlTypeName.TIMESTAMP_TZ);}
     } else {
-      {if (true) return false;}
+      {if (true) return timeType ? SqlTypeName.TIME : SqlTypeName.TIMESTAMP;}
     }
     throw new Error("Missing return statement in function");
   }
@@ -7555,16 +7771,31 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     SqlDataTypeSpec dt;
     final SqlIntervalQualifier unit;
     final SqlNode node;
-    if (jj_2_770(2)) {
-      jj_consume_token(CAST);
-                 s = span();
+    final SqlLiteral style; // mssql convert 'style' operand
+    final SqlFunction f;
+    final SqlNode format;
+    if (jj_2_816(2)) {
+      if (jj_2_781(2)) {
+        jj_consume_token(CAST);
+                    f = SqlStdOperatorTable.CAST;
+      } else if (jj_2_782(2)) {
+        jj_consume_token(SAFE_CAST);
+                        f = SqlLibraryOperators.SAFE_CAST;
+      } else if (jj_2_783(2)) {
+        jj_consume_token(TRY_CAST);
+                       f = SqlLibraryOperators.TRY_CAST;
+      } else {
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+          s = span();
       jj_consume_token(LPAREN);
       AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
       jj_consume_token(AS);
-      if (jj_2_748(2)) {
+      if (jj_2_784(2)) {
         dt = DataType();
                               args.add(dt);
-      } else if (jj_2_749(2)) {
+      } else if (jj_2_785(2)) {
         jj_consume_token(INTERVAL);
         e = IntervalQualifier();
                                                  args.add(e);
@@ -7572,9 +7803,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         jj_consume_token(-1);
         throw new ParseException();
       }
+      if (jj_2_786(2)) {
+        jj_consume_token(FORMAT);
+        format = StringLiteral();
+                                              args.add(format);
+      } else {
+        ;
+      }
       jj_consume_token(RPAREN);
-            {if (true) return SqlStdOperatorTable.CAST.createCall(s.end(this), args);}
-    } else if (jj_2_771(2)) {
+            {if (true) return f.createCall(s.end(this), args);}
+    } else if (jj_2_817(2)) {
       jj_consume_token(EXTRACT);
                     s = span();
       jj_consume_token(LPAREN);
@@ -7584,7 +7822,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
       jj_consume_token(RPAREN);
             {if (true) return SqlStdOperatorTable.EXTRACT.createCall(s.end(this), args);}
-    } else if (jj_2_772(2)) {
+    } else if (jj_2_818(2)) {
       jj_consume_token(POSITION);
                      s = span();
       jj_consume_token(LPAREN);
@@ -7595,7 +7833,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                                     args.add(e);
       jj_consume_token(IN);
       AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
-      if (jj_2_750(2)) {
+      if (jj_2_787(2)) {
         jj_consume_token(FROM);
         AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
       } else {
@@ -7603,35 +7841,85 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       }
       jj_consume_token(RPAREN);
             {if (true) return SqlStdOperatorTable.POSITION.createCall(s.end(this), args);}
-    } else if (jj_2_773(2)) {
+    } else if (jj_2_819(2)) {
       jj_consume_token(CONVERT);
                     s = span();
       jj_consume_token(LPAREN);
-      AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
-      jj_consume_token(USING);
-      name = SimpleIdentifier();
-                                            args.add(name);
-      jj_consume_token(RPAREN);
-            {if (true) return SqlStdOperatorTable.CONVERT.createCall(s.end(this), args);}
-    } else if (jj_2_774(2)) {
+      if (jj_2_795(2)) {
+        AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
+        if (jj_2_788(2)) {
+          jj_consume_token(USING);
+          name = SimpleIdentifier();
+                                                    args.add(name);
+          jj_consume_token(RPAREN);
+                    {if (true) return SqlStdOperatorTable.TRANSLATE.createCall(s.end(this), args);}
+        } else if (jj_2_789(2)) {
+          jj_consume_token(COMMA);
+          e = SimpleIdentifier();
+                                                 args.add(e);
+          jj_consume_token(COMMA);
+          e = SimpleIdentifier();
+                                                 args.add(e);
+          jj_consume_token(RPAREN);
+                    {if (true) return SqlStdOperatorTable.CONVERT.createCall(s.end(this), args);}
+        } else {
+          jj_consume_token(-1);
+          throw new ParseException();
+        }
+      } else if (jj_2_796(2)) {
+        if (jj_2_790(2)) {
+          dt = DataType();
+                                  args.add(dt);
+        } else if (jj_2_791(2)) {
+          jj_consume_token(INTERVAL);
+          e = IntervalQualifier();
+                                                     args.add(e);
+        } else {
+          jj_consume_token(-1);
+          throw new ParseException();
+        }
+        jj_consume_token(COMMA);
+        AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
+        if (jj_2_794(2)) {
+          jj_consume_token(COMMA);
+          if (jj_2_792(2)) {
+            style = UnsignedNumericLiteral();
+                                                       args.add(style);
+          } else if (jj_2_793(2)) {
+            jj_consume_token(NULL);
+                             args.add(SqlLiteral.createNull(getPos()));
+          } else {
+            jj_consume_token(-1);
+            throw new ParseException();
+          }
+        } else {
+          ;
+        }
+        jj_consume_token(RPAREN);
+                {if (true) return SqlLibraryOperators.MSSQL_CONVERT.createCall(s.end(this), args);}
+      } else {
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+    } else if (jj_2_820(2)) {
       jj_consume_token(TRANSLATE);
                       s = span();
       jj_consume_token(LPAREN);
       AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
-      if (jj_2_752(2)) {
+      if (jj_2_798(2)) {
         jj_consume_token(USING);
         name = SimpleIdentifier();
                                                 args.add(name);
         jj_consume_token(RPAREN);
                 {if (true) return SqlStdOperatorTable.TRANSLATE.createCall(s.end(this),
                     args);}
-      } else if (jj_2_753(2)) {
-        label_60:
+      } else if (jj_2_799(2)) {
+        label_61:
         while (true) {
-          if (jj_2_751(2)) {
+          if (jj_2_797(2)) {
             ;
           } else {
-            break label_60;
+            break label_61;
           }
           jj_consume_token(COMMA);
           AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
@@ -7643,7 +7931,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         jj_consume_token(-1);
         throw new ParseException();
       }
-    } else if (jj_2_775(2)) {
+    } else if (jj_2_821(2)) {
       jj_consume_token(OVERLAY);
                     s = span();
       jj_consume_token(LPAREN);
@@ -7652,7 +7940,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
       jj_consume_token(FROM);
       AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
-      if (jj_2_754(2)) {
+      if (jj_2_800(2)) {
         jj_consume_token(FOR);
         AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
       } else {
@@ -7660,15 +7948,15 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       }
       jj_consume_token(RPAREN);
             {if (true) return SqlStdOperatorTable.OVERLAY.createCall(s.end(this), args);}
-    } else if (jj_2_776(2)) {
+    } else if (jj_2_822(2)) {
       jj_consume_token(FLOOR);
                   s = span();
       e = FloorCeilOptions(s, true);
             {if (true) return e;}
-    } else if (jj_2_777(2)) {
-      if (jj_2_755(2)) {
+    } else if (jj_2_823(2)) {
+      if (jj_2_801(2)) {
         jj_consume_token(CEIL);
-      } else if (jj_2_756(2)) {
+      } else if (jj_2_802(2)) {
         jj_consume_token(CEILING);
       } else {
         jj_consume_token(-1);
@@ -7677,24 +7965,24 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                                 s = span();
       e = FloorCeilOptions(s, false);
             {if (true) return e;}
-    } else if (jj_2_778(2)) {
+    } else if (jj_2_824(2)) {
       jj_consume_token(SUBSTRING);
                       s = span();
       jj_consume_token(LPAREN);
       AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
-      if (jj_2_757(2)) {
+      if (jj_2_803(2)) {
         jj_consume_token(FROM);
-      } else if (jj_2_758(2)) {
+      } else if (jj_2_804(2)) {
         jj_consume_token(COMMA);
       } else {
         jj_consume_token(-1);
         throw new ParseException();
       }
       AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
-      if (jj_2_761(2)) {
-        if (jj_2_759(2)) {
+      if (jj_2_807(2)) {
+        if (jj_2_805(2)) {
           jj_consume_token(FOR);
-        } else if (jj_2_760(2)) {
+        } else if (jj_2_806(2)) {
           jj_consume_token(COMMA);
         } else {
           jj_consume_token(-1);
@@ -7707,23 +7995,23 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       jj_consume_token(RPAREN);
             {if (true) return SqlStdOperatorTable.SUBSTRING.createCall(
                 s.end(this), args);}
-    } else if (jj_2_779(2)) {
+    } else if (jj_2_825(2)) {
       jj_consume_token(TRIM);
             SqlLiteral flag = null;
             SqlNode trimChars = null;
             s = span();
       jj_consume_token(LPAREN);
-      if (jj_2_769(2)) {
-        if (jj_2_765(2)) {
-          if (jj_2_762(2)) {
+      if (jj_2_815(2)) {
+        if (jj_2_811(2)) {
+          if (jj_2_808(2)) {
             jj_consume_token(BOTH);
                     s.add(this);
                     flag = SqlTrimFunction.Flag.BOTH.symbol(getPos());
-          } else if (jj_2_763(2)) {
+          } else if (jj_2_809(2)) {
             jj_consume_token(TRAILING);
                     s.add(this);
                     flag = SqlTrimFunction.Flag.TRAILING.symbol(getPos());
-          } else if (jj_2_764(2)) {
+          } else if (jj_2_810(2)) {
             jj_consume_token(LEADING);
                     s.add(this);
                     flag = SqlTrimFunction.Flag.LEADING.symbol(getPos());
@@ -7734,18 +8022,18 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         } else {
           ;
         }
-        if (jj_2_766(2)) {
+        if (jj_2_812(2)) {
           trimChars = Expression(ExprContext.ACCEPT_SUB_QUERY);
         } else {
           ;
         }
-        if (jj_2_767(2)) {
+        if (jj_2_813(2)) {
           jj_consume_token(FROM);
                     if (null == flag && null == trimChars) {
                         {if (true) throw SqlUtil.newContextException(getPos(),
                             RESOURCE.illegalFromEmpty());}
                     }
-        } else if (jj_2_768(2)) {
+        } else if (jj_2_814(2)) {
           jj_consume_token(RPAREN);
                     // This is to handle the case of TRIM(x)
                     // (FRG-191).
@@ -7773,61 +8061,67 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             args.add(e);
       jj_consume_token(RPAREN);
             {if (true) return SqlStdOperatorTable.TRIM.createCall(s.end(this), args);}
-    } else if (jj_2_780(2)) {
+    } else if (jj_2_826(2)) {
+      node = ContainsSubstrFunctionCall();
+                                              {if (true) return node;}
+    } else if (jj_2_827(2)) {
       node = DateTimeConstructorCall();
                                            {if (true) return node;}
-    } else if (jj_2_781(2)) {
+    } else if (jj_2_828(2)) {
       node = DateDiffFunctionCall();
                                         {if (true) return node;}
-    } else if (jj_2_782(2)) {
+    } else if (jj_2_829(2)) {
       node = DateTruncFunctionCall();
                                          {if (true) return node;}
-    } else if (jj_2_783(2)) {
+    } else if (jj_2_830(2)) {
+      node = DatetimeTruncFunctionCall();
+                                             {if (true) return node;}
+    } else if (jj_2_831(2)) {
       node = TimestampAddFunctionCall();
                                             {if (true) return node;}
-    } else if (jj_2_784(2)) {
+    } else if (jj_2_832(2)) {
       node = DatetimeDiffFunctionCall();
                                             {if (true) return node;}
-    } else if (jj_2_785(2)) {
+    } else if (jj_2_833(2)) {
       node = TimestampDiffFunctionCall();
                                              {if (true) return node;}
-    } else if (jj_2_786(2)) {
+    } else if (jj_2_834(2)) {
       node = TimestampDiff3FunctionCall();
                                               {if (true) return node;}
-    } else if (jj_2_787(2)) {
+    } else if (jj_2_835(2)) {
       node = TimestampTruncFunctionCall();
                                               {if (true) return node;}
-    } else if (jj_2_788(2)) {
+    } else if (jj_2_836(2)) {
       node = TimeDiffFunctionCall();
                                         {if (true) return node;}
-    } else if (jj_2_789(2)) {
+    } else if (jj_2_837(2)) {
       node = TimeTruncFunctionCall();
                                          {if (true) return node;}
-    } else if (jj_2_790(2)) {
+    } else if (jj_2_838(2)) {
       node = MatchRecognizeFunctionCall();
                                               {if (true) return node;}
-    } else if (jj_2_791(2)) {
+    } else if (jj_2_839(2)) {
       node = JsonExistsFunctionCall();
                                           {if (true) return node;}
-    } else if (jj_2_792(2)) {
+    } else if (jj_2_840(2)) {
       node = JsonValueFunctionCall();
                                          {if (true) return node;}
-    } else if (jj_2_793(2)) {
+    } else if (jj_2_841(2)) {
       node = JsonQueryFunctionCall();
                                          {if (true) return node;}
-    } else if (jj_2_794(2)) {
+    } else if (jj_2_842(2)) {
       node = JsonObjectFunctionCall();
                                           {if (true) return node;}
-    } else if (jj_2_795(2)) {
+    } else if (jj_2_843(2)) {
       node = JsonObjectAggFunctionCall();
                                              {if (true) return node;}
-    } else if (jj_2_796(2)) {
+    } else if (jj_2_844(2)) {
       node = JsonArrayFunctionCall();
                                          {if (true) return node;}
-    } else if (jj_2_797(2)) {
+    } else if (jj_2_845(2)) {
       node = JsonArrayAggFunctionCall();
                                             {if (true) return node;}
-    } else if (jj_2_798(2)) {
+    } else if (jj_2_846(2)) {
       node = GroupByWindowingCall();
                                         {if (true) return node;}
     } else {
@@ -7839,15 +8133,15 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
   final public SqlJsonEncoding JsonRepresentation() throws ParseException {
     jj_consume_token(JSON);
-    if (jj_2_802(2)) {
+    if (jj_2_850(2)) {
       jj_consume_token(ENCODING);
-      if (jj_2_799(2)) {
+      if (jj_2_847(2)) {
         jj_consume_token(UTF8);
                      {if (true) return SqlJsonEncoding.UTF8;}
-      } else if (jj_2_800(2)) {
+      } else if (jj_2_848(2)) {
         jj_consume_token(UTF16);
                       {if (true) return SqlJsonEncoding.UTF16;}
-      } else if (jj_2_801(2)) {
+      } else if (jj_2_849(2)) {
         jj_consume_token(UTF32);
                       {if (true) return SqlJsonEncoding.UTF32;}
       } else {
@@ -7877,7 +8171,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlDataTypeSpec JsonOutputClause() throws ParseException {
     SqlDataTypeSpec dataType;
     dataType = JsonReturningClause();
-    if (jj_2_803(2)) {
+    if (jj_2_851(2)) {
       jj_consume_token(FORMAT);
       JsonRepresentation();
     } else {
@@ -7900,19 +8194,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     AddExpression(args, ExprContext.ACCEPT_NON_QUERY);
     jj_consume_token(COMMA);
     AddExpression(args, ExprContext.ACCEPT_NON_QUERY);
-    if (jj_2_805(2)) {
+    if (jj_2_853(2)) {
       jj_consume_token(PASSING);
       e = Expression(ExprContext.ACCEPT_NON_QUERY);
 
       jj_consume_token(AS);
       e = SimpleIdentifier();
 
-      label_61:
+      label_62:
       while (true) {
-        if (jj_2_804(2)) {
+        if (jj_2_852(2)) {
           ;
         } else {
-          break label_61;
+          break label_62;
         }
         jj_consume_token(COMMA);
         e = Expression(ExprContext.ACCEPT_NON_QUERY);
@@ -7929,16 +8223,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public SqlJsonExistsErrorBehavior JsonExistsErrorBehavior() throws ParseException {
-    if (jj_2_806(2)) {
+    if (jj_2_854(2)) {
       jj_consume_token(TRUE);
              {if (true) return SqlJsonExistsErrorBehavior.TRUE;}
-    } else if (jj_2_807(2)) {
+    } else if (jj_2_855(2)) {
       jj_consume_token(FALSE);
               {if (true) return SqlJsonExistsErrorBehavior.FALSE;}
-    } else if (jj_2_808(2)) {
+    } else if (jj_2_856(2)) {
       jj_consume_token(UNKNOWN);
                 {if (true) return SqlJsonExistsErrorBehavior.UNKNOWN;}
-    } else if (jj_2_809(2)) {
+    } else if (jj_2_857(2)) {
       jj_consume_token(ERROR);
               {if (true) return SqlJsonExistsErrorBehavior.ERROR;}
     } else {
@@ -7958,7 +8252,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(LPAREN);
     commonSyntax = JsonApiCommonSyntax();
         args.addAll(commonSyntax);
-    if (jj_2_810(2)) {
+    if (jj_2_858(2)) {
       errorBehavior = JsonExistsErrorBehavior();
                                                     args.add(errorBehavior.symbol(getPos()));
       jj_consume_token(ON);
@@ -7973,13 +8267,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
   final public List<SqlNode> JsonValueEmptyOrErrorBehavior() throws ParseException {
     final List<SqlNode> list = new ArrayList<SqlNode>();
-    if (jj_2_811(2)) {
+    if (jj_2_859(2)) {
       jj_consume_token(ERROR);
             list.add(SqlJsonValueEmptyOrErrorBehavior.ERROR.symbol(getPos()));
-    } else if (jj_2_812(2)) {
+    } else if (jj_2_860(2)) {
       jj_consume_token(NULL);
             list.add(SqlJsonValueEmptyOrErrorBehavior.NULL.symbol(getPos()));
-    } else if (jj_2_813(2)) {
+    } else if (jj_2_861(2)) {
       jj_consume_token(DEFAULT_);
             list.add(SqlJsonValueEmptyOrErrorBehavior.DEFAULT.symbol(getPos()));
       AddExpression(list, ExprContext.ACCEPT_NON_QUERY);
@@ -7988,10 +8282,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       throw new ParseException();
     }
     jj_consume_token(ON);
-    if (jj_2_814(2)) {
+    if (jj_2_862(2)) {
       jj_consume_token(EMPTY);
             list.add(SqlJsonEmptyOrError.EMPTY.symbol(getPos()));
-    } else if (jj_2_815(2)) {
+    } else if (jj_2_863(2)) {
       jj_consume_token(ERROR);
             list.add(SqlJsonEmptyOrError.ERROR.symbol(getPos()));
     } else {
@@ -8013,19 +8307,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(LPAREN);
     commonSyntax = JsonApiCommonSyntax();
         args.addAll(commonSyntax);
-    if (jj_2_816(2)) {
+    if (jj_2_864(2)) {
       e = JsonReturningClause();
             args.add(SqlJsonValueReturning.RETURNING.symbol(getPos()));
             args.add(e);
     } else {
       ;
     }
-    label_62:
+    label_63:
     while (true) {
-      if (jj_2_817(2)) {
+      if (jj_2_865(2)) {
         ;
       } else {
-        break label_62;
+        break label_63;
       }
       behavior = JsonValueEmptyOrErrorBehavior();
             args.addAll(behavior);
@@ -8037,17 +8331,17 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
   final public List<SqlNode> JsonQueryEmptyOrErrorBehavior() throws ParseException {
     final List<SqlNode> list = new ArrayList<SqlNode>();
-    if (jj_2_818(2)) {
+    if (jj_2_866(2)) {
       jj_consume_token(ERROR);
             list.add(SqlLiteral.createSymbol(SqlJsonQueryEmptyOrErrorBehavior.ERROR, getPos()));
-    } else if (jj_2_819(2)) {
+    } else if (jj_2_867(2)) {
       jj_consume_token(NULL);
             list.add(SqlLiteral.createSymbol(SqlJsonQueryEmptyOrErrorBehavior.NULL, getPos()));
-    } else if (jj_2_820(2)) {
+    } else if (jj_2_868(2)) {
       jj_consume_token(EMPTY);
       jj_consume_token(ARRAY);
             list.add(SqlLiteral.createSymbol(SqlJsonQueryEmptyOrErrorBehavior.EMPTY_ARRAY, getPos()));
-    } else if (jj_2_821(2)) {
+    } else if (jj_2_869(2)) {
       jj_consume_token(EMPTY);
       jj_consume_token(OBJECT);
             list.add(SqlLiteral.createSymbol(SqlJsonQueryEmptyOrErrorBehavior.EMPTY_OBJECT, getPos()));
@@ -8056,10 +8350,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       throw new ParseException();
     }
     jj_consume_token(ON);
-    if (jj_2_822(2)) {
+    if (jj_2_870(2)) {
       jj_consume_token(EMPTY);
             list.add(SqlLiteral.createSymbol(SqlJsonEmptyOrError.EMPTY, getPos()));
-    } else if (jj_2_823(2)) {
+    } else if (jj_2_871(2)) {
       jj_consume_token(ERROR);
             list.add(SqlLiteral.createSymbol(SqlJsonEmptyOrError.ERROR, getPos()));
     } else {
@@ -8071,31 +8365,31 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public SqlNode JsonQueryWrapperBehavior() throws ParseException {
-    if (jj_2_828(2)) {
+    if (jj_2_876(2)) {
       jj_consume_token(WITHOUT);
-      if (jj_2_824(2)) {
+      if (jj_2_872(2)) {
         jj_consume_token(ARRAY);
       } else {
         ;
       }
         {if (true) return SqlLiteral.createSymbol(SqlJsonQueryWrapperBehavior.WITHOUT_ARRAY, getPos());}
-    } else if (jj_2_829(2)) {
+    } else if (jj_2_877(2)) {
       jj_consume_token(WITH);
       jj_consume_token(CONDITIONAL);
-      if (jj_2_825(2)) {
+      if (jj_2_873(2)) {
         jj_consume_token(ARRAY);
       } else {
         ;
       }
         {if (true) return SqlLiteral.createSymbol(SqlJsonQueryWrapperBehavior.WITH_CONDITIONAL_ARRAY, getPos());}
-    } else if (jj_2_830(2)) {
+    } else if (jj_2_878(2)) {
       jj_consume_token(WITH);
-      if (jj_2_826(2)) {
+      if (jj_2_874(2)) {
         jj_consume_token(UNCONDITIONAL);
       } else {
         ;
       }
-      if (jj_2_827(2)) {
+      if (jj_2_875(2)) {
         jj_consume_token(ARRAY);
       } else {
         ;
@@ -8120,19 +8414,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     commonSyntax = JsonApiCommonSyntax();
         args[0] = commonSyntax.get(0);
         args[1] = commonSyntax.get(1);
-    if (jj_2_831(2)) {
+    if (jj_2_879(2)) {
       e = JsonQueryWrapperBehavior();
       jj_consume_token(WRAPPER);
             args[2] = e;
     } else {
       ;
     }
-    label_63:
+    label_64:
     while (true) {
-      if (jj_2_832(2)) {
+      if (jj_2_880(2)) {
         ;
       } else {
-        break label_63;
+        break label_64;
       }
       behavior = JsonQueryEmptyOrErrorBehavior();
             final SqlJsonEmptyOrError symbol =
@@ -8162,7 +8456,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final List<SqlNode> list = new ArrayList<SqlNode>();
     final SqlNode e;
     boolean kvMode = false;
-    if (jj_2_833(2)) {
+    if (jj_2_881(2)) {
       jj_consume_token(KEY);
                 kvMode = true;
     } else {
@@ -8170,9 +8464,14 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     }
     e = JsonName();
         list.add(e);
-    if (jj_2_834(2)) {
+    if (jj_2_882(2)) {
       jj_consume_token(VALUE);
-    } else if (jj_2_835(2)) {
+    } else if (jj_2_883(2)) {
+      jj_consume_token(COMMA);
+            if (kvMode) {
+                {if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.illegalComma());}
+            }
+    } else if (jj_2_884(2)) {
       jj_consume_token(COLON);
             if (kvMode) {
                 {if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.illegalColon());}
@@ -8187,12 +8486,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public SqlNode JsonConstructorNullClause() throws ParseException {
-    if (jj_2_836(2)) {
+    if (jj_2_885(2)) {
       jj_consume_token(NULL);
       jj_consume_token(ON);
       jj_consume_token(NULL);
         {if (true) return SqlLiteral.createSymbol(SqlJsonConstructorNullClause.NULL_ON_NULL, getPos());}
-    } else if (jj_2_837(2)) {
+    } else if (jj_2_886(2)) {
       jj_consume_token(ABSENT);
       jj_consume_token(ON);
       jj_consume_token(NULL);
@@ -8213,15 +8512,15 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(JSON_OBJECT);
                     span = span();
     jj_consume_token(LPAREN);
-    if (jj_2_839(2)) {
+    if (jj_2_888(2)) {
       list = JsonNameAndValue();
             nvArgs.addAll(list);
-      label_64:
+      label_65:
       while (true) {
-        if (jj_2_838(2)) {
+        if (jj_2_887(2)) {
           ;
         } else {
-          break label_64;
+          break label_65;
         }
         jj_consume_token(COMMA);
         list = JsonNameAndValue();
@@ -8230,7 +8529,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     } else {
       ;
     }
-    if (jj_2_840(2)) {
+    if (jj_2_889(2)) {
       e = JsonConstructorNullClause();
             otherArgs[0] = e;
     } else {
@@ -8257,7 +8556,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     list = JsonNameAndValue();
         args[0] = list.get(0);
         args[1] = list.get(1);
-    if (jj_2_841(2)) {
+    if (jj_2_890(2)) {
       e = JsonConstructorNullClause();
             nullClause = (SqlJsonConstructorNullClause) ((SqlLiteral) e).getValue();
     } else {
@@ -8277,14 +8576,14 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(JSON_ARRAY);
                    span = span();
     jj_consume_token(LPAREN);
-    if (jj_2_843(2)) {
+    if (jj_2_892(2)) {
       AddExpression(elements, ExprContext.ACCEPT_NON_QUERY);
-      label_65:
+      label_66:
       while (true) {
-        if (jj_2_842(2)) {
+        if (jj_2_891(2)) {
           ;
         } else {
-          break label_65;
+          break label_66;
         }
         jj_consume_token(COMMA);
         AddExpression(elements, ExprContext.ACCEPT_NON_QUERY);
@@ -8292,7 +8591,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     } else {
       ;
     }
-    if (jj_2_844(2)) {
+    if (jj_2_893(2)) {
       e = JsonConstructorNullClause();
             otherArgs[0] = e;
     } else {
@@ -8325,12 +8624,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(LPAREN);
     e = Expression(ExprContext.ACCEPT_NON_QUERY);
         valueExpr = e;
-    if (jj_2_845(2)) {
+    if (jj_2_894(2)) {
       orderList = JsonArrayAggOrderByClause();
     } else {
                                                   orderList = null;
     }
-    if (jj_2_846(2)) {
+    if (jj_2_895(2)) {
       e = JsonConstructorNullClause();
             nullClause = (SqlJsonConstructorNullClause) ((SqlLiteral) e).getValue();
     } else {
@@ -8339,7 +8638,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(RPAREN);
         aggCall = SqlStdOperatorTable.JSON_ARRAYAGG.with(nullClause)
             .createCall(span.end(this), valueExpr, orderList);
-    if (jj_2_847(2)) {
+    if (jj_2_896(2)) {
       e = withinGroup(aggCall);
             if (orderList != null) {
                 {if (true) throw SqlUtil.newContextException(span.pos().plus(e.getParserPosition()),
@@ -8358,6 +8657,37 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     throw new Error("Missing return statement in function");
   }
 
+ /**
+ * Parses the CONTAINS_SUBSTR function, which has a unique optional third argument "JSON_SCOPE"
+ * that specifies what scope to search if the first argument is a JSON string.
+ */
+  final public SqlCall ContainsSubstrFunctionCall() throws ParseException {
+    final List<SqlNode> args = new ArrayList<SqlNode>();
+    final Span s;
+    SqlNode e;
+    jj_consume_token(CONTAINS_SUBSTR);
+                         s = span();
+    jj_consume_token(LPAREN);
+    AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
+    jj_consume_token(COMMA);
+    AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
+    if (jj_2_897(2)) {
+      jj_consume_token(RPAREN);
+    } else if (jj_2_898(2)) {
+      jj_consume_token(COMMA);
+      jj_consume_token(JSON_SCOPE);
+      jj_consume_token(NAMED_ARGUMENT_ASSIGNMENT);
+      e = Expression(ExprContext.ACCEPT_SUB_QUERY);
+                                                                                    args.add(e);
+      jj_consume_token(RPAREN);
+    } else {
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+         {if (true) return SqlLibraryOperators.CONTAINS_SUBSTR.createCall(s.end(this), args);}
+    throw new Error("Missing return statement in function");
+  }
+
 /**
  * Parses a call to BigQuery's DATE_DIFF.
  */
@@ -8482,10 +8812,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(LPAREN);
     AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
     jj_consume_token(COMMA);
-    if (jj_2_848(2)) {
+    if (jj_2_899(2)) {
       unit = TimeUnit();
                             args.add(unit);
-    } else if (jj_2_849(2)) {
+    } else if (jj_2_900(2)) {
       AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
     } else {
       jj_consume_token(-1);
@@ -8536,6 +8866,26 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     throw new Error("Missing return statement in function");
   }
 
+/**
+ * Parses a call to DATETIME_TRUNC.
+ */
+  final public SqlNode DatetimeTruncFunctionCall() throws ParseException {
+    final List<SqlNode> args = new ArrayList<SqlNode>();
+    final Span s;
+    final SqlIntervalQualifier unit;
+    final SqlNode literal;
+    jj_consume_token(DATETIME_TRUNC);
+                       s = span();
+    jj_consume_token(LPAREN);
+    AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
+    jj_consume_token(COMMA);
+    unit = TimeUnitOrName();
+                              args.add(unit);
+    jj_consume_token(RPAREN);
+        {if (true) return SqlLibraryOperators.DATETIME_TRUNC.createCall(s.end(this), args);}
+    throw new Error("Missing return statement in function");
+  }
+
 /**
  * Parses a call to TIME_TRUNC.
  */
@@ -8563,13 +8913,13 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     final List<SqlNode> args;
     final SqlOperator op;
-    if (jj_2_850(2)) {
+    if (jj_2_901(2)) {
       jj_consume_token(TUMBLE);
                    op = SqlStdOperatorTable.TUMBLE_OLD;
-    } else if (jj_2_851(2)) {
+    } else if (jj_2_902(2)) {
       jj_consume_token(HOP);
                 op = SqlStdOperatorTable.HOP_OLD;
-    } else if (jj_2_852(2)) {
+    } else if (jj_2_903(2)) {
       jj_consume_token(SESSION);
                     op = SqlStdOperatorTable.SESSION_OLD;
     } else {
@@ -8585,23 +8935,23 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   final public SqlCall MatchRecognizeFunctionCall() throws ParseException {
     final SqlCall func;
     final Span s;
-    if (jj_2_853(2)) {
+    if (jj_2_904(2)) {
       jj_consume_token(CLASSIFIER);
                        s = span();
       jj_consume_token(LPAREN);
       jj_consume_token(RPAREN);
             func = SqlStdOperatorTable.CLASSIFIER.createCall(s.end(this));
-    } else if (jj_2_854(2)) {
+    } else if (jj_2_905(2)) {
       jj_consume_token(MATCH_NUMBER);
                          s = span();
       jj_consume_token(LPAREN);
       jj_consume_token(RPAREN);
             func = SqlStdOperatorTable.MATCH_NUMBER.createCall(s.end(this));
-    } else if (jj_2_855(3)) {
+    } else if (jj_2_906(3)) {
       func = MatchRecognizeNavigationLogical();
-    } else if (jj_2_856(2)) {
+    } else if (jj_2_907(2)) {
       func = MatchRecognizeNavigationPhysical();
-    } else if (jj_2_857(2)) {
+    } else if (jj_2_908(2)) {
       func = MatchRecognizeCallWithModifier();
     } else {
       jj_consume_token(-1);
@@ -8615,10 +8965,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     final SqlOperator runningOp;
     final SqlNode func;
-    if (jj_2_858(2)) {
+    if (jj_2_909(2)) {
       jj_consume_token(RUNNING);
                     runningOp = SqlStdOperatorTable.RUNNING;
-    } else if (jj_2_859(2)) {
+    } else if (jj_2_910(2)) {
       jj_consume_token(FINAL);
                   runningOp = SqlStdOperatorTable.FINAL;
     } else {
@@ -8638,19 +8988,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlOperator runningOp;
     final List<SqlNode> args = new ArrayList<SqlNode>();
     SqlNode e;
-    if (jj_2_860(2)) {
+    if (jj_2_911(2)) {
       jj_consume_token(RUNNING);
                     runningOp = SqlStdOperatorTable.RUNNING; s.add(this);
-    } else if (jj_2_861(2)) {
+    } else if (jj_2_912(2)) {
       jj_consume_token(FINAL);
                   runningOp = SqlStdOperatorTable.FINAL; s.add(this);
     } else {
           runningOp = null;
     }
-    if (jj_2_862(2)) {
+    if (jj_2_913(2)) {
       jj_consume_token(FIRST);
                   funcOp = SqlStdOperatorTable.FIRST;
-    } else if (jj_2_863(2)) {
+    } else if (jj_2_914(2)) {
       jj_consume_token(LAST);
                  funcOp = SqlStdOperatorTable.LAST;
     } else {
@@ -8660,7 +9010,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       s.add(this);
     jj_consume_token(LPAREN);
     AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
-    if (jj_2_864(2)) {
+    if (jj_2_915(2)) {
       jj_consume_token(COMMA);
       e = NumericLiteral();
                                        args.add(e);
@@ -8682,10 +9032,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlOperator funcOp;
     final List<SqlNode> args = new ArrayList<SqlNode>();
     SqlNode e;
-    if (jj_2_865(2)) {
+    if (jj_2_916(2)) {
       jj_consume_token(PREV);
                  funcOp = SqlStdOperatorTable.PREV;
-    } else if (jj_2_866(2)) {
+    } else if (jj_2_917(2)) {
       jj_consume_token(NEXT);
                  funcOp = SqlStdOperatorTable.NEXT;
     } else {
@@ -8695,7 +9045,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       s = span();
     jj_consume_token(LPAREN);
     AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
-    if (jj_2_867(2)) {
+    if (jj_2_918(2)) {
       jj_consume_token(COMMA);
       e = NumericLiteral();
                                        args.add(e);
@@ -8737,12 +9087,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
   final public Pair<SqlParserPos, SqlOperator> NullTreatment() throws ParseException {
     final Span span;
-    if (jj_2_868(2)) {
+    if (jj_2_919(2)) {
       jj_consume_token(IGNORE);
                span = span();
       jj_consume_token(NULLS);
         {if (true) return Pair.of(span.end(this), SqlStdOperatorTable.IGNORE_NULLS);}
-    } else if (jj_2_869(2)) {
+    } else if (jj_2_920(2)) {
       jj_consume_token(RESPECT);
                 span = span();
       jj_consume_token(NULLS);
@@ -8782,31 +9132,41 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final SqlNode filter;
     final Span overSpan;
     final SqlNode over;
-    if (jj_2_870(2)) {
+    if (jj_2_921(2)) {
       call = StringAggFunctionCall();
-    } else if (jj_2_871(2)) {
-      call = NamedCall();
     } else {
-      jj_consume_token(-1);
-      throw new ParseException();
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case PERCENTILE_CONT:
+      case PERCENTILE_DISC:
+        call = PercentileFunctionCall();
+        break;
+      default:
+        jj_la1[7] = jj_gen;
+        if (jj_2_922(2)) {
+          call = NamedCall();
+        } else {
+          jj_consume_token(-1);
+          throw new ParseException();
+        }
+      }
     }
-    if (jj_2_872(2)) {
+    if (jj_2_923(2)) {
       call = nullTreatment(call);
     } else {
       ;
     }
-    if (jj_2_873(2)) {
+    if (jj_2_924(2)) {
       // decide between WITHIN DISTINCT and WITHIN GROUP
               call = withinDistinct(call);
     } else {
       ;
     }
-    if (jj_2_874(2)) {
+    if (jj_2_925(2)) {
       call = withinGroup(call);
     } else {
       ;
     }
-    if (jj_2_875(2)) {
+    if (jj_2_926(2)) {
       jj_consume_token(FILTER);
                    filterSpan = span();
       jj_consume_token(LPAREN);
@@ -8818,12 +9178,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     } else {
       ;
     }
-    if (jj_2_878(2)) {
+    if (jj_2_929(2)) {
       jj_consume_token(OVER);
                  overSpan = span();
-      if (jj_2_876(2)) {
+      if (jj_2_927(2)) {
         over = SimpleIdentifier();
-      } else if (jj_2_877(2)) {
+      } else if (jj_2_928(2)) {
         over = WindowSpecification();
       } else {
         jj_consume_token(-1);
@@ -8843,7 +9203,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s;
     final List<SqlNode> args;
     SqlLiteral quantifier = null;
-    if (jj_2_879(2)) {
+    if (jj_2_930(2)) {
       jj_consume_token(SPECIFIC);
             funcType = SqlFunctionCategory.USER_DEFINED_SPECIFIC_FUNCTION;
     } else {
@@ -8851,16 +9211,16 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     }
     qualifiedName = FunctionName();
         s = span();
-    if (jj_2_880(2)) {
+    if (jj_2_931(2)) {
       jj_consume_token(LPAREN);
       jj_consume_token(STAR);
             args = ImmutableList.of(SqlIdentifier.star(getPos()));
       jj_consume_token(RPAREN);
-    } else if (jj_2_881(2)) {
+    } else if (jj_2_932(2)) {
       jj_consume_token(LPAREN);
       jj_consume_token(RPAREN);
             args = ImmutableList.of();
-    } else if (jj_2_882(2)) {
+    } else if (jj_2_933(2)) {
       args = FunctionParameterList(ExprContext.ACCEPT_SUB_QUERY);
             quantifier = (SqlLiteral) args.get(0);
             args.remove(0);
@@ -8883,7 +9243,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     final Span s1;
     jj_consume_token(LPAREN);
     AddExpression(args, ExprContext.ACCEPT_SUB_QUERY);
-    if (jj_2_883(2)) {
+    if (jj_2_934(2)) {
       jj_consume_token(TO);
       unit = TimeUnitOrName();
             args.add(unit);
@@ -8891,16 +9251,14 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
       ;
     }
     jj_consume_token(RPAREN);
-        SqlOperator op = floorFlag
-            ? SqlStdOperatorTable.FLOOR
-            : SqlStdOperatorTable.CEIL;
+        SqlOperator op = SqlStdOperatorTable.floorCeil(floorFlag, this.conformance);
         function =  op.createCall(s.end(this), args);
-    if (jj_2_886(2)) {
+    if (jj_2_937(2)) {
       jj_consume_token(OVER);
                  s1 = span();
-      if (jj_2_884(2)) {
+      if (jj_2_935(2)) {
         e = SimpleIdentifier();
-      } else if (jj_2_885(2)) {
+      } else if (jj_2_936(2)) {
         e = WindowSpecification();
       } else {
         jj_consume_token(-1);
@@ -8928,9 +9286,9 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public SqlIdentifier FunctionName() throws ParseException {
     SqlIdentifier qualifiedName;
-    if (jj_2_887(2)) {
+    if (jj_2_938(2)) {
       qualifiedName = CompoundIdentifier();
-    } else if (jj_2_888(2)) {
+    } else if (jj_2_939(2)) {
       qualifiedName = ReservedFunctionName();
     } else {
       jj_consume_token(-1);
@@ -8944,135 +9302,135 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * Parses a reserved word which is used as the name of a function.
  */
   final public SqlIdentifier ReservedFunctionName() throws ParseException {
-    if (jj_2_889(2)) {
+    if (jj_2_940(2)) {
       jj_consume_token(ABS);
-    } else if (jj_2_890(2)) {
+    } else if (jj_2_941(2)) {
       jj_consume_token(AVG);
-    } else if (jj_2_891(2)) {
+    } else if (jj_2_942(2)) {
       jj_consume_token(CARDINALITY);
-    } else if (jj_2_892(2)) {
+    } else if (jj_2_943(2)) {
       jj_consume_token(CEILING);
-    } else if (jj_2_893(2)) {
+    } else if (jj_2_944(2)) {
       jj_consume_token(CHAR);
-    } else if (jj_2_894(2)) {
+    } else if (jj_2_945(2)) {
       jj_consume_token(CHAR_LENGTH);
-    } else if (jj_2_895(2)) {
+    } else if (jj_2_946(2)) {
       jj_consume_token(CHARACTER_LENGTH);
-    } else if (jj_2_896(2)) {
+    } else if (jj_2_947(2)) {
       jj_consume_token(COALESCE);
-    } else if (jj_2_897(2)) {
+    } else if (jj_2_948(2)) {
       jj_consume_token(COLLECT);
-    } else if (jj_2_898(2)) {
+    } else if (jj_2_949(2)) {
       jj_consume_token(COVAR_POP);
-    } else if (jj_2_899(2)) {
+    } else if (jj_2_950(2)) {
       jj_consume_token(COVAR_SAMP);
-    } else if (jj_2_900(2)) {
+    } else if (jj_2_951(2)) {
       jj_consume_token(CUME_DIST);
-    } else if (jj_2_901(2)) {
+    } else if (jj_2_952(2)) {
       jj_consume_token(COUNT);
-    } else if (jj_2_902(2)) {
+    } else if (jj_2_953(2)) {
       jj_consume_token(CURRENT_DATE);
-    } else if (jj_2_903(2)) {
+    } else if (jj_2_954(2)) {
       jj_consume_token(CURRENT_TIME);
-    } else if (jj_2_904(2)) {
+    } else if (jj_2_955(2)) {
       jj_consume_token(CURRENT_TIMESTAMP);
-    } else if (jj_2_905(2)) {
+    } else if (jj_2_956(2)) {
       jj_consume_token(DENSE_RANK);
-    } else if (jj_2_906(2)) {
+    } else if (jj_2_957(2)) {
       jj_consume_token(ELEMENT);
-    } else if (jj_2_907(2)) {
+    } else if (jj_2_958(2)) {
       jj_consume_token(EVERY);
-    } else if (jj_2_908(2)) {
+    } else if (jj_2_959(2)) {
       jj_consume_token(EXP);
-    } else if (jj_2_909(2)) {
+    } else if (jj_2_960(2)) {
       jj_consume_token(FIRST_VALUE);
-    } else if (jj_2_910(2)) {
+    } else if (jj_2_961(2)) {
       jj_consume_token(FLOOR);
-    } else if (jj_2_911(2)) {
+    } else if (jj_2_962(2)) {
       jj_consume_token(FUSION);
-    } else if (jj_2_912(2)) {
+    } else if (jj_2_963(2)) {
       jj_consume_token(INTERSECTION);
-    } else if (jj_2_913(2)) {
+    } else if (jj_2_964(2)) {
       jj_consume_token(GROUPING);
-    } else if (jj_2_914(2)) {
+    } else if (jj_2_965(2)) {
       jj_consume_token(HOUR);
-    } else if (jj_2_915(2)) {
+    } else if (jj_2_966(2)) {
       jj_consume_token(LAG);
-    } else if (jj_2_916(2)) {
+    } else if (jj_2_967(2)) {
       jj_consume_token(LEAD);
-    } else if (jj_2_917(2)) {
+    } else if (jj_2_968(2)) {
       jj_consume_token(LEFT);
-    } else if (jj_2_918(2)) {
+    } else if (jj_2_969(2)) {
       jj_consume_token(LAST_VALUE);
-    } else if (jj_2_919(2)) {
+    } else if (jj_2_970(2)) {
       jj_consume_token(LN);
-    } else if (jj_2_920(2)) {
+    } else if (jj_2_971(2)) {
       jj_consume_token(LOCALTIME);
-    } else if (jj_2_921(2)) {
+    } else if (jj_2_972(2)) {
       jj_consume_token(LOCALTIMESTAMP);
-    } else if (jj_2_922(2)) {
+    } else if (jj_2_973(2)) {
       jj_consume_token(LOWER);
-    } else if (jj_2_923(2)) {
+    } else if (jj_2_974(2)) {
       jj_consume_token(MAX);
-    } else if (jj_2_924(2)) {
+    } else if (jj_2_975(2)) {
       jj_consume_token(MIN);
-    } else if (jj_2_925(2)) {
+    } else if (jj_2_976(2)) {
       jj_consume_token(MINUTE);
-    } else if (jj_2_926(2)) {
+    } else if (jj_2_977(2)) {
       jj_consume_token(MOD);
-    } else if (jj_2_927(2)) {
+    } else if (jj_2_978(2)) {
       jj_consume_token(MONTH);
-    } else if (jj_2_928(2)) {
+    } else if (jj_2_979(2)) {
       jj_consume_token(NTH_VALUE);
-    } else if (jj_2_929(2)) {
+    } else if (jj_2_980(2)) {
       jj_consume_token(NTILE);
-    } else if (jj_2_930(2)) {
+    } else if (jj_2_981(2)) {
       jj_consume_token(NULLIF);
-    } else if (jj_2_931(2)) {
+    } else if (jj_2_982(2)) {
       jj_consume_token(OCTET_LENGTH);
-    } else if (jj_2_932(2)) {
-      jj_consume_token(PERCENT_RANK);
-    } else if (jj_2_933(2)) {
+    } else if (jj_2_983(2)) {
       jj_consume_token(PERCENTILE_CONT);
-    } else if (jj_2_934(2)) {
+    } else if (jj_2_984(2)) {
       jj_consume_token(PERCENTILE_DISC);
-    } else if (jj_2_935(2)) {
+    } else if (jj_2_985(2)) {
+      jj_consume_token(PERCENT_RANK);
+    } else if (jj_2_986(2)) {
       jj_consume_token(POWER);
-    } else if (jj_2_936(2)) {
+    } else if (jj_2_987(2)) {
       jj_consume_token(RANK);
-    } else if (jj_2_937(2)) {
+    } else if (jj_2_988(2)) {
       jj_consume_token(REGR_COUNT);
-    } else if (jj_2_938(2)) {
+    } else if (jj_2_989(2)) {
       jj_consume_token(REGR_SXX);
-    } else if (jj_2_939(2)) {
+    } else if (jj_2_990(2)) {
       jj_consume_token(REGR_SYY);
-    } else if (jj_2_940(2)) {
+    } else if (jj_2_991(2)) {
       jj_consume_token(RIGHT);
-    } else if (jj_2_941(2)) {
+    } else if (jj_2_992(2)) {
       jj_consume_token(ROW_NUMBER);
-    } else if (jj_2_942(2)) {
+    } else if (jj_2_993(2)) {
       jj_consume_token(SECOND);
-    } else if (jj_2_943(2)) {
+    } else if (jj_2_994(2)) {
       jj_consume_token(SOME);
-    } else if (jj_2_944(2)) {
+    } else if (jj_2_995(2)) {
       jj_consume_token(SQRT);
-    } else if (jj_2_945(2)) {
+    } else if (jj_2_996(2)) {
       jj_consume_token(STDDEV_POP);
-    } else if (jj_2_946(2)) {
+    } else if (jj_2_997(2)) {
       jj_consume_token(STDDEV_SAMP);
-    } else if (jj_2_947(2)) {
+    } else if (jj_2_998(2)) {
       jj_consume_token(SUM);
-    } else if (jj_2_948(2)) {
+    } else if (jj_2_999(2)) {
       jj_consume_token(UPPER);
-    } else if (jj_2_949(2)) {
+    } else if (jj_2_1000(2)) {
       jj_consume_token(TRUNCATE);
-    } else if (jj_2_950(2)) {
+    } else if (jj_2_1001(2)) {
       jj_consume_token(USER);
-    } else if (jj_2_951(2)) {
+    } else if (jj_2_1002(2)) {
       jj_consume_token(VAR_POP);
-    } else if (jj_2_952(2)) {
+    } else if (jj_2_1003(2)) {
       jj_consume_token(VAR_SAMP);
-    } else if (jj_2_953(2)) {
+    } else if (jj_2_1004(2)) {
       jj_consume_token(YEAR);
     } else {
       jj_consume_token(-1);
@@ -9083,33 +9441,33 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
   }
 
   final public SqlIdentifier ContextVariable() throws ParseException {
-    if (jj_2_954(2)) {
+    if (jj_2_1005(2)) {
       jj_consume_token(CURRENT_CATALOG);
-    } else if (jj_2_955(2)) {
+    } else if (jj_2_1006(2)) {
       jj_consume_token(CURRENT_DATE);
-    } else if (jj_2_956(2)) {
+    } else if (jj_2_1007(2)) {
       jj_consume_token(CURRENT_DEFAULT_TRANSFORM_GROUP);
-    } else if (jj_2_957(2)) {
+    } else if (jj_2_1008(2)) {
       jj_consume_token(CURRENT_PATH);
-    } else if (jj_2_958(2)) {
+    } else if (jj_2_1009(2)) {
       jj_consume_token(CURRENT_ROLE);
-    } else if (jj_2_959(2)) {
+    } else if (jj_2_1010(2)) {
       jj_consume_token(CURRENT_SCHEMA);
-    } else if (jj_2_960(2)) {
+    } else if (jj_2_1011(2)) {
       jj_consume_token(CURRENT_TIME);
-    } else if (jj_2_961(2)) {
+    } else if (jj_2_1012(2)) {
       jj_consume_token(CURRENT_TIMESTAMP);
-    } else if (jj_2_962(2)) {
+    } else if (jj_2_1013(2)) {
       jj_consume_token(CURRENT_USER);
-    } else if (jj_2_963(2)) {
+    } else if (jj_2_1014(2)) {
       jj_consume_token(LOCALTIME);
-    } else if (jj_2_964(2)) {
+    } else if (jj_2_1015(2)) {
       jj_consume_token(LOCALTIMESTAMP);
-    } else if (jj_2_965(2)) {
+    } else if (jj_2_1016(2)) {
       jj_consume_token(SESSION_USER);
-    } else if (jj_2_966(2)) {
+    } else if (jj_2_1017(2)) {
       jj_consume_token(SYSTEM_USER);
-    } else if (jj_2_967(2)) {
+    } else if (jj_2_1018(2)) {
       jj_consume_token(USER);
     } else {
       jj_consume_token(-1);
@@ -9133,6 +9491,11 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
     jj_consume_token(LBRACE_FN);
         s = span();
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case CONTAINS_SUBSTR:
+      call = ContainsSubstrFunctionCall();
+            name = call.getOperator().getName();
+            args = new SqlNodeList(call.getOperandList(), getPos());
+      break;
     case DATE_DIFF:
       call = DateDiffFunctionCall();
             name = call.getOperator().getName();
@@ -9174,12 +9537,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
             args = new SqlNodeList(call.getOperandList(), getPos());
       break;
     default:
-      jj_la1[10] = jj_gen;
-      if (jj_2_978(3)) {
+      jj_la1[9] = jj_gen;
+      if (jj_2_1029(3)) {
         call = TimestampDiffFunctionCall();
             name = call.getOperator().getName();
             args = new SqlNodeList(call.getOperandList(), getPos());
-      } else if (jj_2_979(2)) {
+      } else if (jj_2_1030(2)) {
         jj_consume_token(CONVERT);
                     name = unquotedIdentifier();
         jj_consume_token(LPAREN);
@@ -9190,19 +9553,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         tl = JdbcOdbcDataType();
                                   args.add(tl);
         jj_consume_token(RPAREN);
-      } else if (jj_2_980(2)) {
+      } else if (jj_2_1031(2)) {
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
         case INSERT:
         case LEFT:
         case RIGHT:
         case TRUNCATE:
-          if (jj_2_968(2)) {
+          if (jj_2_1019(2)) {
             jj_consume_token(INSERT);
-          } else if (jj_2_969(2)) {
+          } else if (jj_2_1020(2)) {
             jj_consume_token(LEFT);
-          } else if (jj_2_970(2)) {
+          } else if (jj_2_1021(2)) {
             jj_consume_token(RIGHT);
-          } else if (jj_2_971(2)) {
+          } else if (jj_2_1022(2)) {
             jj_consume_token(TRUNCATE);
           } else {
             jj_consume_token(-1);
@@ -9211,33 +9574,33 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
                                                            name = unquotedIdentifier();
           break;
         default:
-          jj_la1[9] = jj_gen;
-          if (jj_2_972(2)) {
+          jj_la1[8] = jj_gen;
+          if (jj_2_1023(2)) {
             // For cases like {fn power(1,2)} and {fn lower('a')}
                         id = ReservedFunctionName();
                                           name = id.getSimple();
-          } else if (jj_2_973(2)) {
+          } else if (jj_2_1024(2)) {
             // For cases like {fn substring('foo', 1,2)}
                         name = NonReservedJdbcFunctionName();
-          } else if (jj_2_974(2)) {
+          } else if (jj_2_1025(2)) {
             name = Identifier();
           } else {
             jj_consume_token(-1);
             throw new ParseException();
           }
         }
-        if (jj_2_975(2)) {
+        if (jj_2_1026(2)) {
           jj_consume_token(LPAREN);
           jj_consume_token(STAR);
                                            s1 = span();
           jj_consume_token(RPAREN);
                 args = new SqlNodeList(s1.pos());
                 args.add(SqlIdentifier.star(s1.pos()));
-        } else if (jj_2_976(2)) {
+        } else if (jj_2_1027(2)) {
           jj_consume_token(LPAREN);
           jj_consume_token(RPAREN);
                                              args = SqlNodeList.EMPTY;
-        } else if (jj_2_977(2)) {
+        } else if (jj_2_1028(2)) {
           args = ParenthesizedQueryOrCommaList(ExprContext.ACCEPT_SUB_QUERY);
         } else {
           jj_consume_token(-1);
@@ -9258,32 +9621,32 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * Parses a binary query operator like UNION.
  */
   final public SqlBinaryOperator BinaryQueryOperator() throws ParseException {
-    if (jj_2_989(2)) {
+    if (jj_2_1040(2)) {
       jj_consume_token(UNION);
-      if (jj_2_981(2)) {
+      if (jj_2_1032(2)) {
         jj_consume_token(ALL);
                     {if (true) return SqlStdOperatorTable.UNION_ALL;}
-      } else if (jj_2_982(2)) {
+      } else if (jj_2_1033(2)) {
         jj_consume_token(DISTINCT);
                          {if (true) return SqlStdOperatorTable.UNION;}
       } else {
               {if (true) return SqlStdOperatorTable.UNION;}
       }
-    } else if (jj_2_990(2)) {
+    } else if (jj_2_1041(2)) {
       jj_consume_token(INTERSECT);
-      if (jj_2_983(2)) {
+      if (jj_2_1034(2)) {
         jj_consume_token(ALL);
                     {if (true) return SqlStdOperatorTable.INTERSECT_ALL;}
-      } else if (jj_2_984(2)) {
+      } else if (jj_2_1035(2)) {
         jj_consume_token(DISTINCT);
                          {if (true) return SqlStdOperatorTable.INTERSECT;}
       } else {
               {if (true) return SqlStdOperatorTable.INTERSECT;}
       }
-    } else if (jj_2_991(2)) {
-      if (jj_2_985(2)) {
+    } else if (jj_2_1042(2)) {
+      if (jj_2_1036(2)) {
         jj_consume_token(EXCEPT);
-      } else if (jj_2_986(2)) {
+      } else if (jj_2_1037(2)) {
         jj_consume_token(SET_MINUS);
                 if (!this.conformance.isMinusAllowed()) {
                     {if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.minusNotAllowed());}
@@ -9292,10 +9655,10 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         jj_consume_token(-1);
         throw new ParseException();
       }
-      if (jj_2_987(2)) {
+      if (jj_2_1038(2)) {
         jj_consume_token(ALL);
                     {if (true) return SqlStdOperatorTable.EXCEPT_ALL;}
-      } else if (jj_2_988(2)) {
+      } else if (jj_2_1039(2)) {
         jj_consume_token(DISTINCT);
                          {if (true) return SqlStdOperatorTable.EXCEPT;}
       } else {
@@ -9313,12 +9676,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public SqlBinaryOperator BinaryMultisetOperator() throws ParseException {
     jj_consume_token(MULTISET);
-    if (jj_2_1001(2)) {
+    if (jj_2_1052(2)) {
       jj_consume_token(UNION);
-      if (jj_2_994(2)) {
-        if (jj_2_992(2)) {
+      if (jj_2_1045(2)) {
+        if (jj_2_1043(2)) {
           jj_consume_token(ALL);
-        } else if (jj_2_993(2)) {
+        } else if (jj_2_1044(2)) {
           jj_consume_token(DISTINCT);
                          {if (true) return SqlStdOperatorTable.MULTISET_UNION_DISTINCT;}
         } else {
@@ -9329,12 +9692,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         ;
       }
           {if (true) return SqlStdOperatorTable.MULTISET_UNION;}
-    } else if (jj_2_1002(2)) {
+    } else if (jj_2_1053(2)) {
       jj_consume_token(INTERSECT);
-      if (jj_2_997(2)) {
-        if (jj_2_995(2)) {
+      if (jj_2_1048(2)) {
+        if (jj_2_1046(2)) {
           jj_consume_token(ALL);
-        } else if (jj_2_996(2)) {
+        } else if (jj_2_1047(2)) {
           jj_consume_token(DISTINCT);
                          {if (true) return SqlStdOperatorTable.MULTISET_INTERSECT_DISTINCT;}
         } else {
@@ -9345,12 +9708,12 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         ;
       }
           {if (true) return SqlStdOperatorTable.MULTISET_INTERSECT;}
-    } else if (jj_2_1003(2)) {
+    } else if (jj_2_1054(2)) {
       jj_consume_token(EXCEPT);
-      if (jj_2_1000(2)) {
-        if (jj_2_998(2)) {
+      if (jj_2_1051(2)) {
+        if (jj_2_1049(2)) {
           jj_consume_token(ALL);
-        } else if (jj_2_999(2)) {
+        } else if (jj_2_1050(2)) {
           jj_consume_token(DISTINCT);
                          {if (true) return SqlStdOperatorTable.MULTISET_EXCEPT_DISTINCT;}
         } else {
@@ -9373,105 +9736,105 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  */
   final public SqlBinaryOperator BinaryRowOperator() throws ParseException {
     SqlBinaryOperator op;
-    if (jj_2_1004(2)) {
+    if (jj_2_1055(2)) {
       jj_consume_token(EQ);
            {if (true) return SqlStdOperatorTable.EQUALS;}
-    } else if (jj_2_1005(2)) {
+    } else if (jj_2_1056(2)) {
       jj_consume_token(GT);
            {if (true) return SqlStdOperatorTable.GREATER_THAN;}
-    } else if (jj_2_1006(2)) {
+    } else if (jj_2_1057(2)) {
       jj_consume_token(LT);
            {if (true) return SqlStdOperatorTable.LESS_THAN;}
-    } else if (jj_2_1007(2)) {
+    } else if (jj_2_1058(2)) {
       jj_consume_token(LE);
            {if (true) return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;}
-    } else if (jj_2_1008(2)) {
+    } else if (jj_2_1059(2)) {
       jj_consume_token(GE);
            {if (true) return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;}
-    } else if (jj_2_1009(2)) {
+    } else if (jj_2_1060(2)) {
       jj_consume_token(NE);
            {if (true) return SqlStdOperatorTable.NOT_EQUALS;}
-    } else if (jj_2_1010(2)) {
+    } else if (jj_2_1061(2)) {
       jj_consume_token(NE2);
         if (!this.conformance.isBangEqualAllowed()) {
             {if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.bangEqualNotAllowed());}
         }
         {if (true) return SqlStdOperatorTable.NOT_EQUALS;}
-    } else if (jj_2_1011(2)) {
+    } else if (jj_2_1062(2)) {
       jj_consume_token(PLUS);
              {if (true) return SqlStdOperatorTable.PLUS;}
-    } else if (jj_2_1012(2)) {
+    } else if (jj_2_1063(2)) {
       jj_consume_token(MINUS);
               {if (true) return SqlStdOperatorTable.MINUS;}
-    } else if (jj_2_1013(2)) {
+    } else if (jj_2_1064(2)) {
       jj_consume_token(STAR);
              {if (true) return SqlStdOperatorTable.MULTIPLY;}
-    } else if (jj_2_1014(2)) {
+    } else if (jj_2_1065(2)) {
       jj_consume_token(SLASH);
               {if (true) return SqlStdOperatorTable.DIVIDE;}
-    } else if (jj_2_1015(2)) {
+    } else if (jj_2_1066(2)) {
       jj_consume_token(PERCENT_REMAINDER);
         if (!this.conformance.isPercentRemainderAllowed()) {
             {if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.percentRemainderNotAllowed());}
         }
         {if (true) return SqlStdOperatorTable.PERCENT_REMAINDER;}
-    } else if (jj_2_1016(2)) {
+    } else if (jj_2_1067(2)) {
       jj_consume_token(CONCAT);
                {if (true) return SqlStdOperatorTable.CONCAT;}
-    } else if (jj_2_1017(2)) {
+    } else if (jj_2_1068(2)) {
       jj_consume_token(AND);
             {if (true) return SqlStdOperatorTable.AND;}
-    } else if (jj_2_1018(2)) {
+    } else if (jj_2_1069(2)) {
       jj_consume_token(OR);
            {if (true) return SqlStdOperatorTable.OR;}
-    } else if (jj_2_1019(2)) {
+    } else if (jj_2_1070(2)) {
       jj_consume_token(IS);
       jj_consume_token(DISTINCT);
       jj_consume_token(FROM);
                                           {if (true) return SqlStdOperatorTable.IS_DISTINCT_FROM;}
-    } else if (jj_2_1020(2)) {
+    } else if (jj_2_1071(2)) {
       jj_consume_token(IS);
       jj_consume_token(NOT);
       jj_consume_token(DISTINCT);
       jj_consume_token(FROM);
                                    {if (true) return SqlStdOperatorTable.IS_NOT_DISTINCT_FROM;}
-    } else if (jj_2_1021(2)) {
+    } else if (jj_2_1072(2)) {
       jj_consume_token(MEMBER);
       jj_consume_token(OF);
                     {if (true) return SqlStdOperatorTable.MEMBER_OF;}
-    } else if (jj_2_1022(2)) {
+    } else if (jj_2_1073(2)) {
       jj_consume_token(SUBMULTISET);
       jj_consume_token(OF);
                                       {if (true) return SqlStdOperatorTable.SUBMULTISET_OF;}
-    } else if (jj_2_1023(2)) {
+    } else if (jj_2_1074(2)) {
       jj_consume_token(NOT);
       jj_consume_token(SUBMULTISET);
       jj_consume_token(OF);
                                {if (true) return SqlStdOperatorTable.NOT_SUBMULTISET_OF;}
-    } else if (jj_2_1024(2)) {
+    } else if (jj_2_1075(2)) {
       jj_consume_token(CONTAINS);
                  {if (true) return SqlStdOperatorTable.CONTAINS;}
-    } else if (jj_2_1025(2)) {
+    } else if (jj_2_1076(2)) {
       jj_consume_token(OVERLAPS);
                  {if (true) return SqlStdOperatorTable.OVERLAPS;}
-    } else if (jj_2_1026(2)) {
+    } else if (jj_2_1077(2)) {
       jj_consume_token(EQUALS);
                {if (true) return SqlStdOperatorTable.PERIOD_EQUALS;}
-    } else if (jj_2_1027(2)) {
+    } else if (jj_2_1078(2)) {
       jj_consume_token(PRECEDES);
                  {if (true) return SqlStdOperatorTable.PRECEDES;}
-    } else if (jj_2_1028(2)) {
+    } else if (jj_2_1079(2)) {
       jj_consume_token(SUCCEEDS);
                  {if (true) return SqlStdOperatorTable.SUCCEEDS;}
-    } else if (jj_2_1029(2)) {
+    } else if (jj_2_1080(2)) {
       jj_consume_token(IMMEDIATELY);
       jj_consume_token(PRECEDES);
                                             {if (true) return SqlStdOperatorTable.IMMEDIATELY_PRECEDES;}
-    } else if (jj_2_1030(2)) {
+    } else if (jj_2_1081(2)) {
       jj_consume_token(IMMEDIATELY);
       jj_consume_token(SUCCEEDS);
                                {if (true) return SqlStdOperatorTable.IMMEDIATELY_SUCCEEDS;}
-    } else if (jj_2_1031(2)) {
+    } else if (jj_2_1082(2)) {
       op = BinaryMultisetOperator();
                                     {if (true) return op;}
     } else {
@@ -9485,19 +9848,19 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * Parses a prefix row operator like NOT.
  */
   final public SqlPrefixOperator PrefixRowOperator() throws ParseException {
-    if (jj_2_1032(2)) {
+    if (jj_2_1083(2)) {
       jj_consume_token(PLUS);
              {if (true) return SqlStdOperatorTable.UNARY_PLUS;}
-    } else if (jj_2_1033(2)) {
+    } else if (jj_2_1084(2)) {
       jj_consume_token(MINUS);
               {if (true) return SqlStdOperatorTable.UNARY_MINUS;}
-    } else if (jj_2_1034(2)) {
+    } else if (jj_2_1085(2)) {
       jj_consume_token(NOT);
             {if (true) return SqlStdOperatorTable.NOT;}
-    } else if (jj_2_1035(2)) {
+    } else if (jj_2_1086(2)) {
       jj_consume_token(EXISTS);
                {if (true) return SqlStdOperatorTable.EXISTS;}
-    } else if (jj_2_1036(2)) {
+    } else if (jj_2_1087(2)) {
       jj_consume_token(UNIQUE);
                {if (true) return SqlStdOperatorTable.UNIQUE;}
     } else {
@@ -9511,89 +9874,89 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * Parses a postfix row operator like IS NOT NULL.
  */
   final public SqlPostfixOperator PostfixRowOperator() throws ParseException {
-    if (jj_2_1061(2)) {
+    if (jj_2_1112(2)) {
       jj_consume_token(IS);
-      if (jj_2_1058(2)) {
+      if (jj_2_1109(2)) {
         jj_consume_token(A);
         jj_consume_token(SET);
                     {if (true) return SqlStdOperatorTable.IS_A_SET;}
-      } else if (jj_2_1059(2)) {
+      } else if (jj_2_1110(2)) {
         jj_consume_token(NOT);
-        if (jj_2_1037(2)) {
+        if (jj_2_1088(2)) {
           jj_consume_token(NULL);
                      {if (true) return SqlStdOperatorTable.IS_NOT_NULL;}
-        } else if (jj_2_1038(2)) {
+        } else if (jj_2_1089(2)) {
           jj_consume_token(TRUE);
                      {if (true) return SqlStdOperatorTable.IS_NOT_TRUE;}
-        } else if (jj_2_1039(2)) {
+        } else if (jj_2_1090(2)) {
           jj_consume_token(FALSE);
                       {if (true) return SqlStdOperatorTable.IS_NOT_FALSE;}
-        } else if (jj_2_1040(2)) {
+        } else if (jj_2_1091(2)) {
           jj_consume_token(UNKNOWN);
                         {if (true) return SqlStdOperatorTable.IS_NOT_UNKNOWN;}
-        } else if (jj_2_1041(2)) {
+        } else if (jj_2_1092(2)) {
           jj_consume_token(A);
           jj_consume_token(SET);
                         {if (true) return SqlStdOperatorTable.IS_NOT_A_SET;}
-        } else if (jj_2_1042(2)) {
+        } else if (jj_2_1093(2)) {
           jj_consume_token(EMPTY);
                       {if (true) return SqlStdOperatorTable.IS_NOT_EMPTY;}
-        } else if (jj_2_1043(2)) {
+        } else if (jj_2_1094(2)) {
           jj_consume_token(JSON);
           jj_consume_token(VALUE);
                                           {if (true) return SqlStdOperatorTable.IS_NOT_JSON_VALUE;}
-        } else if (jj_2_1044(2)) {
+        } else if (jj_2_1095(2)) {
           jj_consume_token(JSON);
           jj_consume_token(OBJECT);
                                            {if (true) return SqlStdOperatorTable.IS_NOT_JSON_OBJECT;}
-        } else if (jj_2_1045(2)) {
+        } else if (jj_2_1096(2)) {
           jj_consume_token(JSON);
           jj_consume_token(ARRAY);
                                           {if (true) return SqlStdOperatorTable.IS_NOT_JSON_ARRAY;}
-        } else if (jj_2_1046(2)) {
+        } else if (jj_2_1097(2)) {
           jj_consume_token(JSON);
           jj_consume_token(SCALAR);
                                            {if (true) return SqlStdOperatorTable.IS_NOT_JSON_SCALAR;}
-        } else if (jj_2_1047(2)) {
+        } else if (jj_2_1098(2)) {
           jj_consume_token(JSON);
                      {if (true) return SqlStdOperatorTable.IS_NOT_JSON_VALUE;}
         } else {
           jj_consume_token(-1);
           throw new ParseException();
         }
-      } else if (jj_2_1060(2)) {
-        if (jj_2_1048(2)) {
+      } else if (jj_2_1111(2)) {
+        if (jj_2_1099(2)) {
           jj_consume_token(NULL);
                      {if (true) return SqlStdOperatorTable.IS_NULL;}
-        } else if (jj_2_1049(2)) {
+        } else if (jj_2_1100(2)) {
           jj_consume_token(TRUE);
                      {if (true) return SqlStdOperatorTable.IS_TRUE;}
-        } else if (jj_2_1050(2)) {
+        } else if (jj_2_1101(2)) {
           jj_consume_token(FALSE);
                       {if (true) return SqlStdOperatorTable.IS_FALSE;}
-        } else if (jj_2_1051(2)) {
+        } else if (jj_2_1102(2)) {
           jj_consume_token(UNKNOWN);
                         {if (true) return SqlStdOperatorTable.IS_UNKNOWN;}
-        } else if (jj_2_1052(2)) {
+        } else if (jj_2_1103(2)) {
           jj_consume_token(EMPTY);
                       {if (true) return SqlStdOperatorTable.IS_EMPTY;}
-        } else if (jj_2_1053(2)) {
+        } else if (jj_2_1104(2)) {
           jj_consume_token(JSON);
           jj_consume_token(VALUE);
                                           {if (true) return SqlStdOperatorTable.IS_JSON_VALUE;}
-        } else if (jj_2_1054(2)) {
+        } else if (jj_2_1105(2)) {
           jj_consume_token(JSON);
           jj_consume_token(OBJECT);
                                            {if (true) return SqlStdOperatorTable.IS_JSON_OBJECT;}
-        } else if (jj_2_1055(2)) {
+        } else if (jj_2_1106(2)) {
           jj_consume_token(JSON);
           jj_consume_token(ARRAY);
                                           {if (true) return SqlStdOperatorTable.IS_JSON_ARRAY;}
-        } else if (jj_2_1056(2)) {
+        } else if (jj_2_1107(2)) {
           jj_consume_token(JSON);
           jj_consume_token(SCALAR);
                                            {if (true) return SqlStdOperatorTable.IS_JSON_SCALAR;}
-        } else if (jj_2_1057(2)) {
+        } else if (jj_2_1108(2)) {
           jj_consume_token(JSON);
                      {if (true) return SqlStdOperatorTable.IS_JSON_VALUE;}
         } else {
@@ -9604,7 +9967,7 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
         jj_consume_token(-1);
         throw new ParseException();
       }
-    } else if (jj_2_1062(2)) {
+    } else if (jj_2_1113(2)) {
       jj_consume_token(FORMAT);
       JsonRepresentation();
             {if (true) return SqlStdOperatorTable.JSON_VALUE_EXPRESSION;}
@@ -9630,11 +9993,11 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
  * @see Glossary#SQL2003 SQL:2003 Part 2 Section 5.2
  */
   final public String NonReservedKeyWord() throws ParseException {
-    if (jj_2_1063(2)) {
+    if (jj_2_1114(2)) {
       NonReservedKeyWord0of3();
-    } else if (jj_2_1064(2)) {
+    } else if (jj_2_1115(2)) {
       NonReservedKeyWord1of3();
-    } else if (jj_2_1065(2)) {
+    } else if (jj_2_1116(2)) {
       NonReservedKeyWord2of3();
     } else {
       jj_consume_token(-1);
@@ -9646,1372 +10009,1392 @@ public class IgniteSqlParserImpl extends SqlAbstractParserImpl implements Ignite
 
 /** @see #NonReservedKeyWord */
   final public void NonReservedKeyWord0of3() throws ParseException {
-    if (jj_2_1066(2)) {
+    if (jj_2_1117(2)) {
       jj_consume_token(A);
-    } else if (jj_2_1067(2)) {
-      jj_consume_token(ACTION);
-    } else if (jj_2_1068(2)) {
-      jj_consume_token(ADMIN);
-    } else if (jj_2_1069(2)) {
-      jj_consume_token(APPLY);
-    } else if (jj_2_1070(2)) {
-      jj_consume_token(ASC);
-    } else if (jj_2_1071(2)) {
-      jj_consume_token(ATTRIBUTE);
-    } else if (jj_2_1072(2)) {
-      jj_consume_token(BERNOULLI);
-    } else if (jj_2_1073(2)) {
-      jj_consume_token(CASCADE);
-    } else if (jj_2_1074(2)) {
-      jj_consume_token(CENTURY);
-    } else if (jj_2_1075(2)) {
-      jj_consume_token(CHARACTERS);
-    } else if (jj_2_1076(2)) {
-      jj_consume_token(CHARACTER_SET_SCHEMA);
-    } else if (jj_2_1077(2)) {
-      jj_consume_token(COLLATION);
-    } else if (jj_2_1078(2)) {
-      jj_consume_token(COLLATION_SCHEMA);
-    } else if (jj_2_1079(2)) {
-      jj_consume_token(COMMAND_FUNCTION_CODE);
-    } else if (jj_2_1080(2)) {
-      jj_consume_token(CONDITION_NUMBER);
-    } else if (jj_2_1081(2)) {
-      jj_consume_token(CONSTRAINT_CATALOG);
-    } else if (jj_2_1082(2)) {
-      jj_consume_token(CONSTRAINT_SCHEMA);
-    } else if (jj_2_1083(2)) {
-      jj_consume_token(CURSOR_NAME);
-    } else if (jj_2_1084(2)) {
-      jj_consume_token(DATE_DIFF);
-    } else if (jj_2_1085(2)) {
-      jj_consume_token(DATETIME_INTERVAL_CODE);
-    } else if (jj_2_1086(2)) {
-      jj_consume_token(DECADE);
-    } else if (jj_2_1087(2)) {
-      jj_consume_token(DEFERRED);
-    } else if (jj_2_1088(2)) {
-      jj_consume_token(DEGREE);
-    } else if (jj_2_1089(2)) {
-      jj_consume_token(DESC);
-    } else if (jj_2_1090(2)) {
-      jj_consume_token(DIAGNOSTICS);
-    } else if (jj_2_1091(2)) {
-      jj_consume_token(DOW);
-    } else if (jj_2_1092(2)) {
-      jj_consume_token(DYNAMIC_FUNCTION);
-    } else if (jj_2_1093(2)) {
-      jj_consume_token(EPOCH);
-    } else if (jj_2_1094(2)) {
-      jj_consume_token(EXCLUDE);
-    } else if (jj_2_1095(2)) {
-      jj_consume_token(FIRST);
-    } else if (jj_2_1096(2)) {
-      jj_consume_token(FORTRAN);
-    } else if (jj_2_1097(2)) {
-      jj_consume_token(G);
-    } else if (jj_2_1098(2)) {
-      jj_consume_token(GEOMETRY);
-    } else if (jj_2_1099(2)) {
-      jj_consume_token(GRANTED);
-    } else if (jj_2_1100(2)) {
-      jj_consume_token(HOP);
-    } else if (jj_2_1101(2)) {
-      jj_consume_token(ILIKE);
-    } else if (jj_2_1102(2)) {
-      jj_consume_token(IMPLEMENTATION);
-    } else if (jj_2_1103(2)) {
-      jj_consume_token(INCREMENT);
-    } else if (jj_2_1104(2)) {
-      jj_consume_token(INSTANCE);
-    } else if (jj_2_1105(2)) {
-      jj_consume_token(ISODOW);
-    } else if (jj_2_1106(2)) {
-      jj_consume_token(JAVA);
-    } else if (jj_2_1107(2)) {
-      jj_consume_token(KEY);
-    } else if (jj_2_1108(2)) {
-      jj_consume_token(LABEL);
-    } else if (jj_2_1109(2)) {
-      jj_consume_token(LEVEL);
-    } else if (jj_2_1110(2)) {
-      jj_consume_token(M);
-    } else if (jj_2_1111(2)) {
-      jj_consume_token(MAXVALUE);
-    } else if (jj_2_1112(2)) {
-      jj_consume_token(MESSAGE_TEXT);
-    } else if (jj_2_1113(2)) {
-      jj_consume_token(MILLISECOND);
-    } else if (jj_2_1114(2)) {
-      jj_consume_token(MONTHS);
-    } else if (jj_2_1115(2)) {
-      jj_consume_token(NAME);
-    } else if (jj_2_1116(2)) {
-      jj_consume_token(NESTING);
-    } else if (jj_2_1117(2)) {
-      jj_consume_token(NULLS);
     } else if (jj_2_1118(2)) {
-      jj_consume_token(OCTETS);
+      jj_consume_token(ACTION);
     } else if (jj_2_1119(2)) {
-      jj_consume_token(ORDERING);
+      jj_consume_token(ADMIN);
     } else if (jj_2_1120(2)) {
-      jj_consume_token(OUTPUT);
+      jj_consume_token(APPLY);
     } else if (jj_2_1121(2)) {
-      jj_consume_token(PARAMETER_MODE);
+      jj_consume_token(ASC);
     } else if (jj_2_1122(2)) {
-      jj_consume_token(PARAMETER_SPECIFIC_CATALOG);
+      jj_consume_token(ATTRIBUTE);
     } else if (jj_2_1123(2)) {
-      jj_consume_token(PARTIAL);
+      jj_consume_token(BERNOULLI);
     } else if (jj_2_1124(2)) {
-      jj_consume_token(PASSTHROUGH);
+      jj_consume_token(CASCADE);
     } else if (jj_2_1125(2)) {
-      jj_consume_token(PIVOT);
+      jj_consume_token(CENTURY);
     } else if (jj_2_1126(2)) {
-      jj_consume_token(PLI);
+      jj_consume_token(CHARACTERS);
     } else if (jj_2_1127(2)) {
-      jj_consume_token(PRIOR);
+      jj_consume_token(CHARACTER_SET_SCHEMA);
     } else if (jj_2_1128(2)) {
-      jj_consume_token(QUARTER);
+      jj_consume_token(COLLATION);
     } else if (jj_2_1129(2)) {
-      jj_consume_token(RELATIVE);
+      jj_consume_token(COLLATION_SCHEMA);
     } else if (jj_2_1130(2)) {
-      jj_consume_token(RESPECT);
+      jj_consume_token(COMMAND_FUNCTION_CODE);
     } else if (jj_2_1131(2)) {
-      jj_consume_token(RETURNED_CARDINALITY);
+      jj_consume_token(CONDITION_NUMBER);
     } else if (jj_2_1132(2)) {
-      jj_consume_token(RETURNED_SQLSTATE);
+      jj_consume_token(CONSTRAINT_CATALOG);
     } else if (jj_2_1133(2)) {
-      jj_consume_token(ROLE);
+      jj_consume_token(CONSTRAINT_SCHEMA);
     } else if (jj_2_1134(2)) {
-      jj_consume_token(ROUTINE_NAME);
+      jj_consume_token(CONTINUE);
     } else if (jj_2_1135(2)) {
-      jj_consume_token(SCALAR);
+      jj_consume_token(DATABASE);
     } else if (jj_2_1136(2)) {
-      jj_consume_token(SCHEMA_NAME);
+      jj_consume_token(DATETIME_DIFF);
     } else if (jj_2_1137(2)) {
-      jj_consume_token(SCOPE_SCHEMA);
+      jj_consume_token(DATETIME_TRUNC);
     } else if (jj_2_1138(2)) {
-      jj_consume_token(SECURITY);
+      jj_consume_token(DAYS);
     } else if (jj_2_1139(2)) {
-      jj_consume_token(SEQUENCE);
+      jj_consume_token(DEFERRABLE);
     } else if (jj_2_1140(2)) {
-      jj_consume_token(SERVER_NAME);
+      jj_consume_token(DEFINER);
     } else if (jj_2_1141(2)) {
-      jj_consume_token(SIMPLE);
+      jj_consume_token(DERIVED);
     } else if (jj_2_1142(2)) {
-      jj_consume_token(SPACE);
+      jj_consume_token(DESCRIPTOR);
     } else if (jj_2_1143(2)) {
-      jj_consume_token(SQL_BINARY);
+      jj_consume_token(DOMAIN);
     } else if (jj_2_1144(2)) {
-      jj_consume_token(SQL_BOOLEAN);
+      jj_consume_token(DOT_FORMAT);
     } else if (jj_2_1145(2)) {
-      jj_consume_token(SQL_DATE);
+      jj_consume_token(ENCODING);
     } else if (jj_2_1146(2)) {
-      jj_consume_token(SQL_FLOAT);
+      jj_consume_token(EXCEPTION);
     } else if (jj_2_1147(2)) {
-      jj_consume_token(SQL_INTERVAL_DAY_TO_HOUR);
+      jj_consume_token(FINAL);
     } else if (jj_2_1148(2)) {
-      jj_consume_token(SQL_INTERVAL_HOUR);
+      jj_consume_token(FORMAT);
     } else if (jj_2_1149(2)) {
-      jj_consume_token(SQL_INTERVAL_MINUTE);
+      jj_consume_token(FRAC_SECOND);
     } else if (jj_2_1150(2)) {
-      jj_consume_token(SQL_INTERVAL_SECOND);
+      jj_consume_token(GENERATED);
     } else if (jj_2_1151(2)) {
-      jj_consume_token(SQL_LONGVARBINARY);
+      jj_consume_token(GOTO);
     } else if (jj_2_1152(2)) {
-      jj_consume_token(SQL_NCHAR);
+      jj_consume_token(HIERARCHY);
     } else if (jj_2_1153(2)) {
-      jj_consume_token(SQL_NVARCHAR);
+      jj_consume_token(IGNORE);
     } else if (jj_2_1154(2)) {
-      jj_consume_token(SQL_TIME);
+      jj_consume_token(IMMEDIATELY);
     } else if (jj_2_1155(2)) {
-      jj_consume_token(SQL_TSI_DAY);
+      jj_consume_token(INCLUDING);
     } else if (jj_2_1156(2)) {
-      jj_consume_token(SQL_TSI_MICROSECOND);
+      jj_consume_token(INPUT);
     } else if (jj_2_1157(2)) {
-      jj_consume_token(SQL_TSI_QUARTER);
+      jj_consume_token(INVOKER);
     } else if (jj_2_1158(2)) {
-      jj_consume_token(SQL_TSI_YEAR);
+      jj_consume_token(ISOYEAR);
     } else if (jj_2_1159(2)) {
-      jj_consume_token(STATE);
+      jj_consume_token(K);
     } else if (jj_2_1160(2)) {
-      jj_consume_token(STRUCTURE);
+      jj_consume_token(KEY_TYPE);
     } else if (jj_2_1161(2)) {
-      jj_consume_token(SUBSTITUTE);
+      jj_consume_token(LENGTH);
     } else if (jj_2_1162(2)) {
-      jj_consume_token(TIES);
+      jj_consume_token(LOCATOR);
     } else if (jj_2_1163(2)) {
-      jj_consume_token(TIMESTAMPADD);
+      jj_consume_token(MATCHED);
     } else if (jj_2_1164(2)) {
-      jj_consume_token(TIMESTAMP_TRUNC);
+      jj_consume_token(MESSAGE_OCTET_LENGTH);
     } else if (jj_2_1165(2)) {
-      jj_consume_token(TRANSACTIONS_ACTIVE);
+      jj_consume_token(MILLENNIUM);
     } else if (jj_2_1166(2)) {
-      jj_consume_token(TRANSFORM);
+      jj_consume_token(MINVALUE);
     } else if (jj_2_1167(2)) {
-      jj_consume_token(TRIGGER_NAME);
+      jj_consume_token(MUMPS);
     } else if (jj_2_1168(2)) {
-      jj_consume_token(TYPE);
+      jj_consume_token(NANOSECOND);
     } else if (jj_2_1169(2)) {
-      jj_consume_token(UNCONDITIONAL);
+      jj_consume_token(NULLABLE);
     } else if (jj_2_1170(2)) {
-      jj_consume_token(UNNAMED);
+      jj_consume_token(OBJECT);
     } else if (jj_2_1171(2)) {
-      jj_consume_token(USER_DEFINED_TYPE_CODE);
+      jj_consume_token(OPTIONS);
     } else if (jj_2_1172(2)) {
-      jj_consume_token(UTF16);
+      jj_consume_token(OTHERS);
     } else if (jj_2_1173(2)) {
-      jj_consume_token(VERSION);
+      jj_consume_token(PAD);
     } else if (jj_2_1174(2)) {
-      jj_consume_token(WEEKS);
+      jj_consume_token(PARAMETER_ORDINAL_POSITION);
     } else if (jj_2_1175(2)) {
-      jj_consume_token(WRITE);
+      jj_consume_token(PARAMETER_SPECIFIC_SCHEMA);
     } else if (jj_2_1176(2)) {
-      jj_consume_token(ZONE);
+      jj_consume_token(PASSING);
     } else if (jj_2_1177(2)) {
-      jj_consume_token(AFFINITY_KEY);
+      jj_consume_token(PATH);
     } else if (jj_2_1178(2)) {
-      jj_consume_token(CACHE_GROUP);
+      jj_consume_token(PLAN);
     } else if (jj_2_1179(2)) {
-      jj_consume_token(VALUE_TYPE);
+      jj_consume_token(PRESERVE);
     } else if (jj_2_1180(2)) {
-      jj_consume_token(INLINE_SIZE);
+      jj_consume_token(PUBLIC);
     } else if (jj_2_1181(2)) {
-      jj_consume_token(PASSWORD);
+      jj_consume_token(READ);
     } else if (jj_2_1182(2)) {
-      jj_consume_token(CONTINUOUS);
+      jj_consume_token(REPLACE);
     } else if (jj_2_1183(2)) {
-      jj_consume_token(ASYNC);
+      jj_consume_token(RESTRICT);
     } else if (jj_2_1184(2)) {
-      jj_consume_token(REFRESH);
+      jj_consume_token(RETURNED_OCTET_LENGTH);
     } else if (jj_2_1185(2)) {
-      jj_consume_token(TOTAL);
+      jj_consume_token(RLIKE);
     } else if (jj_2_1186(2)) {
-      jj_consume_token(ALLOW);
+      jj_consume_token(ROUTINE_CATALOG);
     } else if (jj_2_1187(2)) {
-      jj_consume_token(ASENSITIVE);
+      jj_consume_token(ROW_COUNT);
     } else if (jj_2_1188(2)) {
-      jj_consume_token(AUTHORIZATION);
+      jj_consume_token(SCHEMA);
     } else if (jj_2_1189(2)) {
-      jj_consume_token(BEGIN_FRAME);
+      jj_consume_token(SCOPE_NAME);
     } else if (jj_2_1190(2)) {
-      jj_consume_token(BINARY);
+      jj_consume_token(SECTION);
     } else if (jj_2_1191(2)) {
-      jj_consume_token(BOOLEAN);
+      jj_consume_token(SEPARATOR);
     } else if (jj_2_1192(2)) {
-      jj_consume_token(CARDINALITY);
+      jj_consume_token(SERVER);
     } else if (jj_2_1193(2)) {
-      jj_consume_token(CEILING);
+      jj_consume_token(SETS);
     } else if (jj_2_1194(2)) {
-      jj_consume_token(CHARACTER_LENGTH);
+      jj_consume_token(SOURCE);
     } else if (jj_2_1195(2)) {
-      jj_consume_token(CLASSIFIER);
+      jj_consume_token(SQL_BIGINT);
     } else if (jj_2_1196(2)) {
-      jj_consume_token(COALESCE);
+      jj_consume_token(SQL_BLOB);
     } else if (jj_2_1197(2)) {
-      jj_consume_token(COMMIT);
+      jj_consume_token(SQL_CLOB);
     } else if (jj_2_1198(2)) {
-      jj_consume_token(CONTAINS);
+      jj_consume_token(SQL_DOUBLE);
     } else if (jj_2_1199(2)) {
-      jj_consume_token(CORRESPONDING);
+      jj_consume_token(SQL_INTERVAL_DAY);
     } else if (jj_2_1200(2)) {
-      jj_consume_token(COVAR_SAMP);
+      jj_consume_token(SQL_INTERVAL_DAY_TO_SECOND);
     } else if (jj_2_1201(2)) {
-      jj_consume_token(CURRENT);
+      jj_consume_token(SQL_INTERVAL_HOUR_TO_SECOND);
     } else if (jj_2_1202(2)) {
-      jj_consume_token(CURRENT_PATH);
+      jj_consume_token(SQL_INTERVAL_MONTH);
     } else if (jj_2_1203(2)) {
-      jj_consume_token(CURRENT_TRANSFORM_GROUP_FOR_TYPE);
+      jj_consume_token(SQL_INTERVAL_YEAR_TO_MONTH);
     } else if (jj_2_1204(2)) {
-      jj_consume_token(DATE);
+      jj_consume_token(SQL_LONGVARNCHAR);
     } else if (jj_2_1205(2)) {
-      jj_consume_token(DEALLOCATE);
+      jj_consume_token(SQL_NUMERIC);
     } else if (jj_2_1206(2)) {
-      jj_consume_token(DECLARE);
+      jj_consume_token(SQL_SMALLINT);
     } else if (jj_2_1207(2)) {
-      jj_consume_token(DEREF);
+      jj_consume_token(SQL_TINYINT);
     } else if (jj_2_1208(2)) {
-      jj_consume_token(DISALLOW);
+      jj_consume_token(SQL_TSI_HOUR);
     } else if (jj_2_1209(2)) {
-      jj_consume_token(DYNAMIC);
+      jj_consume_token(SQL_TSI_MONTH);
     } else if (jj_2_1210(2)) {
-      jj_consume_token(EMPTY);
+      jj_consume_token(SQL_TSI_WEEK);
     } else if (jj_2_1211(2)) {
-      jj_consume_token(END_FRAME);
+      jj_consume_token(SQL_VARCHAR);
     } else if (jj_2_1212(2)) {
-      jj_consume_token(ESCAPE);
+      jj_consume_token(STRING_AGG);
     } else if (jj_2_1213(2)) {
-      jj_consume_token(EXECUTE);
+      jj_consume_token(SUBCLASS_ORIGIN);
     } else if (jj_2_1214(2)) {
-      jj_consume_token(EXTERNAL);
+      jj_consume_token(TEMPORARY);
     } else if (jj_2_1215(2)) {
-      jj_consume_token(FIRST_VALUE);
+      jj_consume_token(TIME_TRUNC);
     } else if (jj_2_1216(2)) {
-      jj_consume_token(FOREIGN);
+      jj_consume_token(TIMESTAMP_DIFF);
     } else if (jj_2_1217(2)) {
-      jj_consume_token(FUNCTION);
+      jj_consume_token(TRANSACTION);
     } else if (jj_2_1218(2)) {
-      jj_consume_token(GLOBAL);
+      jj_consume_token(TRANSACTIONS_ROLLED_BACK);
     } else if (jj_2_1219(2)) {
-      jj_consume_token(GROUPS);
+      jj_consume_token(TRIGGER_CATALOG);
     } else if (jj_2_1220(2)) {
-      jj_consume_token(IDENTITY);
+      jj_consume_token(TUMBLE);
     } else if (jj_2_1221(2)) {
-      jj_consume_token(INITIAL);
+      jj_consume_token(UNCOMMITTED);
     } else if (jj_2_1222(2)) {
-      jj_consume_token(INT);
+      jj_consume_token(UNPIVOT);
     } else if (jj_2_1223(2)) {
-      jj_consume_token(JSON_ARRAY);
+      jj_consume_token(USER_DEFINED_TYPE_CATALOG);
     } else if (jj_2_1224(2)) {
-      jj_consume_token(JSON_OBJECT);
+      jj_consume_token(USER_DEFINED_TYPE_SCHEMA);
     } else if (jj_2_1225(2)) {
-      jj_consume_token(JSON_VALUE);
+      jj_consume_token(UTF8);
     } else if (jj_2_1226(2)) {
-      jj_consume_token(LARGE);
+      jj_consume_token(WEEK);
     } else if (jj_2_1227(2)) {
-      jj_consume_token(LEAD);
+      jj_consume_token(WRAPPER);
     } else if (jj_2_1228(2)) {
-      jj_consume_token(LOCAL);
+      jj_consume_token(YEARS);
     } else if (jj_2_1229(2)) {
-      jj_consume_token(MATCHES);
+      jj_consume_token(BACKUPS);
     } else if (jj_2_1230(2)) {
-      jj_consume_token(MAX);
+      jj_consume_token(WRITE_SYNCHRONIZATION_MODE);
     } else if (jj_2_1231(2)) {
-      jj_consume_token(METHOD);
+      jj_consume_token(DATA_REGION);
     } else if (jj_2_1232(2)) {
-      jj_consume_token(MOD);
+      jj_consume_token(PARALLEL);
     } else if (jj_2_1233(2)) {
-      jj_consume_token(MONTH);
+      jj_consume_token(NOLOGGING);
     } else if (jj_2_1234(2)) {
-      jj_consume_token(NCHAR);
+      jj_consume_token(SCAN);
     } else if (jj_2_1235(2)) {
-      jj_consume_token(NEXT);
+      jj_consume_token(COMPUTE);
     } else if (jj_2_1236(2)) {
-      jj_consume_token(NORMALIZE);
+      jj_consume_token(STATISTICS);
     } else if (jj_2_1237(2)) {
-      jj_consume_token(NULLIF);
+      jj_consume_token(MAX_CHANGED_PARTITION_ROWS_PERCENT);
     } else if (jj_2_1238(2)) {
-      jj_consume_token(OCTET_LENGTH);
+      jj_consume_token(ALLOCATE);
     } else if (jj_2_1239(2)) {
-      jj_consume_token(OMIT);
+      jj_consume_token(ARRAY_MAX_CARDINALITY);
     } else if (jj_2_1240(2)) {
-      jj_consume_token(OPEN);
+      jj_consume_token(ATOMIC);
     } else if (jj_2_1241(2)) {
-      jj_consume_token(OVERLAPS);
+      jj_consume_token(BEGIN);
     } else if (jj_2_1242(2)) {
-      jj_consume_token(PATTERN);
+      jj_consume_token(BIGINT);
     } else if (jj_2_1243(2)) {
-      jj_consume_token(PERCENTILE_CONT);
+      jj_consume_token(BLOB);
     } else if (jj_2_1244(2)) {
-      jj_consume_token(PERIOD);
+      jj_consume_token(CALLED);
     } else if (jj_2_1245(2)) {
-      jj_consume_token(POSITION);
+      jj_consume_token(CEIL);
     } else if (jj_2_1246(2)) {
-      jj_consume_token(PRECEDES);
+      jj_consume_token(CHARACTER);
     } else if (jj_2_1247(2)) {
-      jj_consume_token(PREV);
+      jj_consume_token(CHECK);
     } else if (jj_2_1248(2)) {
-      jj_consume_token(RANGE);
+      jj_consume_token(CLOSE);
     } else if (jj_2_1249(2)) {
-      jj_consume_token(REAL);
+      jj_consume_token(COLLECT);
     } else if (jj_2_1250(2)) {
-      jj_consume_token(REFERENCES);
+      jj_consume_token(CONNECT);
     } else if (jj_2_1251(2)) {
-      jj_consume_token(REGR_AVGY);
+      jj_consume_token(CORR);
     } else if (jj_2_1252(2)) {
-      jj_consume_token(REGR_R2);
+      jj_consume_token(COVAR_POP);
     } else if (jj_2_1253(2)) {
-      jj_consume_token(REGR_SXY);
+      jj_consume_token(CUME_DIST);
     } else if (jj_2_1254(2)) {
-      jj_consume_token(RESET);
+      jj_consume_token(CURRENT_DEFAULT_TRANSFORM_GROUP);
     } else if (jj_2_1255(2)) {
-      jj_consume_token(RETURNS);
+      jj_consume_token(CURRENT_ROW);
     } else if (jj_2_1256(2)) {
-      jj_consume_token(ROLLUP);
+      jj_consume_token(CYCLE);
     } else if (jj_2_1257(2)) {
-      jj_consume_token(RUNNING);
+      jj_consume_token(DAY);
     } else if (jj_2_1258(2)) {
-      jj_consume_token(SCROLL);
+      jj_consume_token(DECIMAL);
     } else if (jj_2_1259(2)) {
-      jj_consume_token(SEEK);
+      jj_consume_token(DENSE_RANK);
     } else if (jj_2_1260(2)) {
-      jj_consume_token(SHOW);
+      jj_consume_token(DETERMINISTIC);
     } else if (jj_2_1261(2)) {
-      jj_consume_token(SMALLINT);
+      jj_consume_token(DOUBLE);
     } else if (jj_2_1262(2)) {
-      jj_consume_token(SQL);
+      jj_consume_token(ELEMENT);
     } else if (jj_2_1263(2)) {
-      jj_consume_token(SQLWARNING);
+      jj_consume_token(END_EXEC);
     } else if (jj_2_1264(2)) {
-      jj_consume_token(STATIC);
+      jj_consume_token(EQUALS);
     } else if (jj_2_1265(2)) {
-      jj_consume_token(STREAM);
+      jj_consume_token(EXEC);
     } else if (jj_2_1266(2)) {
-      jj_consume_token(SUBSTRING);
+      jj_consume_token(EXTEND);
     } else if (jj_2_1267(2)) {
-      jj_consume_token(SUM);
+      jj_consume_token(FILTER);
     } else if (jj_2_1268(2)) {
-      jj_consume_token(SYSTEM_USER);
+      jj_consume_token(FLOOR);
     } else if (jj_2_1269(2)) {
-      jj_consume_token(TIMESTAMP);
+      jj_consume_token(FREE);
     } else if (jj_2_1270(2)) {
-      jj_consume_token(TINYINT);
+      jj_consume_token(GET);
     } else if (jj_2_1271(2)) {
-      jj_consume_token(TRANSLATION);
+      jj_consume_token(GROUPING);
     } else if (jj_2_1272(2)) {
-      jj_consume_token(TRIM);
+      jj_consume_token(HOUR);
     } else if (jj_2_1273(2)) {
-      jj_consume_token(UESCAPE);
+      jj_consume_token(INDICATOR);
     } else if (jj_2_1274(2)) {
-      jj_consume_token(UNNEST);
+      jj_consume_token(INSENSITIVE);
     } else if (jj_2_1275(2)) {
-      jj_consume_token(VALUE);
+      jj_consume_token(INTERSECTION);
     } else if (jj_2_1276(2)) {
-      jj_consume_token(VARCHAR);
+      jj_consume_token(JSON_EXISTS);
     } else if (jj_2_1277(2)) {
-      jj_consume_token(VAR_SAMP);
+      jj_consume_token(JSON_QUERY);
     } else if (jj_2_1278(2)) {
-      jj_consume_token(WIDTH_BUCKET);
+      jj_consume_token(LAG);
     } else if (jj_2_1279(2)) {
-      jj_consume_token(WITHOUT);
+      jj_consume_token(LAST_VALUE);
     } else if (jj_2_1280(2)) {
-      jj_consume_token(TUESDAY);
+      jj_consume_token(LIKE_REGEX);
     } else if (jj_2_1281(2)) {
-      jj_consume_token(FRIDAY);
-    } else {
-      jj_consume_token(-1);
-      throw new ParseException();
-    }
-  }
-
-/** @see #NonReservedKeyWord */
-  final public void NonReservedKeyWord1of3() throws ParseException {
-    if (jj_2_1282(2)) {
-      jj_consume_token(ABSENT);
+      jj_consume_token(LOWER);
+    } else if (jj_2_1282(2)) {
+      jj_consume_token(MATCH_NUMBER);
     } else if (jj_2_1283(2)) {
-      jj_consume_token(ADA);
+      jj_consume_token(MEASURES);
     } else if (jj_2_1284(2)) {
-      jj_consume_token(AFTER);
+      jj_consume_token(MIN);
     } else if (jj_2_1285(2)) {
-      jj_consume_token(ARRAY_AGG);
+      jj_consume_token(MODIFIES);
     } else if (jj_2_1286(2)) {
-      jj_consume_token(ASSERTION);
+      jj_consume_token(MULTISET);
     } else if (jj_2_1287(2)) {
-      jj_consume_token(ATTRIBUTES);
+      jj_consume_token(NCLOB);
     } else if (jj_2_1288(2)) {
-      jj_consume_token(BREADTH);
+      jj_consume_token(NO);
     } else if (jj_2_1289(2)) {
-      jj_consume_token(CATALOG);
+      jj_consume_token(NTH_VALUE);
     } else if (jj_2_1290(2)) {
-      jj_consume_token(CHAIN);
+      jj_consume_token(NUMERIC);
     } else if (jj_2_1291(2)) {
-      jj_consume_token(CHARACTER_SET_CATALOG);
+      jj_consume_token(OF);
     } else if (jj_2_1292(2)) {
-      jj_consume_token(CLASS_ORIGIN);
+      jj_consume_token(ONE);
     } else if (jj_2_1293(2)) {
-      jj_consume_token(COLLATION_CATALOG);
+      jj_consume_token(ORDINAL);
     } else if (jj_2_1294(2)) {
-      jj_consume_token(COLUMN_NAME);
+      jj_consume_token(OVERLAPS);
     } else if (jj_2_1295(2)) {
-      jj_consume_token(COMMITTED);
+      jj_consume_token(PATTERN);
     } else if (jj_2_1296(2)) {
-      jj_consume_token(CONNECTION);
+      jj_consume_token(PERCENTILE_CONT);
     } else if (jj_2_1297(2)) {
-      jj_consume_token(CONSTRAINT_NAME);
+      jj_consume_token(PERIOD);
     } else if (jj_2_1298(2)) {
-      jj_consume_token(CONSTRUCTOR);
+      jj_consume_token(POSITION);
     } else if (jj_2_1299(2)) {
-      jj_consume_token(DATA);
+      jj_consume_token(PRECEDES);
     } else if (jj_2_1300(2)) {
-      jj_consume_token(DATE_TRUNC);
+      jj_consume_token(PREV);
     } else if (jj_2_1301(2)) {
-      jj_consume_token(DATETIME_INTERVAL_PRECISION);
+      jj_consume_token(RANGE);
     } else if (jj_2_1302(2)) {
-      jj_consume_token(DEFAULTS);
+      jj_consume_token(REAL);
     } else if (jj_2_1303(2)) {
-      jj_consume_token(DEFINED);
+      jj_consume_token(REFERENCES);
     } else if (jj_2_1304(2)) {
-      jj_consume_token(DEPTH);
+      jj_consume_token(REGR_AVGY);
     } else if (jj_2_1305(2)) {
-      jj_consume_token(DESCRIPTION);
+      jj_consume_token(REGR_R2);
     } else if (jj_2_1306(2)) {
-      jj_consume_token(DISPATCH);
+      jj_consume_token(REGR_SXY);
     } else if (jj_2_1307(2)) {
-      jj_consume_token(DOY);
+      jj_consume_token(RESET);
     } else if (jj_2_1308(2)) {
-      jj_consume_token(DYNAMIC_FUNCTION_CODE);
+      jj_consume_token(RETURNS);
     } else if (jj_2_1309(2)) {
-      jj_consume_token(ERROR);
+      jj_consume_token(ROLLUP);
     } else if (jj_2_1310(2)) {
-      jj_consume_token(EXCLUDING);
+      jj_consume_token(RUNNING);
     } else if (jj_2_1311(2)) {
-      jj_consume_token(FOLLOWING);
+      jj_consume_token(SAFE_ORDINAL);
     } else if (jj_2_1312(2)) {
-      jj_consume_token(FOUND);
+      jj_consume_token(SCROLL);
     } else if (jj_2_1313(2)) {
-      jj_consume_token(GENERAL);
+      jj_consume_token(SEEK);
     } else if (jj_2_1314(2)) {
-      jj_consume_token(GO);
+      jj_consume_token(SHOW);
     } else if (jj_2_1315(2)) {
-      jj_consume_token(GROUP_CONCAT);
+      jj_consume_token(SMALLINT);
     } else if (jj_2_1316(2)) {
-      jj_consume_token(HOURS);
+      jj_consume_token(SQL);
     } else if (jj_2_1317(2)) {
-      jj_consume_token(IMMEDIATE);
+      jj_consume_token(SQLWARNING);
     } else if (jj_2_1318(2)) {
-      jj_consume_token(INCLUDE);
+      jj_consume_token(STATIC);
     } else if (jj_2_1319(2)) {
-      jj_consume_token(INITIALLY);
+      jj_consume_token(STREAM);
     } else if (jj_2_1320(2)) {
-      jj_consume_token(INSTANTIABLE);
+      jj_consume_token(SUBSTRING);
     } else if (jj_2_1321(2)) {
-      jj_consume_token(ISOLATION);
+      jj_consume_token(SUM);
     } else if (jj_2_1322(2)) {
-      jj_consume_token(JSON);
+      jj_consume_token(SYSTEM_USER);
     } else if (jj_2_1323(2)) {
-      jj_consume_token(KEY_MEMBER);
+      jj_consume_token(TIMESTAMP);
     } else if (jj_2_1324(2)) {
-      jj_consume_token(LAST);
+      jj_consume_token(TINYINT);
     } else if (jj_2_1325(2)) {
-      jj_consume_token(LIBRARY);
+      jj_consume_token(TRANSLATION);
     } else if (jj_2_1326(2)) {
-      jj_consume_token(MAP);
+      jj_consume_token(TRIM);
     } else if (jj_2_1327(2)) {
-      jj_consume_token(MESSAGE_LENGTH);
+      jj_consume_token(TRY_CAST);
     } else if (jj_2_1328(2)) {
-      jj_consume_token(MICROSECOND);
+      jj_consume_token(UNKNOWN);
     } else if (jj_2_1329(2)) {
-      jj_consume_token(MINUTES);
+      jj_consume_token(UPSERT);
     } else if (jj_2_1330(2)) {
-      jj_consume_token(MORE_);
+      jj_consume_token(VARBINARY);
     } else if (jj_2_1331(2)) {
-      jj_consume_token(NAMES);
+      jj_consume_token(VAR_POP);
     } else if (jj_2_1332(2)) {
-      jj_consume_token(NORMALIZED);
+      jj_consume_token(WHENEVER);
     } else if (jj_2_1333(2)) {
-      jj_consume_token(NUMBER);
+      jj_consume_token(WITHIN);
     } else if (jj_2_1334(2)) {
-      jj_consume_token(OPTION);
+      jj_consume_token(MONDAY);
     } else if (jj_2_1335(2)) {
-      jj_consume_token(ORDINALITY);
+      jj_consume_token(THURSDAY);
     } else if (jj_2_1336(2)) {
-      jj_consume_token(OVERRIDING);
-    } else if (jj_2_1337(2)) {
-      jj_consume_token(PARAMETER_NAME);
+      jj_consume_token(SUNDAY);
+    } else {
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+  }
+
+/** @see #NonReservedKeyWord */
+  final public void NonReservedKeyWord1of3() throws ParseException {
+    if (jj_2_1337(2)) {
+      jj_consume_token(ABSENT);
     } else if (jj_2_1338(2)) {
-      jj_consume_token(PARAMETER_SPECIFIC_NAME);
+      jj_consume_token(ADA);
     } else if (jj_2_1339(2)) {
-      jj_consume_token(PASCAL);
+      jj_consume_token(AFTER);
     } else if (jj_2_1340(2)) {
-      jj_consume_token(PAST);
+      jj_consume_token(ARRAY_AGG);
     } else if (jj_2_1341(2)) {
-      jj_consume_token(PLACING);
+      jj_consume_token(ASSERTION);
     } else if (jj_2_1342(2)) {
-      jj_consume_token(PRECEDING);
+      jj_consume_token(ATTRIBUTES);
     } else if (jj_2_1343(2)) {
-      jj_consume_token(PRIVILEGES);
+      jj_consume_token(BREADTH);
     } else if (jj_2_1344(2)) {
-      jj_consume_token(QUARTERS);
+      jj_consume_token(CATALOG);
     } else if (jj_2_1345(2)) {
-      jj_consume_token(REPEATABLE);
+      jj_consume_token(CHAIN);
     } else if (jj_2_1346(2)) {
-      jj_consume_token(RESTART);
+      jj_consume_token(CHARACTER_SET_CATALOG);
     } else if (jj_2_1347(2)) {
-      jj_consume_token(RETURNED_LENGTH);
+      jj_consume_token(CLASS_ORIGIN);
     } else if (jj_2_1348(2)) {
-      jj_consume_token(RETURNING);
+      jj_consume_token(COLLATION_CATALOG);
     } else if (jj_2_1349(2)) {
-      jj_consume_token(ROUTINE);
+      jj_consume_token(COLUMN_NAME);
     } else if (jj_2_1350(2)) {
-      jj_consume_token(ROUTINE_SCHEMA);
+      jj_consume_token(COMMITTED);
     } else if (jj_2_1351(2)) {
-      jj_consume_token(SCALE);
+      jj_consume_token(CONNECTION);
     } else if (jj_2_1352(2)) {
-      jj_consume_token(SCOPE_CATALOGS);
+      jj_consume_token(CONSTRAINT_NAME);
     } else if (jj_2_1353(2)) {
-      jj_consume_token(SECONDS);
+      jj_consume_token(CONSTRUCTOR);
     } else if (jj_2_1354(2)) {
-      jj_consume_token(SELF);
+      jj_consume_token(CURSOR_NAME);
     } else if (jj_2_1355(2)) {
-      jj_consume_token(SERIALIZABLE);
+      jj_consume_token(DATE_DIFF);
     } else if (jj_2_1356(2)) {
-      jj_consume_token(SESSION);
+      jj_consume_token(DATETIME_INTERVAL_CODE);
     } else if (jj_2_1357(2)) {
-      jj_consume_token(SIZE);
+      jj_consume_token(DAYOFWEEK);
     } else if (jj_2_1358(2)) {
-      jj_consume_token(SPECIFIC_NAME);
+      jj_consume_token(DECADE);
     } else if (jj_2_1359(2)) {
-      jj_consume_token(SQL_BIT);
+      jj_consume_token(DEFERRED);
     } else if (jj_2_1360(2)) {
-      jj_consume_token(SQL_CHAR);
+      jj_consume_token(DEGREE);
     } else if (jj_2_1361(2)) {
-      jj_consume_token(SQL_DECIMAL);
+      jj_consume_token(DESC);
     } else if (jj_2_1362(2)) {
-      jj_consume_token(SQL_INTEGER);
+      jj_consume_token(DIAGNOSTICS);
     } else if (jj_2_1363(2)) {
-      jj_consume_token(SQL_INTERVAL_DAY_TO_MINUTE);
+      jj_consume_token(DOW);
     } else if (jj_2_1364(2)) {
-      jj_consume_token(SQL_INTERVAL_HOUR_TO_MINUTE);
+      jj_consume_token(DYNAMIC_FUNCTION);
     } else if (jj_2_1365(2)) {
-      jj_consume_token(SQL_INTERVAL_MINUTE_TO_SECOND);
+      jj_consume_token(EPOCH);
     } else if (jj_2_1366(2)) {
-      jj_consume_token(SQL_INTERVAL_YEAR);
+      jj_consume_token(EXCLUDE);
     } else if (jj_2_1367(2)) {
-      jj_consume_token(SQL_LONGVARCHAR);
+      jj_consume_token(FIRST);
     } else if (jj_2_1368(2)) {
-      jj_consume_token(SQL_NCLOB);
+      jj_consume_token(FORTRAN);
     } else if (jj_2_1369(2)) {
-      jj_consume_token(SQL_REAL);
+      jj_consume_token(G);
     } else if (jj_2_1370(2)) {
-      jj_consume_token(SQL_TIMESTAMP);
+      jj_consume_token(GEOMETRY);
     } else if (jj_2_1371(2)) {
-      jj_consume_token(SQL_TSI_FRAC_SECOND);
+      jj_consume_token(GRANTED);
     } else if (jj_2_1372(2)) {
-      jj_consume_token(SQL_TSI_MINUTE);
+      jj_consume_token(HOP);
     } else if (jj_2_1373(2)) {
-      jj_consume_token(SQL_TSI_SECOND);
+      jj_consume_token(ILIKE);
     } else if (jj_2_1374(2)) {
-      jj_consume_token(SQL_VARBINARY);
+      jj_consume_token(IMPLEMENTATION);
     } else if (jj_2_1375(2)) {
-      jj_consume_token(STATEMENT);
+      jj_consume_token(INCREMENT);
     } else if (jj_2_1376(2)) {
-      jj_consume_token(STYLE);
+      jj_consume_token(INSTANCE);
     } else if (jj_2_1377(2)) {
-      jj_consume_token(TABLE_NAME);
+      jj_consume_token(ISODOW);
     } else if (jj_2_1378(2)) {
-      jj_consume_token(TIME_DIFF);
+      jj_consume_token(JAVA);
     } else if (jj_2_1379(2)) {
-      jj_consume_token(TIMESTAMPDIFF);
+      jj_consume_token(KEY);
     } else if (jj_2_1380(2)) {
-      jj_consume_token(TOP_LEVEL_COUNT);
+      jj_consume_token(LABEL);
     } else if (jj_2_1381(2)) {
-      jj_consume_token(TRANSACTIONS_COMMITTED);
+      jj_consume_token(LEVEL);
     } else if (jj_2_1382(2)) {
-      jj_consume_token(TRANSFORMS);
+      jj_consume_token(M);
     } else if (jj_2_1383(2)) {
-      jj_consume_token(TRIGGER_SCHEMA);
+      jj_consume_token(MAXVALUE);
     } else if (jj_2_1384(2)) {
-      jj_consume_token(UNBOUNDED);
+      jj_consume_token(MESSAGE_TEXT);
     } else if (jj_2_1385(2)) {
-      jj_consume_token(UNDER);
+      jj_consume_token(MILLISECOND);
     } else if (jj_2_1386(2)) {
-      jj_consume_token(USAGE);
+      jj_consume_token(MONTHS);
     } else if (jj_2_1387(2)) {
-      jj_consume_token(USER_DEFINED_TYPE_NAME);
+      jj_consume_token(NAME);
     } else if (jj_2_1388(2)) {
-      jj_consume_token(UTF32);
+      jj_consume_token(NESTING);
     } else if (jj_2_1389(2)) {
-      jj_consume_token(VIEW);
+      jj_consume_token(NULLS);
     } else if (jj_2_1390(2)) {
-      jj_consume_token(WORK);
+      jj_consume_token(OCTETS);
     } else if (jj_2_1391(2)) {
-      jj_consume_token(XML);
+      jj_consume_token(ORDERING);
     } else if (jj_2_1392(2)) {
-      jj_consume_token(TEMPLATE);
+      jj_consume_token(OUTPUT);
     } else if (jj_2_1393(2)) {
-      jj_consume_token(ATOMICITY);
+      jj_consume_token(PARAMETER_MODE);
     } else if (jj_2_1394(2)) {
-      jj_consume_token(CACHE_NAME);
+      jj_consume_token(PARAMETER_SPECIFIC_CATALOG);
     } else if (jj_2_1395(2)) {
-      jj_consume_token(ENCRYPTED);
+      jj_consume_token(PARTIAL);
     } else if (jj_2_1396(2)) {
-      jj_consume_token(LOGGING);
+      jj_consume_token(PASSTHROUGH);
     } else if (jj_2_1397(2)) {
-      jj_consume_token(KILL);
+      jj_consume_token(PIVOT);
     } else if (jj_2_1398(2)) {
-      jj_consume_token(SERVICE);
+      jj_consume_token(PLI);
     } else if (jj_2_1399(2)) {
-      jj_consume_token(QUERY);
+      jj_consume_token(PRIOR);
     } else if (jj_2_1400(2)) {
-      jj_consume_token(ANALYZE);
+      jj_consume_token(QUARTER);
     } else if (jj_2_1401(2)) {
-      jj_consume_token(ABS);
+      jj_consume_token(RELATIVE);
     } else if (jj_2_1402(2)) {
-      jj_consume_token(ARE);
+      jj_consume_token(RESPECT);
     } else if (jj_2_1403(2)) {
-      jj_consume_token(AT);
+      jj_consume_token(RETURNED_CARDINALITY);
     } else if (jj_2_1404(2)) {
-      jj_consume_token(AVG);
+      jj_consume_token(RETURNED_SQLSTATE);
     } else if (jj_2_1405(2)) {
-      jj_consume_token(BEGIN_PARTITION);
+      jj_consume_token(ROLE);
     } else if (jj_2_1406(2)) {
-      jj_consume_token(BIT);
+      jj_consume_token(ROUTINE_NAME);
     } else if (jj_2_1407(2)) {
-      jj_consume_token(CALL);
+      jj_consume_token(SCALAR);
     } else if (jj_2_1408(2)) {
-      jj_consume_token(CASCADED);
+      jj_consume_token(SCHEMA_NAME);
     } else if (jj_2_1409(2)) {
-      jj_consume_token(CHAR);
+      jj_consume_token(SCOPE_SCHEMA);
     } else if (jj_2_1410(2)) {
-      jj_consume_token(CHAR_LENGTH);
+      jj_consume_token(SECURITY);
     } else if (jj_2_1411(2)) {
-      jj_consume_token(CLOB);
+      jj_consume_token(SEQUENCE);
     } else if (jj_2_1412(2)) {
-      jj_consume_token(COLLATE);
+      jj_consume_token(SERVER_NAME);
     } else if (jj_2_1413(2)) {
-      jj_consume_token(CONDITION);
+      jj_consume_token(SIMPLE);
     } else if (jj_2_1414(2)) {
-      jj_consume_token(CONVERT);
+      jj_consume_token(SPACE);
     } else if (jj_2_1415(2)) {
-      jj_consume_token(COUNT);
+      jj_consume_token(SQL_BINARY);
     } else if (jj_2_1416(2)) {
-      jj_consume_token(CUBE);
+      jj_consume_token(SQL_BOOLEAN);
     } else if (jj_2_1417(2)) {
-      jj_consume_token(CURRENT_CATALOG);
+      jj_consume_token(SQL_DATE);
     } else if (jj_2_1418(2)) {
-      jj_consume_token(CURRENT_ROLE);
+      jj_consume_token(SQL_FLOAT);
     } else if (jj_2_1419(2)) {
-      jj_consume_token(CURSOR);
+      jj_consume_token(SQL_INTERVAL_DAY_TO_HOUR);
     } else if (jj_2_1420(2)) {
-      jj_consume_token(DATETIME);
+      jj_consume_token(SQL_INTERVAL_HOUR);
     } else if (jj_2_1421(2)) {
-      jj_consume_token(DEC);
+      jj_consume_token(SQL_INTERVAL_MINUTE);
     } else if (jj_2_1422(2)) {
-      jj_consume_token(DEFINE);
+      jj_consume_token(SQL_INTERVAL_SECOND);
     } else if (jj_2_1423(2)) {
-      jj_consume_token(DESCRIBE);
+      jj_consume_token(SQL_LONGVARBINARY);
     } else if (jj_2_1424(2)) {
-      jj_consume_token(DISCONNECT);
+      jj_consume_token(SQL_NCHAR);
     } else if (jj_2_1425(2)) {
-      jj_consume_token(EACH);
+      jj_consume_token(SQL_NVARCHAR);
     } else if (jj_2_1426(2)) {
-      jj_consume_token(END);
+      jj_consume_token(SQL_TIME);
     } else if (jj_2_1427(2)) {
-      jj_consume_token(END_PARTITION);
+      jj_consume_token(SQL_TSI_DAY);
     } else if (jj_2_1428(2)) {
-      jj_consume_token(EVERY);
+      jj_consume_token(SQL_TSI_MICROSECOND);
     } else if (jj_2_1429(2)) {
-      jj_consume_token(EXP);
+      jj_consume_token(SQL_TSI_QUARTER);
     } else if (jj_2_1430(2)) {
-      jj_consume_token(EXTRACT);
+      jj_consume_token(SQL_TSI_YEAR);
     } else if (jj_2_1431(2)) {
-      jj_consume_token(FLOAT);
+      jj_consume_token(STATE);
     } else if (jj_2_1432(2)) {
-      jj_consume_token(FRAME_ROW);
+      jj_consume_token(STRUCTURE);
     } else if (jj_2_1433(2)) {
-      jj_consume_token(FUSION);
+      jj_consume_token(SUBSTITUTE);
     } else if (jj_2_1434(2)) {
-      jj_consume_token(GRANT);
+      jj_consume_token(TIES);
     } else if (jj_2_1435(2)) {
-      jj_consume_token(HOLD);
+      jj_consume_token(TIMESTAMPADD);
     } else if (jj_2_1436(2)) {
-      jj_consume_token(IMPORT);
+      jj_consume_token(TIMESTAMP_TRUNC);
     } else if (jj_2_1437(2)) {
-      jj_consume_token(INOUT);
+      jj_consume_token(TRANSACTIONS_ACTIVE);
     } else if (jj_2_1438(2)) {
-      jj_consume_token(INTEGER);
+      jj_consume_token(TRANSFORM);
     } else if (jj_2_1439(2)) {
-      jj_consume_token(JSON_ARRAYAGG);
+      jj_consume_token(TRIGGER_NAME);
     } else if (jj_2_1440(2)) {
-      jj_consume_token(JSON_OBJECTAGG);
+      jj_consume_token(TYPE);
     } else if (jj_2_1441(2)) {
-      jj_consume_token(LAG);
+      jj_consume_token(UNCONDITIONAL);
     } else if (jj_2_1442(2)) {
-      jj_consume_token(LAST_VALUE);
+      jj_consume_token(UNNAMED);
     } else if (jj_2_1443(2)) {
-      jj_consume_token(LIKE_REGEX);
+      jj_consume_token(USER_DEFINED_TYPE_CODE);
     } else if (jj_2_1444(2)) {
-      jj_consume_token(LOWER);
+      jj_consume_token(UTF16);
     } else if (jj_2_1445(2)) {
-      jj_consume_token(MATCH_NUMBER);
+      jj_consume_token(VERSION);
     } else if (jj_2_1446(2)) {
-      jj_consume_token(MEASURES);
+      jj_consume_token(WEEKS);
     } else if (jj_2_1447(2)) {
-      jj_consume_token(MIN);
+      jj_consume_token(WRITE);
     } else if (jj_2_1448(2)) {
-      jj_consume_token(MODIFIES);
+      jj_consume_token(ZONE);
     } else if (jj_2_1449(2)) {
-      jj_consume_token(MULTISET);
+      jj_consume_token(AFFINITY_KEY);
     } else if (jj_2_1450(2)) {
-      jj_consume_token(NCLOB);
+      jj_consume_token(CACHE_GROUP);
     } else if (jj_2_1451(2)) {
-      jj_consume_token(NO);
+      jj_consume_token(VALUE_TYPE);
     } else if (jj_2_1452(2)) {
-      jj_consume_token(NTH_VALUE);
+      jj_consume_token(INLINE_SIZE);
     } else if (jj_2_1453(2)) {
-      jj_consume_token(NUMERIC);
+      jj_consume_token(PASSWORD);
     } else if (jj_2_1454(2)) {
-      jj_consume_token(OF);
+      jj_consume_token(CONTINUOUS);
     } else if (jj_2_1455(2)) {
-      jj_consume_token(ONE);
+      jj_consume_token(ASYNC);
     } else if (jj_2_1456(2)) {
-      jj_consume_token(OUT);
+      jj_consume_token(REFRESH);
     } else if (jj_2_1457(2)) {
-      jj_consume_token(OVERLAY);
+      jj_consume_token(TOTAL);
     } else if (jj_2_1458(2)) {
-      jj_consume_token(PER);
+      jj_consume_token(ALLOW);
     } else if (jj_2_1459(2)) {
-      jj_consume_token(PERCENTILE_DISC);
+      jj_consume_token(ASENSITIVE);
     } else if (jj_2_1460(2)) {
-      jj_consume_token(PERMUTE);
+      jj_consume_token(AUTHORIZATION);
     } else if (jj_2_1461(2)) {
-      jj_consume_token(POSITION_REGEX);
+      jj_consume_token(BEGIN_FRAME);
     } else if (jj_2_1462(2)) {
-      jj_consume_token(PRECISION);
+      jj_consume_token(BINARY);
     } else if (jj_2_1463(2)) {
-      jj_consume_token(PROCEDURE);
+      jj_consume_token(BOOLEAN);
     } else if (jj_2_1464(2)) {
-      jj_consume_token(RANK);
+      jj_consume_token(CARDINALITY);
     } else if (jj_2_1465(2)) {
-      jj_consume_token(RECURSIVE);
+      jj_consume_token(CEILING);
     } else if (jj_2_1466(2)) {
-      jj_consume_token(REFERENCING);
+      jj_consume_token(CHARACTER_LENGTH);
     } else if (jj_2_1467(2)) {
-      jj_consume_token(REGR_COUNT);
+      jj_consume_token(CLASSIFIER);
     } else if (jj_2_1468(2)) {
-      jj_consume_token(REGR_SLOPE);
+      jj_consume_token(COALESCE);
     } else if (jj_2_1469(2)) {
-      jj_consume_token(REGR_SYY);
+      jj_consume_token(COMMIT);
     } else if (jj_2_1470(2)) {
-      jj_consume_token(RESULT);
+      jj_consume_token(CONTAINS);
     } else if (jj_2_1471(2)) {
-      jj_consume_token(REVOKE);
+      jj_consume_token(CORRESPONDING);
     } else if (jj_2_1472(2)) {
-      jj_consume_token(ROWS);
+      jj_consume_token(COVAR_SAMP);
     } else if (jj_2_1473(2)) {
-      jj_consume_token(SAVEPOINT);
+      jj_consume_token(CURRENT);
     } else if (jj_2_1474(2)) {
-      jj_consume_token(SEARCH);
+      jj_consume_token(CURRENT_PATH);
     } else if (jj_2_1475(2)) {
-      jj_consume_token(SENSITIVE);
+      jj_consume_token(CURRENT_TRANSFORM_GROUP_FOR_TYPE);
     } else if (jj_2_1476(2)) {
-      jj_consume_token(SIMILAR);
+      jj_consume_token(DATE);
     } else if (jj_2_1477(2)) {
-      jj_consume_token(SPECIFIC);
+      jj_consume_token(DEALLOCATE);
     } else if (jj_2_1478(2)) {
-      jj_consume_token(SQLEXCEPTION);
+      jj_consume_token(DECLARE);
     } else if (jj_2_1479(2)) {
-      jj_consume_token(SQRT);
+      jj_consume_token(DEREF);
     } else if (jj_2_1480(2)) {
-      jj_consume_token(STDDEV_POP);
+      jj_consume_token(DISALLOW);
     } else if (jj_2_1481(2)) {
-      jj_consume_token(SUBMULTISET);
+      jj_consume_token(DYNAMIC);
     } else if (jj_2_1482(2)) {
-      jj_consume_token(SUBSTRING_REGEX);
+      jj_consume_token(EMPTY);
     } else if (jj_2_1483(2)) {
-      jj_consume_token(SYSTEM);
+      jj_consume_token(END_FRAME);
     } else if (jj_2_1484(2)) {
-      jj_consume_token(TABLESAMPLE);
+      jj_consume_token(ESCAPE);
     } else if (jj_2_1485(2)) {
-      jj_consume_token(TIMEZONE_HOUR);
+      jj_consume_token(EXECUTE);
     } else if (jj_2_1486(2)) {
-      jj_consume_token(TRANSLATE);
+      jj_consume_token(EXTERNAL);
     } else if (jj_2_1487(2)) {
-      jj_consume_token(TREAT);
+      jj_consume_token(FIRST_VALUE);
     } else if (jj_2_1488(2)) {
-      jj_consume_token(TRIM_ARRAY);
+      jj_consume_token(FOREIGN);
     } else if (jj_2_1489(2)) {
-      jj_consume_token(UNIQUE);
+      jj_consume_token(FUNCTION);
     } else if (jj_2_1490(2)) {
-      jj_consume_token(UPPER);
+      jj_consume_token(GLOBAL);
     } else if (jj_2_1491(2)) {
-      jj_consume_token(VALUE_OF);
+      jj_consume_token(GROUPS);
     } else if (jj_2_1492(2)) {
-      jj_consume_token(VARYING);
+      jj_consume_token(IDENTITY);
     } else if (jj_2_1493(2)) {
-      jj_consume_token(VERSIONING);
+      jj_consume_token(INITIAL);
     } else if (jj_2_1494(2)) {
-      jj_consume_token(WINDOW);
+      jj_consume_token(INT);
     } else if (jj_2_1495(2)) {
-      jj_consume_token(YEAR);
+      jj_consume_token(JSON_ARRAY);
     } else if (jj_2_1496(2)) {
-      jj_consume_token(WEDNESDAY);
+      jj_consume_token(JSON_OBJECT);
     } else if (jj_2_1497(2)) {
-      jj_consume_token(SATURDAY);
-    } else {
-      jj_consume_token(-1);
-      throw new ParseException();
-    }
-  }
-
-/** @see #NonReservedKeyWord */
-  final public void NonReservedKeyWord2of3() throws ParseException {
-    if (jj_2_1498(2)) {
-      jj_consume_token(ABSOLUTE);
+      jj_consume_token(JSON_SCOPE);
+    } else if (jj_2_1498(2)) {
+      jj_consume_token(LANGUAGE);
     } else if (jj_2_1499(2)) {
-      jj_consume_token(ADD);
+      jj_consume_token(LATERAL);
     } else if (jj_2_1500(2)) {
-      jj_consume_token(ALWAYS);
+      jj_consume_token(LN);
     } else if (jj_2_1501(2)) {
-      jj_consume_token(ARRAY_CONCAT_AGG);
+      jj_consume_token(MATCH);
     } else if (jj_2_1502(2)) {
-      jj_consume_token(ASSIGNMENT);
+      jj_consume_token(MATCH_RECOGNIZE);
     } else if (jj_2_1503(2)) {
-      jj_consume_token(BEFORE);
+      jj_consume_token(MEMBER);
     } else if (jj_2_1504(2)) {
-      jj_consume_token(C);
+      jj_consume_token(MINUTE);
     } else if (jj_2_1505(2)) {
-      jj_consume_token(CATALOG_NAME);
+      jj_consume_token(MODULE);
     } else if (jj_2_1506(2)) {
-      jj_consume_token(CHARACTERISTICS);
+      jj_consume_token(NATIONAL);
     } else if (jj_2_1507(2)) {
-      jj_consume_token(CHARACTER_SET_NAME);
+      jj_consume_token(NEW);
     } else if (jj_2_1508(2)) {
-      jj_consume_token(COBOL);
+      jj_consume_token(NONE);
     } else if (jj_2_1509(2)) {
-      jj_consume_token(COLLATION_NAME);
+      jj_consume_token(NTILE);
     } else if (jj_2_1510(2)) {
-      jj_consume_token(COMMAND_FUNCTION);
+      jj_consume_token(OCCURRENCES_REGEX);
     } else if (jj_2_1511(2)) {
-      jj_consume_token(CONDITIONAL);
+      jj_consume_token(OLD);
     } else if (jj_2_1512(2)) {
-      jj_consume_token(CONNECTION_NAME);
+      jj_consume_token(ONLY);
     } else if (jj_2_1513(2)) {
-      jj_consume_token(CONSTRAINTS);
+      jj_consume_token(OUT);
     } else if (jj_2_1514(2)) {
-      jj_consume_token(CONTINUE);
+      jj_consume_token(OVERLAY);
     } else if (jj_2_1515(2)) {
-      jj_consume_token(DATABASE);
+      jj_consume_token(PER);
     } else if (jj_2_1516(2)) {
-      jj_consume_token(DATETIME_DIFF);
+      jj_consume_token(PERCENTILE_DISC);
     } else if (jj_2_1517(2)) {
-      jj_consume_token(DAYS);
+      jj_consume_token(PERMUTE);
     } else if (jj_2_1518(2)) {
-      jj_consume_token(DEFERRABLE);
+      jj_consume_token(POSITION_REGEX);
     } else if (jj_2_1519(2)) {
-      jj_consume_token(DEFINER);
+      jj_consume_token(PRECISION);
     } else if (jj_2_1520(2)) {
-      jj_consume_token(DERIVED);
+      jj_consume_token(PROCEDURE);
     } else if (jj_2_1521(2)) {
-      jj_consume_token(DESCRIPTOR);
+      jj_consume_token(RANK);
     } else if (jj_2_1522(2)) {
-      jj_consume_token(DOMAIN);
+      jj_consume_token(RECURSIVE);
     } else if (jj_2_1523(2)) {
-      jj_consume_token(DOT_FORMAT);
+      jj_consume_token(REFERENCING);
     } else if (jj_2_1524(2)) {
-      jj_consume_token(ENCODING);
+      jj_consume_token(REGR_COUNT);
     } else if (jj_2_1525(2)) {
-      jj_consume_token(EXCEPTION);
+      jj_consume_token(REGR_SLOPE);
     } else if (jj_2_1526(2)) {
-      jj_consume_token(FINAL);
+      jj_consume_token(REGR_SYY);
     } else if (jj_2_1527(2)) {
-      jj_consume_token(FORMAT);
+      jj_consume_token(RESULT);
     } else if (jj_2_1528(2)) {
-      jj_consume_token(FRAC_SECOND);
+      jj_consume_token(REVOKE);
     } else if (jj_2_1529(2)) {
-      jj_consume_token(GENERATED);
+      jj_consume_token(ROWS);
     } else if (jj_2_1530(2)) {
-      jj_consume_token(GOTO);
+      jj_consume_token(SAFE_CAST);
     } else if (jj_2_1531(2)) {
-      jj_consume_token(HIERARCHY);
+      jj_consume_token(SAVEPOINT);
     } else if (jj_2_1532(2)) {
-      jj_consume_token(IGNORE);
+      jj_consume_token(SEARCH);
     } else if (jj_2_1533(2)) {
-      jj_consume_token(IMMEDIATELY);
+      jj_consume_token(SENSITIVE);
     } else if (jj_2_1534(2)) {
-      jj_consume_token(INCLUDING);
+      jj_consume_token(SIMILAR);
     } else if (jj_2_1535(2)) {
-      jj_consume_token(INPUT);
+      jj_consume_token(SPECIFIC);
     } else if (jj_2_1536(2)) {
-      jj_consume_token(INVOKER);
+      jj_consume_token(SQLEXCEPTION);
     } else if (jj_2_1537(2)) {
-      jj_consume_token(ISOYEAR);
+      jj_consume_token(SQRT);
     } else if (jj_2_1538(2)) {
-      jj_consume_token(K);
+      jj_consume_token(STDDEV_POP);
     } else if (jj_2_1539(2)) {
-      jj_consume_token(KEY_TYPE);
+      jj_consume_token(SUBMULTISET);
     } else if (jj_2_1540(2)) {
-      jj_consume_token(LENGTH);
+      jj_consume_token(SUBSTRING_REGEX);
     } else if (jj_2_1541(2)) {
-      jj_consume_token(LOCATOR);
+      jj_consume_token(SYSTEM);
     } else if (jj_2_1542(2)) {
-      jj_consume_token(MATCHED);
+      jj_consume_token(TABLESAMPLE);
     } else if (jj_2_1543(2)) {
-      jj_consume_token(MESSAGE_OCTET_LENGTH);
+      jj_consume_token(TIMEZONE_HOUR);
     } else if (jj_2_1544(2)) {
-      jj_consume_token(MILLENNIUM);
+      jj_consume_token(TRANSLATE);
     } else if (jj_2_1545(2)) {
-      jj_consume_token(MINVALUE);
+      jj_consume_token(TREAT);
     } else if (jj_2_1546(2)) {
-      jj_consume_token(MUMPS);
+      jj_consume_token(TRIM_ARRAY);
     } else if (jj_2_1547(2)) {
-      jj_consume_token(NANOSECOND);
+      jj_consume_token(UESCAPE);
     } else if (jj_2_1548(2)) {
-      jj_consume_token(NULLABLE);
+      jj_consume_token(UNNEST);
     } else if (jj_2_1549(2)) {
-      jj_consume_token(OBJECT);
+      jj_consume_token(VALUE);
     } else if (jj_2_1550(2)) {
-      jj_consume_token(OPTIONS);
+      jj_consume_token(VARCHAR);
     } else if (jj_2_1551(2)) {
-      jj_consume_token(OTHERS);
+      jj_consume_token(VAR_SAMP);
     } else if (jj_2_1552(2)) {
-      jj_consume_token(PAD);
+      jj_consume_token(WIDTH_BUCKET);
     } else if (jj_2_1553(2)) {
-      jj_consume_token(PARAMETER_ORDINAL_POSITION);
+      jj_consume_token(WITHOUT);
     } else if (jj_2_1554(2)) {
-      jj_consume_token(PARAMETER_SPECIFIC_SCHEMA);
+      jj_consume_token(TUESDAY);
     } else if (jj_2_1555(2)) {
-      jj_consume_token(PASSING);
-    } else if (jj_2_1556(2)) {
-      jj_consume_token(PATH);
+      jj_consume_token(FRIDAY);
+    } else {
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+  }
+
+/** @see #NonReservedKeyWord */
+  final public void NonReservedKeyWord2of3() throws ParseException {
+    if (jj_2_1556(2)) {
+      jj_consume_token(ABSOLUTE);
     } else if (jj_2_1557(2)) {
-      jj_consume_token(PLAN);
+      jj_consume_token(ADD);
     } else if (jj_2_1558(2)) {
-      jj_consume_token(PRESERVE);
+      jj_consume_token(ALWAYS);
     } else if (jj_2_1559(2)) {
-      jj_consume_token(PUBLIC);
+      jj_consume_token(ARRAY_CONCAT_AGG);
     } else if (jj_2_1560(2)) {
-      jj_consume_token(READ);
+      jj_consume_token(ASSIGNMENT);
     } else if (jj_2_1561(2)) {
-      jj_consume_token(REPLACE);
+      jj_consume_token(BEFORE);
     } else if (jj_2_1562(2)) {
-      jj_consume_token(RESTRICT);
+      jj_consume_token(C);
     } else if (jj_2_1563(2)) {
-      jj_consume_token(RETURNED_OCTET_LENGTH);
+      jj_consume_token(CATALOG_NAME);
     } else if (jj_2_1564(2)) {
-      jj_consume_token(RLIKE);
+      jj_consume_token(CHARACTERISTICS);
     } else if (jj_2_1565(2)) {
-      jj_consume_token(ROUTINE_CATALOG);
+      jj_consume_token(CHARACTER_SET_NAME);
     } else if (jj_2_1566(2)) {
-      jj_consume_token(ROW_COUNT);
+      jj_consume_token(COBOL);
     } else if (jj_2_1567(2)) {
-      jj_consume_token(SCHEMA);
+      jj_consume_token(COLLATION_NAME);
     } else if (jj_2_1568(2)) {
-      jj_consume_token(SCOPE_NAME);
+      jj_consume_token(COMMAND_FUNCTION);
     } else if (jj_2_1569(2)) {
-      jj_consume_token(SECTION);
+      jj_consume_token(CONDITIONAL);
     } else if (jj_2_1570(2)) {
-      jj_consume_token(SEPARATOR);
+      jj_consume_token(CONNECTION_NAME);
     } else if (jj_2_1571(2)) {
-      jj_consume_token(SERVER);
+      jj_consume_token(CONSTRAINTS);
     } else if (jj_2_1572(2)) {
-      jj_consume_token(SETS);
+      jj_consume_token(CONTAINS_SUBSTR);
     } else if (jj_2_1573(2)) {
-      jj_consume_token(SOURCE);
+      jj_consume_token(DATA);
     } else if (jj_2_1574(2)) {
-      jj_consume_token(SQL_BIGINT);
+      jj_consume_token(DATE_TRUNC);
     } else if (jj_2_1575(2)) {
-      jj_consume_token(SQL_BLOB);
+      jj_consume_token(DATETIME_INTERVAL_PRECISION);
     } else if (jj_2_1576(2)) {
-      jj_consume_token(SQL_CLOB);
+      jj_consume_token(DAYOFYEAR);
     } else if (jj_2_1577(2)) {
-      jj_consume_token(SQL_DOUBLE);
+      jj_consume_token(DEFAULTS);
     } else if (jj_2_1578(2)) {
-      jj_consume_token(SQL_INTERVAL_DAY);
+      jj_consume_token(DEFINED);
     } else if (jj_2_1579(2)) {
-      jj_consume_token(SQL_INTERVAL_DAY_TO_SECOND);
+      jj_consume_token(DEPTH);
     } else if (jj_2_1580(2)) {
-      jj_consume_token(SQL_INTERVAL_HOUR_TO_SECOND);
+      jj_consume_token(DESCRIPTION);
     } else if (jj_2_1581(2)) {
-      jj_consume_token(SQL_INTERVAL_MONTH);
+      jj_consume_token(DISPATCH);
     } else if (jj_2_1582(2)) {
-      jj_consume_token(SQL_INTERVAL_YEAR_TO_MONTH);
+      jj_consume_token(DOY);
     } else if (jj_2_1583(2)) {
-      jj_consume_token(SQL_LONGVARNCHAR);
+      jj_consume_token(DYNAMIC_FUNCTION_CODE);
     } else if (jj_2_1584(2)) {
-      jj_consume_token(SQL_NUMERIC);
+      jj_consume_token(ERROR);
     } else if (jj_2_1585(2)) {
-      jj_consume_token(SQL_SMALLINT);
+      jj_consume_token(EXCLUDING);
     } else if (jj_2_1586(2)) {
-      jj_consume_token(SQL_TINYINT);
+      jj_consume_token(FOLLOWING);
     } else if (jj_2_1587(2)) {
-      jj_consume_token(SQL_TSI_HOUR);
+      jj_consume_token(FOUND);
     } else if (jj_2_1588(2)) {
-      jj_consume_token(SQL_TSI_MONTH);
+      jj_consume_token(GENERAL);
     } else if (jj_2_1589(2)) {
-      jj_consume_token(SQL_TSI_WEEK);
+      jj_consume_token(GO);
     } else if (jj_2_1590(2)) {
-      jj_consume_token(SQL_VARCHAR);
+      jj_consume_token(GROUP_CONCAT);
     } else if (jj_2_1591(2)) {
-      jj_consume_token(STRING_AGG);
+      jj_consume_token(HOURS);
     } else if (jj_2_1592(2)) {
-      jj_consume_token(SUBCLASS_ORIGIN);
+      jj_consume_token(IMMEDIATE);
     } else if (jj_2_1593(2)) {
-      jj_consume_token(TEMPORARY);
+      jj_consume_token(INCLUDE);
     } else if (jj_2_1594(2)) {
-      jj_consume_token(TIME_TRUNC);
+      jj_consume_token(INITIALLY);
     } else if (jj_2_1595(2)) {
-      jj_consume_token(TIMESTAMP_DIFF);
+      jj_consume_token(INSTANTIABLE);
     } else if (jj_2_1596(2)) {
-      jj_consume_token(TRANSACTION);
+      jj_consume_token(ISOLATION);
     } else if (jj_2_1597(2)) {
-      jj_consume_token(TRANSACTIONS_ROLLED_BACK);
+      jj_consume_token(JSON);
     } else if (jj_2_1598(2)) {
-      jj_consume_token(TRIGGER_CATALOG);
+      jj_consume_token(KEY_MEMBER);
     } else if (jj_2_1599(2)) {
-      jj_consume_token(TUMBLE);
+      jj_consume_token(LAST);
     } else if (jj_2_1600(2)) {
-      jj_consume_token(UNCOMMITTED);
+      jj_consume_token(LIBRARY);
     } else if (jj_2_1601(2)) {
-      jj_consume_token(UNPIVOT);
+      jj_consume_token(MAP);
     } else if (jj_2_1602(2)) {
-      jj_consume_token(USER_DEFINED_TYPE_CATALOG);
+      jj_consume_token(MESSAGE_LENGTH);
     } else if (jj_2_1603(2)) {
-      jj_consume_token(USER_DEFINED_TYPE_SCHEMA);
+      jj_consume_token(MICROSECOND);
     } else if (jj_2_1604(2)) {
-      jj_consume_token(UTF8);
+      jj_consume_token(MINUTES);
     } else if (jj_2_1605(2)) {
-      jj_consume_token(WEEK);
+      jj_consume_token(MORE_);
     } else if (jj_2_1606(2)) {
-      jj_consume_token(WRAPPER);
+      jj_consume_token(NAMES);
     } else if (jj_2_1607(2)) {
-      jj_consume_token(YEARS);
+      jj_consume_token(NORMALIZED);
     } else if (jj_2_1608(2)) {
-      jj_consume_token(BACKUPS);
+      jj_consume_token(NUMBER);
     } else if (jj_2_1609(2)) {
-      jj_consume_token(WRITE_SYNCHRONIZATION_MODE);
+      jj_consume_token(OPTION);
     } else if (jj_2_1610(2)) {
-      jj_consume_token(DATA_REGION);
+      jj_consume_token(ORDINALITY);
     } else if (jj_2_1611(2)) {
-      jj_consume_token(PARALLEL);
+      jj_consume_token(OVERRIDING);
     } else if (jj_2_1612(2)) {
-      jj_consume_token(NOLOGGING);
+      jj_consume_token(PARAMETER_NAME);
     } else if (jj_2_1613(2)) {
-      jj_consume_token(SCAN);
+      jj_consume_token(PARAMETER_SPECIFIC_NAME);
     } else if (jj_2_1614(2)) {
-      jj_consume_token(COMPUTE);
+      jj_consume_token(PASCAL);
     } else if (jj_2_1615(2)) {
-      jj_consume_token(STATISTICS);
+      jj_consume_token(PAST);
     } else if (jj_2_1616(2)) {
-      jj_consume_token(MAX_CHANGED_PARTITION_ROWS_PERCENT);
+      jj_consume_token(PLACING);
     } else if (jj_2_1617(2)) {
-      jj_consume_token(ALLOCATE);
+      jj_consume_token(PRECEDING);
     } else if (jj_2_1618(2)) {
-      jj_consume_token(ARRAY_MAX_CARDINALITY);
+      jj_consume_token(PRIVILEGES);
     } else if (jj_2_1619(2)) {
-      jj_consume_token(ATOMIC);
+      jj_consume_token(QUARTERS);
     } else if (jj_2_1620(2)) {
-      jj_consume_token(BEGIN);
+      jj_consume_token(REPEATABLE);
     } else if (jj_2_1621(2)) {
-      jj_consume_token(BIGINT);
+      jj_consume_token(RESTART);
     } else if (jj_2_1622(2)) {
-      jj_consume_token(BLOB);
+      jj_consume_token(RETURNED_LENGTH);
     } else if (jj_2_1623(2)) {
-      jj_consume_token(CALLED);
+      jj_consume_token(RETURNING);
     } else if (jj_2_1624(2)) {
-      jj_consume_token(CEIL);
+      jj_consume_token(ROUTINE);
     } else if (jj_2_1625(2)) {
-      jj_consume_token(CHARACTER);
+      jj_consume_token(ROUTINE_SCHEMA);
     } else if (jj_2_1626(2)) {
-      jj_consume_token(CHECK);
+      jj_consume_token(SCALE);
     } else if (jj_2_1627(2)) {
-      jj_consume_token(CLOSE);
+      jj_consume_token(SCOPE_CATALOGS);
     } else if (jj_2_1628(2)) {
-      jj_consume_token(COLLECT);
+      jj_consume_token(SECONDS);
     } else if (jj_2_1629(2)) {
-      jj_consume_token(CONNECT);
+      jj_consume_token(SELF);
     } else if (jj_2_1630(2)) {
-      jj_consume_token(CORR);
+      jj_consume_token(SERIALIZABLE);
     } else if (jj_2_1631(2)) {
-      jj_consume_token(COVAR_POP);
+      jj_consume_token(SESSION);
     } else if (jj_2_1632(2)) {
-      jj_consume_token(CUME_DIST);
+      jj_consume_token(SIZE);
     } else if (jj_2_1633(2)) {
-      jj_consume_token(CURRENT_DEFAULT_TRANSFORM_GROUP);
+      jj_consume_token(SPECIFIC_NAME);
     } else if (jj_2_1634(2)) {
-      jj_consume_token(CURRENT_ROW);
+      jj_consume_token(SQL_BIT);
     } else if (jj_2_1635(2)) {
-      jj_consume_token(CYCLE);
+      jj_consume_token(SQL_CHAR);
     } else if (jj_2_1636(2)) {
-      jj_consume_token(DAY);
+      jj_consume_token(SQL_DECIMAL);
     } else if (jj_2_1637(2)) {
-      jj_consume_token(DECIMAL);
+      jj_consume_token(SQL_INTEGER);
     } else if (jj_2_1638(2)) {
-      jj_consume_token(DENSE_RANK);
+      jj_consume_token(SQL_INTERVAL_DAY_TO_MINUTE);
     } else if (jj_2_1639(2)) {
-      jj_consume_token(DETERMINISTIC);
+      jj_consume_token(SQL_INTERVAL_HOUR_TO_MINUTE);
     } else if (jj_2_1640(2)) {
-      jj_consume_token(DOUBLE);
+      jj_consume_token(SQL_INTERVAL_MINUTE_TO_SECOND);
     } else if (jj_2_1641(2)) {
-      jj_consume_token(ELEMENT);
+      jj_consume_token(SQL_INTERVAL_YEAR);
     } else if (jj_2_1642(2)) {
-      jj_consume_token(END_EXEC);
+      jj_consume_token(SQL_LONGVARCHAR);
     } else if (jj_2_1643(2)) {
-      jj_consume_token(EQUALS);
+      jj_consume_token(SQL_NCLOB);
     } else if (jj_2_1644(2)) {
-      jj_consume_token(EXEC);
+      jj_consume_token(SQL_REAL);
     } else if (jj_2_1645(2)) {
-      jj_consume_token(EXTEND);
+      jj_consume_token(SQL_TIMESTAMP);
     } else if (jj_2_1646(2)) {
-      jj_consume_token(FILTER);
+      jj_consume_token(SQL_TSI_FRAC_SECOND);
     } else if (jj_2_1647(2)) {
-      jj_consume_token(FLOOR);
+      jj_consume_token(SQL_TSI_MINUTE);
     } else if (jj_2_1648(2)) {
-      jj_consume_token(FREE);
+      jj_consume_token(SQL_TSI_SECOND);
     } else if (jj_2_1649(2)) {
-      jj_consume_token(GET);
+      jj_consume_token(SQL_VARBINARY);
     } else if (jj_2_1650(2)) {
-      jj_consume_token(GROUPING);
+      jj_consume_token(STATEMENT);
     } else if (jj_2_1651(2)) {
-      jj_consume_token(HOUR);
+      jj_consume_token(STYLE);
     } else if (jj_2_1652(2)) {
-      jj_consume_token(INDICATOR);
+      jj_consume_token(TABLE_NAME);
     } else if (jj_2_1653(2)) {
-      jj_consume_token(INSENSITIVE);
+      jj_consume_token(TIME_DIFF);
     } else if (jj_2_1654(2)) {
-      jj_consume_token(INTERSECTION);
+      jj_consume_token(TIMESTAMPDIFF);
     } else if (jj_2_1655(2)) {
-      jj_consume_token(JSON_EXISTS);
+      jj_consume_token(TOP_LEVEL_COUNT);
     } else if (jj_2_1656(2)) {
-      jj_consume_token(JSON_QUERY);
+      jj_consume_token(TRANSACTIONS_COMMITTED);
     } else if (jj_2_1657(2)) {
-      jj_consume_token(LANGUAGE);
+      jj_consume_token(TRANSFORMS);
     } else if (jj_2_1658(2)) {
-      jj_consume_token(LATERAL);
+      jj_consume_token(TRIGGER_SCHEMA);
     } else if (jj_2_1659(2)) {
-      jj_consume_token(LN);
+      jj_consume_token(UNBOUNDED);
     } else if (jj_2_1660(2)) {
-      jj_consume_token(MATCH);
+      jj_consume_token(UNDER);
     } else if (jj_2_1661(2)) {
-      jj_consume_token(MATCH_RECOGNIZE);
+      jj_consume_token(USAGE);
     } else if (jj_2_1662(2)) {
-      jj_consume_token(MEMBER);
+      jj_consume_token(USER_DEFINED_TYPE_NAME);
     } else if (jj_2_1663(2)) {
-      jj_consume_token(MINUTE);
+      jj_consume_token(UTF32);
     } else if (jj_2_1664(2)) {
-      jj_consume_token(MODULE);
+      jj_consume_token(VIEW);
     } else if (jj_2_1665(2)) {
-      jj_consume_token(NATIONAL);
+      jj_consume_token(WORK);
     } else if (jj_2_1666(2)) {
-      jj_consume_token(NEW);
+      jj_consume_token(XML);
     } else if (jj_2_1667(2)) {
-      jj_consume_token(NONE);
+      jj_consume_token(TEMPLATE);
     } else if (jj_2_1668(2)) {
-      jj_consume_token(NTILE);
+      jj_consume_token(ATOMICITY);
     } else if (jj_2_1669(2)) {
-      jj_consume_token(OCCURRENCES_REGEX);
+      jj_consume_token(CACHE_NAME);
     } else if (jj_2_1670(2)) {
-      jj_consume_token(OLD);
+      jj_consume_token(ENCRYPTED);
     } else if (jj_2_1671(2)) {
-      jj_consume_token(ONLY);
+      jj_consume_token(LOGGING);
     } else if (jj_2_1672(2)) {
-      jj_consume_token(OVER);
+      jj_consume_token(KILL);
     } else if (jj_2_1673(2)) {
-      jj_consume_token(PARAMETER);
+      jj_consume_token(SERVICE);
     } else if (jj_2_1674(2)) {
-      jj_consume_token(PERCENT);
+      jj_consume_token(QUERY);
     } else if (jj_2_1675(2)) {
-      jj_consume_token(PERCENT_RANK);
+      jj_consume_token(ANALYZE);
     } else if (jj_2_1676(2)) {
-      jj_consume_token(PORTION);
+      jj_consume_token(ABS);
     } else if (jj_2_1677(2)) {
-      jj_consume_token(POWER);
+      jj_consume_token(ARE);
     } else if (jj_2_1678(2)) {
-      jj_consume_token(PREPARE);
+      jj_consume_token(AT);
     } else if (jj_2_1679(2)) {
-      jj_consume_token(QUALIFY);
+      jj_consume_token(AVG);
     } else if (jj_2_1680(2)) {
-      jj_consume_token(READS);
+      jj_consume_token(BEGIN_PARTITION);
     } else if (jj_2_1681(2)) {
-      jj_consume_token(REF);
+      jj_consume_token(BIT);
     } else if (jj_2_1682(2)) {
-      jj_consume_token(REGR_AVGX);
+      jj_consume_token(CALL);
     } else if (jj_2_1683(2)) {
-      jj_consume_token(REGR_INTERCEPT);
+      jj_consume_token(CASCADED);
     } else if (jj_2_1684(2)) {
-      jj_consume_token(REGR_SXX);
+      jj_consume_token(CHAR);
     } else if (jj_2_1685(2)) {
-      jj_consume_token(RELEASE);
+      jj_consume_token(CHAR_LENGTH);
     } else if (jj_2_1686(2)) {
-      jj_consume_token(RETURN);
+      jj_consume_token(CLOB);
     } else if (jj_2_1687(2)) {
-      jj_consume_token(ROLLBACK);
+      jj_consume_token(COLLATE);
     } else if (jj_2_1688(2)) {
-      jj_consume_token(ROW_NUMBER);
+      jj_consume_token(CONDITION);
     } else if (jj_2_1689(2)) {
-      jj_consume_token(SCOPE);
+      jj_consume_token(CONVERT);
     } else if (jj_2_1690(2)) {
-      jj_consume_token(SECOND);
+      jj_consume_token(COUNT);
     } else if (jj_2_1691(2)) {
-      jj_consume_token(SESSION_USER);
+      jj_consume_token(CUBE);
     } else if (jj_2_1692(2)) {
-      jj_consume_token(SKIP_);
+      jj_consume_token(CURRENT_CATALOG);
     } else if (jj_2_1693(2)) {
-      jj_consume_token(SPECIFICTYPE);
+      jj_consume_token(CURRENT_ROLE);
     } else if (jj_2_1694(2)) {
-      jj_consume_token(SQLSTATE);
+      jj_consume_token(CURSOR);
     } else if (jj_2_1695(2)) {
-      jj_consume_token(START);
+      jj_consume_token(DATETIME);
     } else if (jj_2_1696(2)) {
-      jj_consume_token(STDDEV_SAMP);
+      jj_consume_token(DEC);
     } else if (jj_2_1697(2)) {
-      jj_consume_token(SUBSET);
+      jj_consume_token(DEFINE);
     } else if (jj_2_1698(2)) {
-      jj_consume_token(SUCCEEDS);
+      jj_consume_token(DESCRIBE);
     } else if (jj_2_1699(2)) {
-      jj_consume_token(SYSTEM_TIME);
+      jj_consume_token(DISCONNECT);
     } else if (jj_2_1700(2)) {
-      jj_consume_token(TIME);
+      jj_consume_token(EACH);
     } else if (jj_2_1701(2)) {
-      jj_consume_token(TIMEZONE_MINUTE);
+      jj_consume_token(END);
     } else if (jj_2_1702(2)) {
-      jj_consume_token(TRANSLATE_REGEX);
+      jj_consume_token(END_PARTITION);
     } else if (jj_2_1703(2)) {
-      jj_consume_token(TRIGGER);
+      jj_consume_token(EVERY);
     } else if (jj_2_1704(2)) {
-      jj_consume_token(TRUNCATE);
+      jj_consume_token(EXP);
     } else if (jj_2_1705(2)) {
-      jj_consume_token(UNKNOWN);
+      jj_consume_token(EXTRACT);
     } else if (jj_2_1706(2)) {
-      jj_consume_token(UPSERT);
+      jj_consume_token(FLOAT);
     } else if (jj_2_1707(2)) {
-      jj_consume_token(VARBINARY);
+      jj_consume_token(FRAME_ROW);
     } else if (jj_2_1708(2)) {
-      jj_consume_token(VAR_POP);
+      jj_consume_token(FUSION);
     } else if (jj_2_1709(2)) {
-      jj_consume_token(WHENEVER);
+      jj_consume_token(GRANT);
     } else if (jj_2_1710(2)) {
-      jj_consume_token(WITHIN);
+      jj_consume_token(HOLD);
     } else if (jj_2_1711(2)) {
-      jj_consume_token(MONDAY);
+      jj_consume_token(IMPORT);
     } else if (jj_2_1712(2)) {
-      jj_consume_token(THURSDAY);
+      jj_consume_token(INOUT);
     } else if (jj_2_1713(2)) {
-      jj_consume_token(SUNDAY);
-    } else {
-      jj_consume_token(-1);
-      throw new ParseException();
-    }
-  }
-
-/**
- * Defines a production which can never be accepted by the parser.
- * In effect, it tells the parser, "If you got here, you've gone too far."
- * It is used as the default production for parser extension points;
- * derived parsers replace it with a real production when they want to
- * implement a particular extension point.
- */
-  final public void UnusedExtension() throws ParseException {
-    if (false) {
-
-    } else {
-      jj_consume_token(-1);
-      throw new ParseException();
-    }
-    jj_consume_token(ZONE);
-  }
-
-  final private boolean jj_2_1(int xla) {
-    jj_la = xla; jj_lastpos = jj_scanpos = token;
-    try { return !jj_3_1(); }
-    catch(LookaheadSuccess ls) { return true; }
-    finally { jj_save(0, xla); }
-  }
-
-  final private boolean jj_2_2(int xla) {
-    jj_la = xla; jj_lastpos = jj_scanpos = token;
-    try { return !jj_3_2(); }
-    catch(LookaheadSuccess ls) { return true; }
-    finally { jj_save(1, xla); }
-  }
-
-  final private boolean jj_2_3(int xla) {
-    jj_la = xla; jj_lastpos = jj_scanpos = token;
-    try { return !jj_3_3(); }
-    catch(LookaheadSuccess ls) { return true; }
-    finally { jj_save(2, xla); }
-  }
-
-  final private boolean jj_2_4(int xla) {
-    jj_la = xla; jj_lastpos = jj_scanpos = token;
-    try { return !jj_3_4(); }
-    catch(LookaheadSuccess ls) { return true; }
-    finally { jj_save(3, xla); }
-  }
-
-  final private boolean jj_2_5(int xla) {
-    jj_la = xla; jj_lastpos = jj_scanpos = token;
-    try { return !jj_3_5(); }
+      jj_consume_token(INTEGER);
+    } else if (jj_2_1714(2)) {
+      jj_consume_token(JSON_ARRAYAGG);
+    } else if (jj_2_1715(2)) {
+      jj_consume_token(JSON_OBJECTAGG);
+    } else if (jj_2_1716(2)) {
+      jj_consume_token(JSON_VALUE);
+    } else if (jj_2_1717(2)) {
+      jj_consume_token(LARGE);
+    } else if (jj_2_1718(2)) {
+      jj_consume_token(LEAD);
+    } else if (jj_2_1719(2)) {
+      jj_consume_token(LOCAL);
+    } else if (jj_2_1720(2)) {
+      jj_consume_token(MATCHES);
+    } else if (jj_2_1721(2)) {
+      jj_consume_token(MAX);
+    } else if (jj_2_1722(2)) {
+      jj_consume_token(METHOD);
+    } else if (jj_2_1723(2)) {
+      jj_consume_token(MOD);
+    } else if (jj_2_1724(2)) {
+      jj_consume_token(MONTH);
+    } else if (jj_2_1725(2)) {
+      jj_consume_token(NCHAR);
+    } else if (jj_2_1726(2)) {
+      jj_consume_token(NEXT);
+    } else if (jj_2_1727(2)) {
+      jj_consume_token(NORMALIZE);
+    } else if (jj_2_1728(2)) {
+      jj_consume_token(NULLIF);
+    } else if (jj_2_1729(2)) {
+      jj_consume_token(OCTET_LENGTH);
+    } else if (jj_2_1730(2)) {
+      jj_consume_token(OMIT);
+    } else if (jj_2_1731(2)) {
+      jj_consume_token(OPEN);
+    } else if (jj_2_1732(2)) {
+      jj_consume_token(OVER);
+    } else if (jj_2_1733(2)) {
+      jj_consume_token(PARAMETER);
+    } else if (jj_2_1734(2)) {
+      jj_consume_token(PERCENT);
+    } else if (jj_2_1735(2)) {
+      jj_consume_token(PERCENT_RANK);
+    } else if (jj_2_1736(2)) {
+      jj_consume_token(PORTION);
+    } else if (jj_2_1737(2)) {
+      jj_consume_token(POWER);
+    } else if (jj_2_1738(2)) {
+      jj_consume_token(PREPARE);
+    } else if (jj_2_1739(2)) {
+      jj_consume_token(QUALIFY);
+    } else if (jj_2_1740(2)) {
+      jj_consume_token(READS);
+    } else if (jj_2_1741(2)) {
+      jj_consume_token(REF);
+    } else if (jj_2_1742(2)) {
+      jj_consume_token(REGR_AVGX);
+    } else if (jj_2_1743(2)) {
+      jj_consume_token(REGR_INTERCEPT);
+    } else if (jj_2_1744(2)) {
+      jj_consume_token(REGR_SXX);
+    } else if (jj_2_1745(2)) {
+      jj_consume_token(RELEASE);
+    } else if (jj_2_1746(2)) {
+      jj_consume_token(RETURN);
+    } else if (jj_2_1747(2)) {
+      jj_consume_token(ROLLBACK);
+    } else if (jj_2_1748(2)) {
+      jj_consume_token(ROW_NUMBER);
+    } else if (jj_2_1749(2)) {
+      jj_consume_token(SAFE_OFFSET);
+    } else if (jj_2_1750(2)) {
+      jj_consume_token(SCOPE);
+    } else if (jj_2_1751(2)) {
+      jj_consume_token(SECOND);
+    } else if (jj_2_1752(2)) {
+      jj_consume_token(SESSION_USER);
+    } else if (jj_2_1753(2)) {
+      jj_consume_token(SKIP_);
+    } else if (jj_2_1754(2)) {
+      jj_consume_token(SPECIFICTYPE);
+    } else if (jj_2_1755(2)) {
+      jj_consume_token(SQLSTATE);
+    } else if (jj_2_1756(2)) {
+      jj_consume_token(START);
+    } else if (jj_2_1757(2)) {
+      jj_consume_token(STDDEV_SAMP);
+    } else if (jj_2_1758(2)) {
+      jj_consume_token(SUBSET);
+    } else if (jj_2_1759(2)) {
+      jj_consume_token(SUCCEEDS);
+    } else if (jj_2_1760(2)) {
+      jj_consume_token(SYSTEM_TIME);
+    } else if (jj_2_1761(2)) {
+      jj_consume_token(TIME);
+    } else if (jj_2_1762(2)) {
+      jj_consume_token(TIMEZONE_MINUTE);
+    } else if (jj_2_1763(2)) {
+      jj_consume_token(TRANSLATE_REGEX);
+    } else if (jj_2_1764(2)) {
+      jj_consume_token(TRIGGER);
+    } else if (jj_2_1765(2)) {
+      jj_consume_token(TRUNCATE);
+    } else if (jj_2_1766(2)) {
+      jj_consume_token(UNIQUE);
+    } else if (jj_2_1767(2)) {
+      jj_consume_token(UPPER);
+    } else if (jj_2_1768(2)) {
+      jj_consume_token(VALUE_OF);
+    } else if (jj_2_1769(2)) {
+      jj_consume_token(VARYING);
+    } else if (jj_2_1770(2)) {
+      jj_consume_token(VERSIONING);
+    } else if (jj_2_1771(2)) {
+      jj_consume_token(WINDOW);
+    } else if (jj_2_1772(2)) {
+      jj_consume_token(YEAR);
+    } else if (jj_2_1773(2)) {
+      jj_consume_token(WEDNESDAY);
+    } else if (jj_2_1774(2)) {
+      jj_consume_token(SATURDAY);
+    } else {
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+  }
+
+/**
+ * Defines a production which can never be accepted by the parser.
+ * In effect, it tells the parser, "If you got here, you've gone too far."
+ * It is used as the default production for parser extension points;
+ * derived parsers replace it with a real production when they want to
+ * implement a particular extension point.
+ */
+  final public void UnusedExtension() throws ParseException {
+    if (false) {
+
+    } else {
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+    jj_consume_token(ZONE);
+  }
+
+  final private boolean jj_2_1(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_1(); }
+    catch(LookaheadSuccess ls) { return true; }
+    finally { jj_save(0, xla); }
... 61120 lines suppressed ...