[Python] How to check if pyspark dataframe is empty QUICKLY

Discussão em 'Python' iniciado por Stack, Outubro 25, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to check if my pyspark dataframe is empty and I have tried different ways to do that, like:

    df.count() == 0
    df.rdd.isEmpty()
    df.first().isEmpty()


    But all this solutions are to slow, taking up to 2 minutes to run. How can I quicly check if my pyspark dataframe is empty or not? Do anyone have a solution for that?

    Thank you in advance!

    Continue reading...

Compartilhe esta Página