Skip to content Skip to sidebar Skip to footer
Showing posts with the label Pyspark

Spark - Set Null When Column Not Exist In Dataframe

I'm loading many versions of JSON files to spark DataFrame. some of the files holds columns A,B… Read more Spark - Set Null When Column Not Exist In Dataframe

How To Merge Multiple Rows Into Single Cell Based On Id And Then Count?

How to merge multiple rows into single cell based on id using PySpark? I have a dataframe with ids … Read more How To Merge Multiple Rows Into Single Cell Based On Id And Then Count?

Removing Duplicate Columns After A Df Join In Spark

When you join two DFs with similar column names: df = df1.join(df2, df1['id'] == df2['i… Read more Removing Duplicate Columns After A Df Join In Spark

Exceptions When Reading Tutorial Csv File In The Cloudera Vm

I'm trying to do a Spark tutorial that comes with the Cloudera Virtual Machine. But even though… Read more Exceptions When Reading Tutorial Csv File In The Cloudera Vm

Spark: How To Parse Json String Of Nested Lists To Spark Data Frame?

How to parse JSON string of nested lists to spark data frame in pyspark ? Input data frame: +------… Read more Spark: How To Parse Json String Of Nested Lists To Spark Data Frame?

Error When Installing Python-snappy In Pycharm

I have a '.snappy.parquet' file and I wanted to view the content in this file, I know I can… Read more Error When Installing Python-snappy In Pycharm

Pyspark, Compare Two Rows In Dataframe

I'm attempting to compare one row in a dataframe with the next to see the difference in timesta… Read more Pyspark, Compare Two Rows In Dataframe

Spark Udf With Dictionary Argument Fails

I have a column (myCol) in a Spark dataframe that has values 1,2 and I want to create a new column … Read more Spark Udf With Dictionary Argument Fails

Issue In Encoding Non-numeric Feature To Numeric In Spark And Ipython

I am working on something where I have to make predictions for numeric data (monthly employee spend… Read more Issue In Encoding Non-numeric Feature To Numeric In Spark And Ipython

Pyspark - Aggregate Expression Required For Pivot, Found 'pythonudf'

I am using Python 2.6.6 and Spark 1.6.0. I have df like this: id | name | number | ----------… Read more Pyspark - Aggregate Expression Required For Pivot, Found 'pythonudf'

How To Delete An Rdd In Pyspark For The Purpose Of Releasing Resources?

If I have an RDD that I no longer need, how do I delete it from memory? Would the following be enou… Read more How To Delete An Rdd In Pyspark For The Purpose Of Releasing Resources?

Spark On Windows 10. 'files\spark\bin\..\jars""\' Is Not Recognized As An Internal Or External Command

I am very frustrated by Spark. An evening wasted thinking that I was doing something wrong but I ha… Read more Spark On Windows 10. 'files\spark\bin\..\jars""\' Is Not Recognized As An Internal Or External Command

Spark Pandas_udf Is Not Faster

I'm facing a heavy data transformation. In a nutshell, I have columns of data, each containing … Read more Spark Pandas_udf Is Not Faster

Selecting Empty Array Values From A Spark Dataframe

Given a DataFrame with the following rows: rows = [ Row(col1='abc', col2=[8], col3=[18]… Read more Selecting Empty Array Values From A Spark Dataframe

Iterating Throws Rows Of A Dataframe And Setting Value In Spark

I would like to preface this question with I'm a Spark Noob (just started reading a book 4 days… Read more Iterating Throws Rows Of A Dataframe And Setting Value In Spark

Best Way To Get Null Counts, Min And Max Values Of Multiple (100+) Columns From A Pyspark Dataframe

Say I have a list of column names and they all exist in the dataframe Cols = ['A', 'B&… Read more Best Way To Get Null Counts, Min And Max Values Of Multiple (100+) Columns From A Pyspark Dataframe

Pyspark Numeric Window Group By

I'd like to be able to have Spark group by a step size, as opposed to just single values. Is th… Read more Pyspark Numeric Window Group By

How To Get Postgres Command 'nth_value' Equivalent In Pyspark Hive Sql?

I was solving this example : https://www.windowfunctions.com/questions/grouping/5 Here, they use Or… Read more How To Get Postgres Command 'nth_value' Equivalent In Pyspark Hive Sql?

Spark-submit Fails To Detect The Installed Modulus In Pip

I have a python code which have the following 3rd party dependencies: import boto3 from warcio.arch… Read more Spark-submit Fails To Detect The Installed Modulus In Pip

Spark 2.2.2 - Joining Multiple Rdds Giving Out Of Memory Excepton. Resulting Rdd Has 124 Columns. What Should Be The Optimal Joining Method?

I have a file which has multiple values for each phone number. for example : phone_no circle operat… Read more Spark 2.2.2 - Joining Multiple Rdds Giving Out Of Memory Excepton. Resulting Rdd Has 124 Columns. What Should Be The Optimal Joining Method?