<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to check the particular column value in spark dataframe ? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-check-the-particular-column-value-in-spark-dataframe/m-p/12062#M6929</link>
    <description>&lt;P&gt;use the agg method to check if the count of rows where columnName contains 0, is equal to the total number of rows in the dataframe, using the following code: df.agg(count("*").alias("total_count"),count(when(col("columnName")===0,1)).alias("zero_count")).filter("total_count == zero_count").count()&lt;/P&gt;&lt;P&gt;This will return 1 if all the rows contain 0 in the columnName and 0 otherwise&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2023 16:03:24 GMT</pubDate>
    <dc:creator>MateuszLomanski</dc:creator>
    <dc:date>2023-01-13T16:03:24Z</dc:date>
    <item>
      <title>how to check the particular column value in spark dataframe ?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-check-the-particular-column-value-in-spark-dataframe/m-p/12061#M6928</link>
      <description>&lt;P&gt;if i want​ to check the the particular column in dataframe is need to contain zero, if its not have zero means , it need to get fail&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 12:37:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-check-the-particular-column-value-in-spark-dataframe/m-p/12061#M6928</guid>
      <dc:creator>databicky</dc:creator>
      <dc:date>2023-01-13T12:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to check the particular column value in spark dataframe ?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-check-the-particular-column-value-in-spark-dataframe/m-p/12062#M6929</link>
      <description>&lt;P&gt;use the agg method to check if the count of rows where columnName contains 0, is equal to the total number of rows in the dataframe, using the following code: df.agg(count("*").alias("total_count"),count(when(col("columnName")===0,1)).alias("zero_count")).filter("total_count == zero_count").count()&lt;/P&gt;&lt;P&gt;This will return 1 if all the rows contain 0 in the columnName and 0 otherwise&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 16:03:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-check-the-particular-column-value-in-spark-dataframe/m-p/12062#M6929</guid>
      <dc:creator>MateuszLomanski</dc:creator>
      <dc:date>2023-01-13T16:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to check the particular column value in spark dataframe ?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-check-the-particular-column-value-in-spark-dataframe/m-p/12064#M6931</link>
      <description>&lt;P&gt;no it doesn't worked,  actually what i want is have one column in spark dataframe as count, for that particular column value is greater than 0 means, it needs to exit.&lt;/P&gt;&lt;P&gt;but the above answer is totally different​&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 12:34:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-check-the-particular-column-value-in-spark-dataframe/m-p/12064#M6931</guid>
      <dc:creator>databicky</dc:creator>
      <dc:date>2023-01-16T12:34:10Z</dc:date>
    </item>
  </channel>
</rss>

