blob: 79ec9875122e18533f98d749a0d60c305fe664ad [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept rev="IMPALA-3671" id="scratch_limit">
<title>SCRATCH_LIMIT Query Option</title>
<titlealts audience="PDF"><navtitle>SCRATCH_LIMIT</navtitle></titlealts>
<data name="Category" value="Impala"/>
<data name="Category" value="Impala Query Options"/>
<data name="Category" value="Memory"/>
<data name="Category" value="Developers"/>
<data name="Category" value="Data Analysts"/>
<indexterm audience="hidden">SCRATCH_LIMIT query option</indexterm>
Specifies the maximum amount of disk storage, in bytes, that any Impala query can consume
on any host using the <q>spill to disk</q> mechanism that handles queries that exceed
the memory limit.
<p conref="../shared/impala_common.xml#common/syntax_blurb"/>
Specify the size in bytes, or with a trailing <codeph>m</codeph> or <codeph>g</codeph> character to indicate
megabytes or gigabytes. For example:
<!-- Examples adapted from impala_parquet_file_size.xml.
To do: demonstrate with queries that succeed / fail
based on the query option setting, and interaction
with MEM_LIMIT. -->
<codeblock>-- 128 megabytes.
set SCRATCH_LIMIT=134217728
-- 512 megabytes.
-- 1 gigabyte.
<p conref="../shared/impala_common.xml#common/usage_notes_blurb"/>
A value of zero turns off the spill to disk feature for queries
in the current session, causing them to fail immediately if they
exceed the memory limit.
The amount of memory used per host for a query is limited by the
<codeph>MEM_LIMIT</codeph> query option.
The more Impala daemon hosts in the cluster, the less memory is used on each host,
and therefore also less scratch space is required for queries that
exceed the memory limit.
<b>Type:</b> numeric, with optional unit specifier
<b>Default:</b> -1 (amount of spill space is unlimited)
<p conref="../shared/impala_common.xml#common/related_info"/>
<xref href="impala_scalability.xml#spill_to_disk"/>,
<xref href="impala_mem_limit.xml#mem_limit"/>