alex-plekhanov commented on code in PR #13147: URL: https://github.com/apache/ignite/pull/13147#discussion_r3274408870
########## docs/_docs/SQL/sql-calcite.adoc: ########## @@ -121,111 +121,796 @@ QUERY_ENGINE=CALCITE ---- -- -== Memory Quotas [[memory-quotas]] +== SQL Reference -The Calcite-based SQL engine can track and limit heap memory accounted by Calcite query execution operators. -This is useful for protecting a server node from a single large query or from many concurrent memory-heavy queries. +=== DDL -Two types of quotas can be configured in `CalciteQueryEngineConfiguration`: +Data definition language (DDL) statements are compliant with the old H2-based engine. You can find the DDL syntax description link:sql-reference/ddl[here, window=_blank]. -* `globalMemoryQuota` - a per-node heap memory quota for all Calcite SQL queries running on the node. -* `queryMemoryQuota` - a per-node heap memory quota for each Calcite SQL query running on the node. +=== DML -Both quotas are disabled by default (`0`). -The quota values are specified in bytes. -If a quota is exceeded, the query fails with an exception. -The global quota error message contains `Global memory quota for SQL queries exceeded`, and the per-query quota error message contains `Query quota exceeded`. +The new SQL engine mostly inherits data manipulation language (DML) statements syntax from the Apache Calcite framework. See the Apache Calcite SQL grammar description link:https://calcite.apache.org/docs/reference.html[here, window=_blank]. -The quota is applied to query execution structures that keep rows in heap memory, for example sorting, hash joins, hash aggregates, set operations, collection operations, spools, and result materialization. -It is not a process memory limit and it does not account for Ignite data regions, direct memory, JVM native memory, or the operating system page cache. -The quotas are per-node. -For a distributed query, total memory consumption across the cluster can be higher because the limit is applied independently on every participating node. -Size these quotas together with `-Xmx` and the expected SQL concurrency. +In most cases, statement syntax is compliant with the old SQL engine. But there are still some differences between DML dialects in H2-based engine and Calcite-based engine. For example, note the `MERGE` statement syntax has changed. -[tabs] --- -tab:XML[] -[source,xml] ----- -<bean class="org.apache.ignite.configuration.IgniteConfiguration"> - <property name="sqlConfiguration"> - <bean class="org.apache.ignite.configuration.SqlConfiguration"> - <property name="queryEnginesConfiguration"> - <list> - <bean class="org.apache.ignite.calcite.CalciteQueryEngineConfiguration"> - <property name="default" value="true"/> - <property name="globalMemoryQuota" value="#{4L * 1024 * 1024 * 1024}"/> - <property name="queryMemoryQuota" value="#{512L * 1024 * 1024}"/> - </bean> - </list> - </property> - </bean> - </property> -</bean> ----- -tab:Java[] -[source,java] ----- -IgniteConfiguration cfg = new IgniteConfiguration().setSqlConfiguration( - new SqlConfiguration().setQueryEnginesConfiguration( - new CalciteQueryEngineConfiguration() - .setDefault(true) - .setGlobalMemoryQuota(4L * 1024 * 1024 * 1024) - .setQueryMemoryQuota(512L * 1024 * 1024) - ) -); ----- --- +=== Supported Functions -== SQL Reference +The Calcite-based SQL engine currently supports the following user-facing functions and operators. +Functions marked as Ignite-specific are provided through Ignite's Calcite operator table. Review Comment: We shouldn't mention some functions as Ignite-specific. Operator table - it's an internal API entity, should not be exposed to the user. Let's remove this line. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
