我在雪花中有一张像下面这样的桌子
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|attrs |options |
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|acct |[{"key":"spencer","val":"spencer"},{"key":"mart","val":"mart"},{"key":"red-fin","val":"-"}] |
|fav_activity |[{"key":"movie","val":"movie"},{"key":"books","val":"books"},{"key":"music","val":"music"},{"key":"swimming","val":"swimming"},{"key":"games","val":"games"},{"key":"team","val":"team"},{"key":"food","val":"food"},{"key":"steam-room","val":"\"steam room\""},{"key":"hiking","val":"hiking"}] |
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
现在我需要比较字典列表的每个键和值,并只返回键/值不同的字典的键。
例如,查看 attrs acct
- 列表中有 3 个字典。前两个字典的键和值是相同的,但第三个具有不同的键/值。所以我需要返回第三个字典的键,即red-fin
预期输出:
+---------------+------------+
|attrs |result |
+---------------+------------+
|acct |red-fin |
|fav_activity |steam-room |
+---------------+------------+
有人可以帮我在雪花中做到这一点。
提前致谢。