在使用GeoJSON数据时,Athena中报错HIVE_CURSOR_ERROR。

0

【以下的问题经过翻译处理】 我正在尝试在Athena中设置一个表来查询GeoJSON格式的地理空间数据。我一直在尝试按照这里的示例进行操作:https://docs.aws.amazon.com/athena/latest/ug/geospatial-example-queries.html,但实际情况是一直无法工作,每次运行简单的查询都会出现HIVE_CURSOR_ERROR。

我有一些GeoJSON数据在S3文件夹中,就像这样:

{
	"type": "FeatureCollection",
	"features": [
		{
			"id": "0",
			"type": "Feature",
			"properties": {
				"ID": 123456789
			},
			"geometry": {
				"type": "Polygon",
				"coordinates": [
					[
						[
							-5.31743910570464733,
							58.73284229699937
						],
						[
							-5.3173675298630483,
							58.73284570013168
						],
						[
							-5.3172547539133792,
							58.73284991264882
						],
						[
							-5.31722304203592152,
							58.73285104690907
						],
						[
							-5.3172311032208171,
							58.73294883810302
						],
						[
							-5.3174512653466437,
							58.732947705224115
						],
						[
							-5.31744743304667152,
							58.73291410139787
						],
						[
							-5.31743910570464733,
							58.73284229699937
						]
					]
				]
			}
		},
		{
			"id": "1",
			"type": "Feature",
			"properties": {
				"ID": 987654321
			},
			"geometry": {
				"type": "Polygon",
				"coordinates": [
					[
						[
							-3.41743023894912347,
							40.432765268202344
						],
						[
							-3.41736141173642975,
							40.432767724053
						],
						[
							-3.41724749711747035,
							40.432772009098655
						],
						[
							-3.41721649151368283,
							40.43277324408217
						],
						[
							-3.41722304203592152,
							40.43285104690907
						],
						[
							-3.4172547539133792,
							40.43284991264882
						],
						[
							-3.4173675298630483,
							40.43284570013168
						],
						[
							-3.41743910570464733,
							40.43284229699937
						],
						[
							-3.41743140982736242,
							40.432775538535216
						],
						[
							-3.41743023894912347,
							40.432765268202344
						]
					]
				]
			}
		}
	]
}

并按照示例在Athena中创建表,如下所示:

CREATE external TABLE IF NOT EXISTS mydata
 (
 Id bigint,
 BoundaryShape binary
 )
ROW FORMAT SERDE 'com.esri.hadoop.hive.serde.JsonSerde'
STORED AS INPUTFORMAT 'com.esri.json.hadoop.EnclosedJsonInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION 's3://mybucket/folder/sub/location/';

但是,我对它运行的任何查询都会返回HIVE_CURSOR_ERROR,甚至在只运行SELECT * FROM mydata的时候。

不知道这里是不是做错了什么?

profile picture
专家
已提问 5 个月前20 查看次数
1 回答
0

【以下的回答经过翻译处理】 我在这个stackoverflow问题上找到了答案:https://stackoverflow.com/questions/53923848/amazon-athena-returning-hive-cursor-error-hive-cursor-error-on-geo-json

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则