**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. 
{
                std::cerr << "Got a transient error from the server, will"
                        << " retry (" << retries_left << " retries left)";
            }
            else
            {
                throw;
            }
        }
    }
    assert(retries_left > 0
}
/// Receives and processes packets coming from server.
/// Also checks if query execution should be cancelled.
void ClientBase::receiveResult(ASTPtr parsed_query)
{
    bool cancelled = false;
    QueryInterruptHandler query_interrupt_handler;
    // TODO: get the  from commandline.
    const auto receive_timeout = connection_parameters.timeouts.receive_timeout;
    constexpr size_t default_ = 1000000; /// in microseconds
    constexpr sival = 5000; /// in microseconds
    const size_t 
        = std::max(min_, std::min<size_t>(receive_timeout.totalMicroseconds(), default_)
    bool break_on_timeout = connection->getConnectionType() != IServerConnection::Type::LOCAL;
    while (true)
    {
        Stopwatch receive_watch(CLOCK_MONOTONIC_COARSE
        while (true)
        {