---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - >-
    en/datalens/troubleshooting/errors/ERR-DS_API-DB-CHYT-INVALID_SORTED_JOIN-KEY_IS_EMPTY.md
  - >-
    en/troubleshooting/errors/ERR-DS_API-DB-CHYT-INVALID_SORTED_JOIN-KEY_IS_EMPTY
  - >-
    ru/troubleshooting/errors/ERR-DS_API-DB-CHYT-INVALID_SORTED_JOIN-KEY_IS_EMPTY
  - href: >-
      en/troubleshooting/errors/ERR-DS_API-DB-CHYT-INVALID_SORTED_JOIN-KEY_IS_EMPTY.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: >-
  en/troubleshooting/errors/ERR-DS_API-DB-CHYT-INVALID_SORTED_JOIN-KEY_IS_EMPTY.html
title: >-
  DataLens On-premises error:
  ERR.DS_API.DB.CHYT.INVALID_SORTED_JOIN.KEY_IS_EMPTY
description: >-
  This page describes the `Cannot join: key is empty` DataLens On-premises
  error.
vcsPath: >-
  en/troubleshooting/errors/ERR-DS_API-DB-CHYT-INVALID_SORTED_JOIN-KEY_IS_EMPTY.md
---

# [DataLens On-premises] Cannot join: key is empty

`ERR.DS_API.DB.CHYT.INVALID_SORTED_JOIN.KEY_IS_EMPTY`

This error occurs when CHYT cannot extract a join key from the `ON`/`USING` condition.

To fix it, add at least one direct equality between the key columns and make sure the joined columns are included in the sort key prefixes of both tables.
