从DynamicFrame类中检索键的值? [英] Retrieve value for a key from DynamicFrame class?

查看:98
本文介绍了从DynamicFrame类中检索键的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Python DynamicFrame,如何仅检索列值? 文档

For Python DynamicFrame, how to retrieve only column value? Documentation

dynamicFrame.show() # getting key and value, for eg: {"key1", "value1"}

但是我必须检索特定键的唯一值(例如"key1").

But I have to retrieve the only value for a particular key (say "key1").

推荐答案

该显示将显示列的值.如果您想要特定的键", (我想您是指列的特定值)可以简单地做到:

The show display the column's values. If you want a specific "key" (I guess you mean a specific value for a column) you can simply do:

import pyspark.sql.functions as F

dynamicFrame.toDF().filter(F.col("mycol") == 'mykey').show()

这篇关于从DynamicFrame类中检索键的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆