Skip to content Skip to sidebar Skip to footer
Showing posts with the label Apache Spark Sql

Cosine Similarity For Two Pyspark Dataframes

I have a PySpark DataFrame, df1, that looks like: CustomerID CustomerValue CustomerValue2 12 … Read more Cosine Similarity For Two Pyspark Dataframes

Pyspark 2.1: Importing Module With Udf's Breaks Hive Connectivity

I'm currently working with Spark 2.1 and have a main script that calls a helper module that con… Read more Pyspark 2.1: Importing Module With Udf's Breaks Hive Connectivity

Passing Array To Spark Lit Function

Let's say I have a numpy array a that contains the numbers 1-10: [1 2 3 4 5 6 7 8 9 10] I also … Read more Passing Array To Spark Lit Function

Compare Two Dataframes Pyspark

I'm trying to compare two data frames with have same number of columns i.e. 4 columns with id a… Read more Compare Two Dataframes Pyspark

Joining Dataframes With Same Coumn Name In Pyspark

I have two dataframe which has been readed from two csv files. +---+----------+-----------------+ |… Read more Joining Dataframes With Same Coumn Name In Pyspark

How To Read Csv File With Additional Comma In Quotes Using Pyspark?

I am having some troubles reading the following CSV data in UTF-16: FullName, FullLabel, Type TEST.… Read more How To Read Csv File With Additional Comma In Quotes Using Pyspark?

Spark: How To Transpose And Explode Columns With Nested Arrays

I applied an algorithm from the question below(in NOTE) to transpose and explode nested spark dataf… Read more Spark: How To Transpose And Explode Columns With Nested Arrays

Spark Dataframe In Python - Execution Stuck When Using Udfs

I have a spark job written in Python which is reading data from the CSV files using DataBricks CSV … Read more Spark Dataframe In Python - Execution Stuck When Using Udfs

If I Cache A Spark Dataframe And Then Overwrite The Reference, Will The Original Data Frame Still Be Cached?

Suppose I had a function to generate a (py)spark data frame, caching the data frame into memory as … Read more If I Cache A Spark Dataframe And Then Overwrite The Reference, Will The Original Data Frame Still Be Cached?

Assertionerror: Col Should Be Column

How to create a new column in PySpark and fill this column with the date of today? This is what I t… Read more Assertionerror: Col Should Be Column

Hourly Aggregation In Pyspark

I'm looking for a way to aggregate by hour my data. I want firstly to keep only hours in my evt… Read more Hourly Aggregation In Pyspark

How To Make An Integer Index Row?

I have a DataFrame: +-----+--------+---------+ | usn|log_type|item_code| +-----+--------+--------… Read more How To Make An Integer Index Row?

Mode Of Row As A New Column In Pyspark Dataframe

Is it possible to add a new column based on the maximum of previous columns where the previous colu… Read more Mode Of Row As A New Column In Pyspark Dataframe

Get Value Out Of Dataframe

In Scala I can do get(#) or getAs[Type](#) to get values out of a dataframe. How should I do it in … Read more Get Value Out Of Dataframe

Spark: How To Transform Json String With Multiple Keys, From Data Frame Rows?

I'm looking for a help, how to parse json string with multiple keys to json struct, see require… Read more Spark: How To Transform Json String With Multiple Keys, From Data Frame Rows?

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