Skip to content

Commit

Permalink
合并README
Browse files Browse the repository at this point in the history
  • Loading branch information
jilstingray committed Apr 14, 2023
1 parent 249c920 commit f315d19
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 62 deletions.
64 changes: 60 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ This connector allows Presto to query data stored in CSV files from local or SFT
Download the source code of Presto from [GitHub](https://github.com/prestodb/presto/), copy `presto-csv` into it, and add the following line to `pom.xml` under the root module:

```xml

<module>presto-csv</module>
```

Expand Down Expand Up @@ -47,9 +46,66 @@ csv.password=xxx

## Known issues

Presto does not support uppercase table names (see [this issue](https://github.com/prestodb/presto/issues/2863)). The connector can not recognize the file if its name contains
uppercase letters either.
Presto does not support case-sensitive identifiers (see [this issue](https://github.com/prestodb/presto/issues/2863)). The connector cannot recognize the file that has uppercase letters in its path either.

## TODO

- [ ] Support HDFS, HTTP Server, etc.

------

Presto CSV connector,支持查询本地或 SFTP 服务器上的 CSV 文件。

## 编译

[GitHub](https://github.com/prestodb/presto/) 获取 Presto 源码,将本项目复制进去,在根目录的 `pom.xml` 中添加模块:

```xml
<module>presto-csv</module>
```

## 配置

创建配置文件 `etc/catalog/csv.properties`。读取本地文件的配置如下:

```
connector.name=csv
csv.protocol=sftp
csv.base=/path/to/dir
csv.splitter=,
csv.suffix=csv
csv.host=xxx.xxx.xxx.xxx
csv.port=xxx
csv.username=xxx
csv.password=xxx
```

* `csv.base` 为根目录,schema 对应二级目录,table 对应二级目录下的文件名。

* `csv.splitter` 可以指定分隔符,默认为 `,`

* `csv.suffix` 可以指定文件后缀,默认为 `csv`

* 文件第一行必须是字段名。

也可以从 SFTP 服务器读取文件:

```
connector.name=csv
csv.protocol=sftp
csv.base=/path/to/dir
csv.splitter=,
csv.suffix=csv
csv.host=xxx.xxx.xxx.xxx
csv.port=xxx
csv.username=xxx
csv.password=xxx
```

## 已知问题

Presto 不支持大写表名(见 [这个 issue](https://github.com/prestodb/presto/issues/2863)),该连接器也不支持读取路径中包含大写字母的文件。

## TODO

- [ ] Support HDFS, HTTP Server, etc.
- [ ] 支持 HDFSHTTP 等协议。
58 changes: 0 additions & 58 deletions README.zh-CN.md

This file was deleted.

0 comments on commit f315d19

Please sign in to comment.