<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Om Takalkar on Medium]]></title>
        <description><![CDATA[Stories by Om Takalkar on Medium]]></description>
        <link>https://medium.com/@omtakalkar?source=rss-752021423e24------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UN6p9hTTWEPS7E8HewIsdQ@2x.jpeg</url>
            <title>Stories by Om Takalkar on Medium</title>
            <link>https://medium.com/@omtakalkar?source=rss-752021423e24------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 18:21:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@omtakalkar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[PySpark Made Easy:Exploring PySpark’s Most Useful Functions]]></title>
            <link>https://medium.com/@omtakalkar/pyspark-made-easy-exploring-pysparks-most-useful-functions-d7ada8619690?source=rss-752021423e24------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7ada8619690</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pyspark-dataframes]]></category>
            <category><![CDATA[pyspark]]></category>
            <dc:creator><![CDATA[Om Takalkar]]></dc:creator>
            <pubDate>Sat, 22 Apr 2023 14:42:00 GMT</pubDate>
            <atom:updated>2023-04-25T08:52:15.863Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*Pa7PO1v7bANI7C-eHMS_PQ.png" /><figcaption>Reference: <a href="https://spark.apache.org/">https://spark.apache.org/</a></figcaption></figure><p>Pyspark, is a Python API for Apache Spark, a powerful open-source big data processing framework. Pyspark provides a distributed computing engine that enables processing of large datasets by distributing the computation across multiple nodes in a cluster. Pyspark is suitable for working with large datasets that cannot fit in memory.</p><p>Apache Spark is a powerful big data processing engine that enables data engineers and data scientists to perform complex data analysis tasks. One of the key features of Apache Spark is its ability to handle structured, semi-structured, and unstructured data. In this article, I will be sharing data analysis techniques using Apache Spark on a dataset. These techniques include selecting, filtering, transforming, aggregating data using various functions such as <strong>select()</strong>, <strong>collect()</strong>, , <strong>withColumn()</strong>, <strong>where(), </strong><strong>filter(), </strong><strong>sort(), </strong><strong>groupBy, </strong><strong>UDF, </strong><strong>transform, </strong><strong>apply, </strong><strong>map, </strong><strong>flatMap, </strong><strong>pivot, and </strong><strong>dateTimestamp</strong>. By the end of this article, you will have a better understanding of how to leverage Apache Spark and above functions for your data analysis tasks.</p><p>Getting Started with PySpark</p><p>To use PySpark, we first need to import the necessary modules. We can do this by running the following code:</p><pre>from pyspark.sql import SparkSession</pre><p>This code imports the SparkSession module, which provides an entry point for interacting with Spark. We can then create a SparkSession object by running the following code:</p><pre>&quot;spark = SparkSession.builder.appName(&quot;learnsparkwithOm&quot;).getOrCreate()&quot;<br></pre><p>This code creates a SparkSession object named “learnsparkwithOm”. The getOrCreate() method ensures that if a SparkSession object with the same name already exists, it will return that object instead of creating a new one.</p><p><strong>Loading Data into PySpark<br></strong>Once we’ve created a SparkSession object, we can start loading data into PySpark. PySpark provides several methods for loading data, such as reading from a CSV file, a JSON file, or a database<br>For example, let’s say we have a CSV file named “data.csv” with the following content:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xIv5QF9nm_93xd2eBDRFg.png" /><figcaption>This code reads the data from the CSV file and displays it in a table format. The header=True argument tells PySpark that the first row of the file contains the column names, and the inferSchema=True argument tells PySpark to infer the data types of the columns</figcaption></figure><p>Let’s explore the data</p><p><strong>select()</strong> - to select specific columns from the dataset:</p><pre>from pyspark.sql.functions import col<br>df.select(col(&quot;invoice_date&quot;), col(&quot;description&quot;), col(&quot;amount_spent&quot;)).show(5)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*8QyRAQszS1X1z2Be_P_nqw.png" /><figcaption>showing top 5 rows</figcaption></figure><p><strong>collect()</strong> - to return the entire dataset as a list of rows:</p><pre>df.limit(5).collect()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2shbmWD5PP6wipHwDAt7qw.png" /><figcaption>showing top 5 rows</figcaption></figure><p><strong>WithColumn()</strong> : The withColumn() function is used to create a new column by applying a given function to an existing column.</p><ol><li>Creating a new column ‘total_price’ by multiplying ‘quantity’ and ‘unit_price’</li></ol><pre>df = df.withColumn(&quot;total_price&quot;, col(&quot;quantity&quot;) * col(&quot;unit_price&quot;)) df.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YadASRaSsk0tURj_G29F7Q.png" /></figure><p>2. Creating a new column ‘year’ from ‘year_month’</p><pre>from pyspark.sql.functions import substring<br> df = df.withColumn(&quot;year&quot;, substring(col(&quot;year_month&quot;), 1, 4))<br> df.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uSbSrV2wFIeHxxvM8kH1sQ.png" /></figure><p>3. Creating a new column ‘month_name’ from ‘month&#39;</p><pre>from pyspark.sql.functions import month<br>df = df.withColumn(&quot;month_name&quot;, month(col(&quot;invoice_date&quot;)))<br>df.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwPgoJoabcnm8Q_rLZ0zug.png" /></figure><p><strong>Where() / Filter():</strong> Filter rows based on a condition</p><pre>#1st example <br>df.filter(col(&quot;amount_spent&quot;) &gt; 100).show(5)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*87llfWwGSfksTCRI30a9jA.png" /></figure><pre>#2 example <br>df.where(col(&quot;country&quot;) == &quot;United Kingdom&quot;).show(5)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*atVbqXCv0-7_d-nh7TgXQQ.png" /></figure><p><strong>orderBy()/sort(): </strong>sorting the data based on one or more columns</p><ol><li>Order by quantity in descending order and then by unit_price in ascending order</li></ol><pre>df.orderBy(df.quantity.desc(), df.unit_price.asc()).show(10)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yOrh7IlxhIhPAW7mjJcPeA.png" /></figure><p>2. Order by year_month in descending order and then by day descending order</p><pre>df.orderBy(df.year_month.desc(), df.day.desc()).show(10)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZScyJqBFKVk6KiTyeLH-A.png" /></figure><p>3. Sort by hour in descending order</p><pre>df.sort(df.hour.desc()).show(10)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3QY3t12w-J9jLwBstn95mA.png" /></figure><p>4. Sort by country in descending order and then by quantity in ascending order</p><pre>df.sort(df.country.desc(), df.quantity.asc()).show(10)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LqyeMdw5QCQCP08MJqmBmw.png" /></figure><p><strong>GroupBy():</strong> Group the data by one or more columns and perform an aggregate function on the other columns</p><ol><li>Group by custid and show the total amount spent by each customer</li></ol><pre>from pyspark.sql.functions import sum<br>df.groupBy(&quot;cust_id&quot;).agg(sum(&quot;amount_spent&quot;).alias(&quot;total_amount_spent&quot;)).show(10)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/238/1*Gy6hhh06Dm6rOhe4qQU-vw.png" /></figure><p>2. Group by year_month and country and show the total amount spent in each country for each month</p><pre>df.groupBy(&quot;year_month&quot;, &quot;country&quot;).agg(sum(&quot;amount_spent&quot;).alias(&quot;total_amount_spent&quot;)).show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*Dkxv4Wpanz6aEtAI8TpUTg.png" /></figure><p>code to use groupBy() and sort() functions together</p><pre># Group by country and calculate total amount spent<br>country_spending = df.groupBy(&quot;country&quot;).agg(sum(&quot;amount_spent&quot;).alias(&quot;total_spending&quot;))<br><br># Sort the resulting DataFrame by total spending in descending order<br>sorted_spending = country_spending.sort(&quot;total_spending&quot;, ascending=False)<br><br># Show the top 10 countries with highest total spending<br>sorted_spending.show(10)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*99kxzlovRIC3C8ZsL8huPA.png" /><figcaption>The resulting DataFrame sorted_spending has the same two columns as country_spending, but the rows are sorted by the total_spending column.</figcaption></figure><p><strong>UDF():</strong> User-Defined Functions (UDFs) are a way to extend the functionality of Spark with custom code. UDFs can be used to apply custom transformations to columns or to create entirely new columns based on existing data. Here are 4different ways UDF can be used on the dataset:</p><ol><li>Using UDF to convert the invoice_date column to a timestamp datatype:</li></ol><pre>from pyspark.sql.functions import udf<br>from pyspark.sql.types import TimestampType<br><br>def convert_to_timestamp(date_str):<br> return datetime.datetime.strptime(date_str, &#39;%m/%d/%Y %H:%M&#39;).timestamp()<br><br>timestamp_udf = udf(convert_to_timestamp, TimestampType())<br><br>df = df.withColumn(&quot;timestamp&quot;, timestamp_udf(df.invoice_date))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*z_6-jieSpedqHBsF2BjzjA.png" /><figcaption>timestamp column with TimestampType()</figcaption></figure><p>2. Using UDF to add a new column based on a combination of existing columns:</p><pre>from pyspark.sql.types import StringType<br>from datetime import datetime<br><br>def concat_description_country(description, country):<br>  return description + &quot;_&quot; + country<br><br>concat_udf = udf(concat_description_country, StringType())<br><br>df = df.withColumn(&quot;description_country&quot;, concat_udf(df.description, df.country))<br>df.display()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3-VawClx2ih2ZI6EI2myEA.png" /></figure><p>3. Using UDF to apply a custom aggregation function to a groupBy operation:</p><pre>from pyspark.sql.functions import sum<br>from pyspark.sql.types import DoubleType<br><br>def custom_sum(column):<br> return column * 2<br><br>custom_sum_udf = udf(custom_sum, DoubleType())<br><br>df.groupBy(&quot;country&quot;).agg(custom_sum_udf(sum(&quot;amount_spent&quot;)).alias(&quot;custom_total_spent&quot;)).show()<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*G5UHJKEu2oFNAmRaUIH-zg.png" /><figcaption>performed a groupBy operation on a DataFrame called df, grouping by the &quot;country&quot; column. It then uses a custom defined UDF called custom_sum to calculate a custom aggregate value for each group, by multiplying the sum of the &quot;amount_spent&quot; column by 2. Finally, it renames the resulting column as &quot;custom_total_spent&quot; and shows the resulting DataFrame.</figcaption></figure><p>4. Using UDF to apply a custom filter operation to a dataframe:</p><pre>from pyspark.sql.types import BooleanType<br><br>def filter_country(country):<br>  allowed_countries = [&quot;USA&quot;, &quot;UK&quot;, &quot;Canada&quot;]<br>  return country in allowed_countries<br><br>filter_udf = udf(filter_country, BooleanType())<br><br>ecom_df_filtered = df.filter(filter_udf(df.country)).show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6muw65zJwt2-MWsJqikM2g.png" /><figcaption>This code creates a UDF filter_country which takes a country name as input and checks if it is present in a list of allowed countries ([&quot;USA&quot;, &quot;UK&quot;, &quot;Canada&quot;]). It then applies this UDF on the country column of a Spark DataFrame df using the filter function to get a new filtered DataFrame ecom_df_filtered.</figcaption></figure><p>5. Define a UDF to classify the items into categories based on their descriptions, and apply it to the dataframe:</p><pre>from pyspark.sql.functions import udf<br>from pyspark.sql.types import StringType<br>  category_mapping = <br>{<br>    &quot;electronics&quot;: [&quot;phone&quot;, &quot;laptop&quot;, &quot;tablet&quot;, &quot;camera&quot;],<br>    &quot;clothing&quot;: [&quot;shirt&quot;, &quot;pants&quot;, &quot;dress&quot;, &quot;jacket&quot;],<br>    &quot;household&quot;: [&quot;bed&quot;, &quot;chair&quot;, &quot;table&quot;, &quot;lamp&quot;],<br>    &quot;food&quot;: [&quot;coffee&quot;, &quot;tea&quot;, &quot;chocolate&quot;, &quot;cake&quot;]<br>}<br>def classify_item(description):<br>    for category, items in category_mapping.items():<br>        for item in items:<br>            if item in description.lower():<br>                return category<br>    return &quot;other&quot;<br><br>classify_item_udf = udf(classify_item, StringType())<br><br>df.withColumn(&quot;item_category&quot;, classify_item_udf(&quot;description&quot;)).show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5r8jNznlY-BqiYIztxK_FQ.png" /></figure><p><strong>transform()</strong>: Transform is a higher-order function that allows you to apply a function to each element in a column or array column, and then return a new column with the transformed data. Here are different ways transform can be used on the ecom dataset:</p><ol><li>Using transform to tokenize the description column:</li></ol><pre>from pyspark.sql.functions import split<br><br>df.withColumn(&quot;description_tokens&quot;, split(df.description, &quot; &quot;)).show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ksI-b4DLKqzNQ5pljWmkqQ.png" /></figure><p>2. Using transform to normalize a column of numeric data:</p><pre>from pyspark.ml.feature import VectorAssembler, StandardScaler<br><br># Convert the &quot;amount_spent&quot; column to DoubleType<br>df = df.withColumn(&quot;amount_spent&quot;, col(&quot;amount_spent&quot;).cast(DoubleType()))<br><br># Create a vector column from the &quot;amount_spent&quot; column<br>vectorAssembler = VectorAssembler(inputCols=[&quot;amount_spent&quot;], outputCol=&quot;amount_spent_vec&quot;)<br>df = vectorAssembler.transform(df)<br><br># Apply the StandardScaler to the vector column<br>scaler = StandardScaler(inputCol=&quot;amount_spent_vec&quot;, outputCol=&quot;amount_spent_normalized&quot;)<br><br>scaler.fit(df).transform(df).show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJgRi8BmAsGWnV6YI0LdUQ.png" /><figcaption>created a vector column from the “amount_spent” column using the “vectorAssembler” function, and then apply the StandardScaler to the vector column. containing the standardized values of the “amount_spent” column.</figcaption></figure><p><strong>apply():</strong> apply a user-defined function (UDF) to each row of the DataFrame</p><ol><li>Top 10 most frequently occurring words in the description column.</li></ol><pre># Import necessary functions<br>from pyspark.sql.functions import col<br><br># Create an RDD from the DataFrame<br>ecom_rdd = df.rdd<br><br># Define a function to extract the desired column and return a new RDD<br>def extract_description(row):<br>    return row.description.split()<br><br># Use flatMap() function to extract the desired column and return a new RDD<br>description_rdd = ecom_rdd.flatMap(extract_description)<br><br># Apply transformations on the new RDD<br># Count the number of occurrences for each word in the description column<br>word_count_rdd = description_rdd.map(lambda word: (word, 1)) \<br>                                .reduceByKey(lambda a, b: a + b) \<br>                                .sortBy(lambda x: -x[1])<br><br># Collect the results for visualization or further analysis<br>word_count = word_count_rdd.collect()<br><br># Print the top 10 most frequently occurring words in the description column<br>for i in range(10):<br>    print(word_count[i])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/177/1*DMrKYe8klf75Q3l0gK1FXg.png" /><figcaption>we create an RDD from the DataFrame using rdd() function, then use flatMap() function to extract words from the description column. We then apply transformations on the new RDD to count the number of occurrences for each word in the description column. Finally, we collect the results and print the top 10 most frequently occurring words in the description column.</figcaption></figure><p>Another way</p><pre>top_words = df.rdd.flatMap(lambda row: row[&quot;description&quot;].split(&quot; &quot;)).\<br>    filter(lambda word: word != &#39;&#39;).\<br>    map(lambda word: (word.lower(), 1)).\<br>    reduceByKey(lambda a, b: a + b).\<br>    sortBy(lambda x: x[1], ascending=False).\<br>    take(5)<br><br>print(top_words)</pre><p>2. Find the number of orders placed in each month:</p><pre>orders_per_month = df.rdd.flatMap(lambda row: [(row[&quot;year_month&quot;], 1)]).\<br>    reduceByKey(lambda a, b: a + b).\<br>    sortBy(lambda x: x[0])<br><br>print(orders_per_month.collect())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8-DYn7drJZfExOf3PkJHGQ.png" /><figcaption>Grouped the elements of the RDD by the year_month key using reduceByKey. This will result in an RDD with elements like [(201012, 2247), (201101, 1897), (201102, 1703), ...], where the second element of each tuple is the count of rows with the same year_month.</figcaption></figure><p>3. Generating a list of items purchased by each customer:</p><pre>items_by_customer = df.rdd.map(lambda x: (x.cust_id, x.description)).groupByKey().collect()<br>print(items_by_customer)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2Wb1eGIk-xZMRYFpHqOdQ.png" /><figcaption>The output is a list of tuples, where each tuple contains a customer ID and a ResultIterable object. The ResultIterable object is essentially a lazy collection of all the items purchased by that particular customer, which can be accessed by iterating over the object.</figcaption></figure><p>This result was obtained from executing a map-reduce operation using the groupByKey() transformation on the ecom_df RDD. The map() function extracts the custid and description columns from each row, which are then grouped by custid using the groupByKey() transformation. Finally, the collect() action is called on the resulting RDD to return the data to the driver program as a list of tuples.</p><p>or</p><pre>from pyspark.sql.functions import collect_set<br><br>items_by_customer = df.groupBy(&quot;cust_id&quot;).agg(collect_set(&quot;description&quot;).alias(&quot;items&quot;)).collect()<br>print(items_by_customer)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kTIHSXGrosKn6mxDkrFRRw.png" /></figure><p>4. Extracting all unique countries present in the dataset:</p><pre>unique_countries = df.select(&quot;country&quot;).rdd.flatMap(lambda x: x).distinct().collect()<br>print(unique_countries)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VtGIqgogFzl2uenA8nSYpQ.png" /></figure><p><strong>pivot()</strong> function is used to reshape a DataFrame from long format to wide format, by rotating the values from a single column into multiple columns. The pivot() function requires three arguments:</p><ol><li>pivot_col: The column whose values will become column headers in the output DataFrame.</li><li>values: The column whose values will populate the new columns in the output DataFrame.</li><li>aggfunc (optional): The aggregation function to use when multiple values match the same (pivot_col, column) pair.<br><br>1. Counting the number of orders per month per country:</li></ol><pre>from pyspark.sql.functions import count<br><br># add a new column with just the year and month of the invoice date<br>ecom_df = df.withColumn(&quot;year_month&quot;, df.invoice_date.substr(1, 7))<br><br># group by year_month and country, and count the number of orders<br>orders_per_month_country = df.groupBy(&quot;year_month&quot;, &quot;country&quot;)\<br>                                   .agg(count(&quot;invoice_date&quot;).alias(&quot;num_orders&quot;))<br><br># pivot the table to have year_month as rows and countries as columns<br>orders_per_month_country_pivot = orders_per_month_country.groupBy(&quot;year_month&quot;)\<br>                                                          .pivot(&quot;country&quot;)\<br>                                                          .sum(&quot;num_orders&quot;)<br><br>orders_per_month_country_pivot.display()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LsoeIb8qH1UC80UXl0C3XA.png" /></figure><p>2. Pivot table of total quantity sold by product and month:</p><pre>from pyspark.sql.functions import col<br><br># cast the &quot;quantity&quot; column to a numeric data type<br>df = df.withColumn(&quot;quantity&quot;, col(&quot;quantity&quot;).cast(&quot;double&quot;))<br><br># pivot the data by month and sum the quantity values<br>pivot_table = df.groupBy(&quot;description&quot;).pivot(&quot;month&quot;).sum(&quot;quantity&quot;)<br><br># display the resulting pivot table<br>pivot_table.display()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zdVkE43u_B3UQUv1lVapIg.png" /><figcaption>The “quantity” column contains null values or non-numeric values, such as strings or boolean values. In this case, you may need to clean the data before aggregating it.</figcaption></figure><p>3. Pivot table of total revenue by year and country:</p><pre>from pyspark.sql.functions import col<br><br># convert &quot;amount_spent&quot; column to a numeric type<br>df = df.withColumn(&quot;amount_spent&quot;, col(&quot;amount_spent&quot;).cast(&quot;double&quot;))<br><br># create pivot table by year and country<br>pivot_table = df.groupBy(&quot;year_month&quot;, &quot;country&quot;).pivot(&quot;month&quot;).sum(&quot;amount_spent&quot;)<br>pivot_table.display()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bMGTxD25FnNJx4Z5-G0i8g.png" /></figure><p>4. Pivot table of total revenue by hour of day and day of week:</p><pre>pivot_table = df.groupBy(&quot;hour&quot;).pivot(&quot;day&quot;).sum(&quot;amount_spent&quot;)<br>pivot_table.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*2d4L8YZbNnhKtpvGWVov_w.png" /></figure><p>In conclusion, these functions are some of the most commonly used functions in PySpark for data manipulation and analysis. Understanding how to use these functions effectively can help you become more proficient in working with large datasets and performing complex data transformations. I hope this article has provided you with a good introduction to these functions and their uses, and that you find them useful in your own work with PySpark. Keep exploring and experimenting with these functions to gain a deeper understanding of their capabilities and to find new ways to extract insights from your data. Happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7ada8619690" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>