5

Mysql 中的 JSON 字段如何清洗出来?

 2 years ago
source link: https://www.v2ex.com/t/810684
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  MySQL

Mysql 中的 JSON 字段如何清洗出来?

  Geekerstar · 1 天前 · 1636 次点击

由于历史原因,一个 MySQL 表里有个字段存的是 JSON 字符串,现在需要将这个 JSON 字符串转为结构化数据,做一些处理,有没有好的办法做清洗呢?

10 条回复    2021-10-27 10:08:21 +08:00

nemo95

nemo95   1 天前

pandas 不是有个 read_json 的函数吗

NjcyNzMzNDQ3

NjcyNzMzNDQ3   1 天前   ❤️ 1

mysql 只能这种写法

SELECT JSON_EXTRACT(column, "$[0].desc");

CEBBCAT

CEBBCAT   1 天前

什么叫结构化数据? JSON 已经是结构化数据了呀

RangerWolf

RangerWolf   1 天前   ❤️ 1

@CEBBCAT 我理解 json 最多应该是半结构化数据~

heart4lor

heart4lor   1 天前

json 怎么就半结构化了 -_-|| 各语言反序列化不就拿到了吗

ETiV

ETiV   1 天前 via iPhone

他点意思应该是 json =schemeless

liuxu

liuxu   1 天前

mysql5.7 支持 JSON 类型,然后创建虚拟字段或者直接 ORM

littlewing

littlewing   1 天前

mysql 的 json 类型支持直接按 key 读取,也支持安某一个 key 建索引,没必要拆开吧

davionnini

davionnini   1 天前

数据量不大用脚本就行,还是控制时间和速度

fuchaofather

fuchaofather   19 小时 42 分钟前

数据量不大写个脚本就行了

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK