【问题标题】:How to find out the total size of data read and which data is belonging to which node in Spark如何找出读取的数据的总大小以及哪些数据属于Spark中的哪个节点
【发布时间】:2021-05-17 01:07:41
【问题描述】:

假设我正在使用 Apache spark 读取这样的数据集:

City | Region |  Population 
A    |     A1  |     150000
A     |    A2    |   50000
B     |    B1    |   250000
C     |    C1     |  350000

在此基础上创建数据框后,假设我根据城市重新分区。现在如果我想知道我的spark集群的哪个节点有A市的信息,可以知道吗?如果是,请解释一下。

请教另一个问题,我如何知道 spark 作为数据帧读取的数据的总大小?

【问题讨论】:

    标签: apache-spark hadoop apache-spark-sql hdfs hadoop-yarn


    【解决方案1】:

    这里有几个问题。

    1.你想看看每个节点正在处理什么样的数据

     Here executor nodes would only perform the operations defined in the rdd or dataframe transformations to a chunk of data that is available in partitions in that executor node.
    

    我认为检查节点内数据的最佳方法可能是为驱动程序和执行程序启用日志记录,并在 rdd/df 操作中写入日志条目。这些日志可以发布到执行程序的本地磁盘并且您需要连接到每个执行器节点以验证属于每个节点的数据

    1. 如果你想知道数据帧中读取的数据帧的总大小,请参考下面 How to find spark RDD/Dataframe size?

    【讨论】:

      猜你喜欢
      • 2013-10-25
      • 2017-02-13
      • 1970-01-01
      • 1970-01-01
      • 2012-02-13
      • 1970-01-01
      • 2011-09-16
      • 1970-01-01
      • 2013-12-09
      相关资源
      最近更新 更多