**Use case**

This works:

```
SELECT * FROM hits_100m_obfuscated INTO OUTFILE 'hits.csv' FORMAT CSV
```

But I want this:

```
SELECT * FROM hits_100m_obfuscated INTO OUTFILE 'hits.csv'
```

**Describe the solution you'd like**

Every format can register file extension(s) in format factory.
If format is not specified explicitly, we can detect it automatically by file extension.
It should work for compressed files `hits.csv.gz` as well.

The following extensions should be supported at least:
csv, tsv, parquet, orc, native, json, ndjson, xml, md, avro

**Addition details**

Let's also support omitting the format argument for `file`, `url`, `s3`, `hdfs` table functions. 
{
    resetOutput(
    have_error = false;
    client_exception.reset(
    server_exception.reset(
    if (echo_query_ && *echo_query_)
    {
        writeString(full_query, std_out
        writeChar('\n', std_out
        std_out.next(
    }
    if (is_interactive)
    {
        global_context->setCurrentQueryId(""
        // Generate a new query_id
        fformat : query_id_formats)
        {
            writeString(query_id_format.first, std_out
            writeString(fmt::format(query_id_format.second, fmt::arg("query_id", global_context->getCurrentQueryId())), std_out
            writeChar('\n', std_out
            std_out.next(
        }
    }
    processed_rows = 0;
    written_first_block = false;
    progress_indication.resetProgress(
    profile_events.watch.restart(
    {
        /// Temporarily apply query settings to context.
        std::optional<Settings> old_settings;