---
metadata:
  - name: generator
    content: Diplodoc Platform v5.51.0
alternate:
  - https://e2e.viewer-test.ydocs.io/en/yql/syntax/discard.md
  - https://e2e.viewer-test.ydocs.io/ru/yql/syntax/discard.md
  - href: https://e2e.viewer-test.ydocs.io/en/yql/syntax/discard.md
    type: text/markdown
    title: Markdown version
  - href: https://e2e.viewer-test.ydocs.io/en/llms.txt?revision=ytsaurus-test-revision5
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://e2e.viewer-test.ydocs.io/en/llms.txt?revision=ytsaurus-test-revision5

# DISCARD

Calculates [SELECT](https://e2e.viewer-test.ydocs.io/en/yql/syntax/select/index.md), [REDUCE](https://e2e.viewer-test.ydocs.io/en/yql/syntax/reduce.md) or [PROCESS](https://e2e.viewer-test.ydocs.io/en/yql/syntax/process.md), but returns no result to the client or to the table. It can't be set at the same time as [INTO RESULT](https://e2e.viewer-test.ydocs.io/en/yql/syntax/into_result.md).

It's good to combine it with `Ensure` to check the final calculation result against the user's criteria.

#### Examples

```yql
DISCARD SELECT 1;
```

```yql
INSERT INTO result_table WITH TRUNCATE
SELECT * FROM
my_table
WHERE value % 2 == 0;

COMMIT;

DISCARD SELECT Ensure(
    0, -- will discard result anyway
    COUNT(*) > 1000,
    "Too small result table, got only " || CAST(COUNT(*) AS String) || " rows"
) FROM result_table;
```
