【发布时间】:2018-04-09 20:13:04
【问题描述】:
我有一张扁平的桌子。我想将其转换为嵌套的 json 格式。
database schema table_name col_name
exploration dbo TestTable name
exploration dbo TestTable last_name
exploration dbo Table_1 name
exploration dbo Table_1 d_id
exploration dbo tblMonitorChange EventType
exploration dbo tblMonitorChange SchemaName
exploration dbo tblMonitorChange ObjectName
exploration dbo tblMonitorChange ObjectType
exploration dbo tblMonitorChange EventDate
exploration dbo tblMonitorChange SystemUser
exploration dbo tblMonitorChange CurrentUser
exploration dbo tblMonitorChange OriginalUser
ReportServer dbo Users UserID
ReportServer dbo Users Sid
ReportServer dbo Users UserType
ReportServer dbo Users AuthType
ReportServer dbo Users UserName
ReportServer dbo Users ServiceToken
ReportServer dbo Users Setting
我正在寻找一个通用的解决方案,而不是硬编码列名。
任何帮助将不胜感激。
【问题讨论】:
标签: python json nested flatten hierarchical