**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. 
// If there are only comments left until the end of file, we just
    // stop. The parser can't handle this situation because it always
    // expects that there is some query that it can parse.
    // We can get into this situation because the parser also doesn't
    // skip the trailing comments after parsing a query. This is because
    // they may as well be the leading comments for the next query,
    // and it makes more sense to treat them as such.
    {
        Tokens tokens(this_query_begin, all_queries_end
        IParser::Pos token_iterator(tokens, global_context->getSettingsRef().max_parser_depth
        if (!token_iterator.isValid())
            return MultiQueryProcessingStage::QUERIES_END;
    }
    this_query_end = this_query_begin;
    try
    {
        parsed_query = parseQuery(th all_queries_end, true
    }
    catch (Exception & e)
    {
        current_exception.emplace(e
        return MultiQueryProcessingStage::PARSING_EXCEPTION;
    }
    if (!parsed_query)
    {
        if (ignore_error)
        {
            Tokens tokens(this_query_begin, all_queries_end
            IParser::Pos token_iterator(tokens, global_context->getSettingsRef().max_parser_depth
            while (token_iterator->type != TokenType::Semicolon && token_iterator.isValid())