> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-postgresql-tls-support.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ajustes de sesión de aggregate_*

> Ajustes de sesión de ClickHouse en el grupo aggregate_* generado.

export const VersionHistory = ({rows = []}) => {
  if (rows.length === 0) {
    return null;
  }
  const headers = ["Versión", "Valor predeterminado", "Comentario"];
  const border = "1px solid rgba(128, 128, 128, 0.3)";
  const cell = {
    border,
    padding: "0.25rem 0.5rem",
    textAlign: "start",
    verticalAlign: "top"
  };
  return <details className="not-prose" style={{
    border,
    borderRadius: "0.5rem",
    margin: "0.5rem 0",
    padding: "0.5rem 0.75rem",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <summary style={{
    cursor: "pointer",
    fontWeight: 600,
    opacity: 0.72
  }}>
        Historial de versiones
      </summary>
      <table style={{
    borderCollapse: "collapse",
    width: "100%",
    margin: "0.5rem 0 0"
  }}>
        <thead>
          <tr>
            {headers.map(header => <th key={header} style={{
    ...cell,
    fontWeight: 600,
    opacity: 0.72
  }}>
                {header}
              </th>)}
          </tr>
        </thead>
        <tbody>
          {rows.map((row, row_index) => <tr key={row.id ?? row_index}>
              {(row.items ?? []).map((item, item_index) => <td key={item_index} style={{
    ...cell,
    overflowWrap: "anywhere"
  }}>
                  {item?.label}
                </td>)}
            </tr>)}
        </tbody>
      </table>
    </details>;
};

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>Tipo</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Predeterminado</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Modificable sin reiniciar
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

Estos ajustes están disponibles en [system.settings](/es/reference/system-tables/settings) y se generan automáticamente a partir del [código fuente](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

<div id="aggregate_function_input_format">
  ## aggregate\_function\_input\_format
</div>

<SettingsInfoBlock type="AggregateFunctionInputFormat" default_value="state" />

Formato de la entrada de AggregateFunction durante las operaciones INSERT.

Valores posibles:

* `state` — Cadena binaria con el estado serializado (valor predeterminado). Este es el comportamiento predeterminado, en el que se espera que los valores de AggregateFunction sean datos binarios.
* `value` — El formato espera un único valor del argumento de la función de agregación o, en caso de varios argumentos, una tupla con ellos. Se deserializarán mediante el IDataType correspondiente o DataTypeTuple y luego se agregarán para formar el estado.
* `array` — El formato espera un Array de valores, como se describe en la opción `value` anterior. Todos los elementos del array se agregarán para formar el estado.

**Ejemplos**

Para una tabla con la estructura:

```sql theme={null}
CREATE TABLE example (
    user_id UInt64,
    avg_session_length AggregateFunction(avg, UInt32)
);
```

Con `aggregate_function_input_format = 'value'`:

```sql theme={null}
INSERT INTO example FORMAT CSV
123,456
```

Con `aggregate_function_input_format = 'array'`:

```sql theme={null}
INSERT INTO example FORMAT CSV
123,"[456,789,101]"
```

Nota: los formatos `value` y `array` son más lentos que el formato `state` predeterminado, ya que requieren crear y agregar valores durante la inserción.

<div id="aggregate_functions_null_for_empty">
  ## aggregate\_functions\_null\_for\_empty
</div>

<SettingsInfoBlock type="Bool" default_value="0" />

Activa o desactiva la reescritura de todas las funciones de agregación de una consulta, añadiéndoles el sufijo [-OrNull](/es/reference/functions/aggregate-functions/combinators#-ornull). Actívelo para garantizar la compatibilidad con el estándar SQL.
Se implementa mediante la reescritura de consultas (de forma similar a la configuración [count\_distinct\_implementation](/es/reference/settings/session-settings/count-distinct#count_distinct_implementation)) para obtener resultados coherentes en las consultas distribuidas.

Valores posibles:

* 0 — Deshabilitado.
* 1 — Habilitado.

**Ejemplo**

Considere la siguiente consulta con funciones de agregación:

```sql theme={null}
SELECT SUM(-1), MAX(0) FROM system.one WHERE 0;
```

Con `aggregate_functions_null_for_empty = 0` se obtendría:

```text theme={null}
┌─SUM(-1)─┬─MAX(0)─┐
│       0 │      0 │
└─────────┴────────┘
```

Con `aggregate_functions_null_for_empty = 1`, el resultado sería:

```text theme={null}
┌─SUMOrNull(-1)─┬─MAXOrNull(0)─┐
│          NULL │         NULL │
└───────────────┴──────────────┘
```
