**Use case**

ClickHouse already throws exception if the data for INSERT is empty:

```
Code: 108. DB::Exception: No data to insert
```

Let's introduce a setting, enabled by default, to control this behavior.
The user will be able to disable it to allow empty INSERTs.

This is useful in some batch scripts.
{
        /// Temporarily apply query settings to context.
        std::optional<Settings> old_settings;
        SCOPE_EXIT_SAFE({
            if (old_settings)
                global_context->setSettings(*old_settings
        }
        auto apply_query_settings = [&](const IAST & settings_ast)
        {
            if (!old_settings)
                old_settings.emplace(global_context->getSettingsRef()
            global_context->applySettingsChanges(settings_ast.as<ASTSetQuery>()->changes
        };
        const auto * insert = parsed_query->as<ASTInsertQuery>(
        if (insert && insert->settings_ast)
            apply_query_settings(*insert->settings_ast
        /// FIXME: try to prettify this cast using `as<>()`
        const auto * with_output = dynamic_cast<const ASTQueryWithOutput *>(parsed_query.get()
        if (with_output && with_output->settings_ast)
            apply_query_settings(*with_output->settings_ast
        if (!connection->checkConnected())
            connect(
        ASTPtr input_function;
        if (insert && insert->select)
            insert->tryFindInputFunction(input_function
        bool is_async_insert = global_context->getSettingsRef().async_insert && insert && insert->hasInlinedData(
        /// INSERT query for which data transfer is needed (not an INSERT SELECT or input()) is processed separately.
        if (insert && (!insert->select || input_function) && !insert->watch && !is_async_insert)
        {
            if (input_function && insert->format.empty())