gpt4 book ai didi

postgresql - 如何将 PostgreSQL 数据加载到 GeoMesa(使用 Cassandra 数据存储)?

转载 作者:行者123 更新时间:2023-11-29 12:50:15 25 4
gpt4 key购买 nike

我尝试通过 JDBC 转换器将 Postresql 数据加载到 Geomesa(使用 Cassandra 数据存储)。

从形状加载工作正常,所以 Cassandra 和 GeoMesa 设置没问题

接下来我尝试从 PostgreSQL 加载数据

命令:

echo "SELECT year, geom, grondgebruik, crop_code, crop_name, fieldid, global_id, area, perimeter, geohash FROM v_gewaspercelen2018"| bin/geomesa-cassandra ingest -c 目录 -P cassandraserver:9042 -k agrodatacube -f 包裹 -C geomesa.converters.parcel -u -p

转换器定义文件 geomesa.converters.parcel 如下所示:

geomesa.converters.parcel = {

type = "jdbc"

connection = "dbc:postgresql://postgresserver:5432/agrodatacube"

id-field="toString($5)"

fields = [

{ name = "fieldid", transform = "$5" }

{ name = "global_id", transform = "$6" }

{ name = "year", transform = "$0" }

{ name = "area", transform = "$7" }

{ name = "perimeter", transform = "$8" }

{ name = "grondgebruik", transform = "$2" }

{ name = "crop_code", transform = "$3" }

{ name = "crop_name", transform = "$4" }

{ name = "geohash", transform = "$9" }

{ name = "geom", transform = "$1" }

]
}

geomesa 输出为:

INFO  Schema 'parcel' exists

INFO Running ingestion in local mode

INFO Ingesting from stdin with 1 thread
[ ] 0% complete 0 i[ ] 0% complete 0 ingested 0 failed in 00:00:01

ERROR Fatal error running local ingest worker on <stdin>

[ ] 0% complete 0 i[ ] 0% complete 0 ingested 0 failed in 00:00:01

INFO Local ingestion complete in 00:00:01

INFO Ingested 0 features with no failures for file: <stdin>

WARN Some files caused errors, ingest counts may not be accurate

有人知道这里出了什么问题吗?

最佳答案

您可以在 logs 文件夹中查看更详细的错误。然而,乍一看,JDBC 转换器遵循standard result set numbering。 ,表示第一个字段是 $1(不是 $0)。此外,您可能需要使用变换函数来变换几何图形,即 geometry($2)

关于postgresql - 如何将 PostgreSQL 数据加载到 GeoMesa(使用 Cassandra 数据存储)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55849341/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com