如何将PostgreSQL数据加载到GeoMesa(使用Cassandra数据存储)?
我试图通过JDBC转换器将Postresql数据加载到Geomesa(带有Cassandra数据存储) 从shape加载效果很好,因此Cassandra和GeoMesa设置是可以的 接下来,我尝试从PostgreSQL加载数据 命令: echo“选择年份,geom,grondgebruik,crop_代码,crop_名称,fieldid,global_id,面积,周长,来自v_Gewspercelen2018的geohash”| bin/geomesa cassandra ingest-c catalog-p cassandraserver:9042-k agrodatacube-f parcel-c geomesa.converters.parcel-u-p 转换器定义文件geomesa.converters.package如下所示:如何将PostgreSQL数据加载到GeoMesa(使用Cassandra数据存储)?,postgresql,cassandra,geomesa,Postgresql,Cassandra,Geomesa,我试图通过JDBC转换器将Postresql数据加载到Geomesa(带有Cassandra数据存储) 从shape加载效果很好,因此Cassandra和GeoMesa设置是可以的 接下来,我尝试从PostgreSQL加载数据 命令: echo“选择年份,geom,grondgebruik,crop_代码,crop_名称,fieldid,global_id,面积,周长,来自v_Gewspercelen2018的geohash”| bin/geomesa cassandra ingest-c ca
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
存在信息架构“包裹”
信息在本地模式下运行摄取
使用1个线程从stdin摄取信息
[]0%完成0 i[]0%完成0摄取0在00:00:01失败
错误在上运行本地摄取工作程序时发生致命错误
[]0%完成0 i[]0%完成0摄取0在00:00:01失败
信息本地摄取在00:00:01完成
信息摄取了0项功能,但文件没有失败:
警告某些文件导致错误,摄取计数可能不准确
有人知道这里出了什么问题吗?您可以在
日志
文件夹中查看更多详细错误。然而,乍一看,JDBC转换器如下,这意味着第一个字段是$1
(而不是$0
)。此外,您可能需要使用变换功能变换几何体,即几何体($2)
谢谢Emilio,两个建议都很有意义