用于将elasticsearch数据导出到csv的cli客户端
bq-sqoop的Python项目详细描述
这个项目只需要一个简单的cli命令来使用cpu从es、postgres等导出数据, 它旨在用于数据工作流中提取数据
注
这仍然是早期的发展和有点粗糙的边缘。 任何错误报告、功能建议等都非常感谢。:)
安装和使用
安装 因为这是PyPi上提供的Python包,所以您可以像 任何其他python包。
# on modern systems with Python you can install with pip $ pip install bq-sqoop # on older systems you can install using easy_install $ easy_install bq-sqoop
用法 命令应该主要是自我记录它们的定义, 通过help命令提供。
$ bq-sqoop usage: bq-sqoop -h arguments: -h, --help show this help message and exit -v, --version Show version and exit. -c CONFIG_FILE, --config_file CONFIG_FILE Toml Config file for the bq-sqoop job.Can be a local file path or a public http link or a GCS fileeg, https://storage.googleapis.com/sample_config.toml or gs://gcs_bucket/sample_config.toml or /tmp/sample_config.toml -d, --debug Debug mode on.
配置文件
您可以在https://github.com/therako/bqsqoop-examples.git找到一个示例存储库
大查询
[bigquery]project_id="destination-google-project-id"dataset_name="destination-dataset"table_name="destination-table-name"gcs_tmp_path="gs://gcs-tmp-bucket/bqsqoop/"
提取器
弹性搜索
[extractor.elasticsearch]url="localhost:9200,localhost:9201"index="source-es-index-name"timeout="60s"scroll_size=500fields=["_all"]
sql
[extractor.sql]sql_bind="postgresql+psycopg2://username:password@127.0.0.1:5432/database"query="select * from table_name"