小编Fer*_*Byn的帖子

来自字符串字段的 AWS Athena json_extract 查询返回空值

我在雅典娜有一张这种结构的桌子

CREATE EXTERNAL TABLE `json_test`(
  `col0` string , 
  `col1` string , 
  `col2` string , 
  `col3` string , 
  `col4` string , 
  )
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.serde2.OpenCSVSerde' 
WITH SERDEPROPERTIES ( 
  'quoteChar'='\"', 
  'separatorChar'='\;') 
Run Code Online (Sandbox Code Playgroud)

像这样的 Json 字符串存储在“col4”中:

{'email': 'test_email@test_email.com', 'name': 'Andrew', 'surname': 'Test Test'}
Run Code Online (Sandbox Code Playgroud)

我正在尝试进行 json_extract 查询:

SELECT json_extract(col4 , '$.email') as email FROM "default"."json_test"
Run Code Online (Sandbox Code Playgroud)

但查询返回空值。

任何帮助,将不胜感激。

json hive amazon-s3 presto amazon-athena

4
推荐指数
1
解决办法
9753
查看次数

标签 统计

amazon-athena ×1

amazon-s3 ×1

hive ×1

json ×1

presto ×1