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

> El motor `Dictionary` muestra los datos del diccionario como una tabla de ClickHouse.

# Motor de tabla Dictionary

El motor `Dictionary` muestra los datos del [diccionario](/es/reference/statements/create/dictionary) como una tabla de ClickHouse.

<div id="example">
  ## Ejemplo
</div>

Por ejemplo, considere un diccionario de `products` con la siguiente configuración:

```xml theme={null}
<dictionaries>
    <dictionary>
        <name>products</name>
        <source>
            <odbc>
                <table>products</table>
                <connection_string>DSN=some-db-server</connection_string>
            </odbc>
        </source>
        <lifetime>
            <min>300</min>
            <max>360</max>
        </lifetime>
        <layout>
            <flat/>
        </layout>
        <structure>
            <id>
                <name>product_id</name>
            </id>
            <attribute>
                <name>title</name>
                <type>String</type>
                <null_value></null_value>
            </attribute>
        </structure>
    </dictionary>
</dictionaries>
```

Consulta los datos del diccionario:

```sql theme={null}
SELECT
    name,
    type,
    key,
    attribute.names,
    attribute.types,
    bytes_allocated,
    element_count,
    source
FROM system.dictionaries
WHERE name = 'products'
```

```text theme={null}
┌─name─────┬─type─┬─key────┬─attribute.names─┬─attribute.types─┬─bytes_allocated─┬─element_count─┬─source──────────┐
│ products │ Flat │ UInt64 │ ['title']       │ ['String']      │        23065376 │        175032 │ ODBC: .products │
└──────────┴──────┴────────┴─────────────────┴─────────────────┴─────────────────┴───────────────┴─────────────────┘
```

Puedes usar las funciones [dictGet\*](/es/reference/functions/regular-functions/ext-dict-functions) para obtener los datos del diccionario en este formato.

Esta vista no resulta útil cuando necesitas obtener datos sin procesar o realizar una operación `JOIN`. En esos casos, puedes usar el motor `Dictionary`, que muestra los datos del diccionario en una tabla.

Sintaxis:

```sql theme={null}
CREATE TABLE %table_name% (%fields%) engine = Dictionary(%dictionary_name%)`
```

Ejemplo de uso:

```sql theme={null}
CREATE TABLE products (product_id UInt64, title String) ENGINE = Dictionary(products);
```

Bien

Echa un vistazo a lo que hay en la tabla.

```sql theme={null}
SELECT * FROM products LIMIT 1;
```

```text theme={null}
┌────product_id─┬─title───────────┐
│        152689 │ Some item       │
└───────────────┴─────────────────┘
```

**Véase también**

* [Función dictionary](/es/reference/functions/table-functions/dictionary)
