Showing posts with the label scala

[FIXED] Spark Advanced Window with dynamic last

Issue Problem: Given a time series data which is a clickstream of user activity is stored in hive, …

[FIXED] Creating a broadcast variable with SparkSession ? Spark 2.0

Issue Is it possible to create broadcast variables with the sparkContext provided by SparkSession ?…

[FIXED] Adding a nested column to Spark DataFrame

Issue How can I add or replace fields to a struct on any nested level? This input: val rdd = sc…

[FIXED] Spark AnalysisException global table or view not found

Issue I get the following error: 18/03/14 15:31:11 ERROR ApplicationMaster: User class threw e…

[FIXED] How to get all combinations of an array column in Spark?

Issue Suppose I have an array column group_ids +-------+----------+ |user_id|group_ids | +-------+…

[FIXED] Replacing whitespace in all column names in spark Dataframe

Issue I have spark dataframe with whitespaces in some of column names, which has to be replaced wit…

[FIXED] Is there better way to display entire Spark SQL DataFrame?

Issue I would like to display the entire Apache Spark SQL DataFrame with the Scala API. I can use t…

[FIXED] Scala - Spark : Operate on all the columns of DF at once and create a case-class for each column efficiently

Issue I am facing a DataFrame with more than 50,000 rows, and around 30-100 columns. The data is nu…

[FIXED] Comparing two array columns in Scala Spark

Issue I have a dataframe of format given below. movieId1 | genreList1 |

[FIXED] Scala spark multiple values in a column average them

Issue I have org.apache.spark.sql.DataFrame = [_1: string, _2: string] with column containing the …

[FIXED] How to add columns to df with StructField Array?

Issue I have two dataframes, and I want to add to the first of them all the columns that are in the…

[FIXED] How to create DataFrame with NaN, null and None values in some of its cells?

Issue In a coursera course about spark + scala I had a lesson about using fillna and replace functi…

[FIXED] Error: value cassandraFormat is not a member of org.apache.spark.sql.DataFrameWriter

Issue Checking the repo on github I see cassandraFormat href="https://github.com/datastax/spa…

[FIXED] SPARK SQL: does groupBy after orderBy maintain that order?

Issue I have spark 2.3.0. In this example, does groupBy after orderBy maintain that order? id date…

[FIXED] How to get values from a dataframe column using SparkSQL?

Issue Right now I am working with Spark/Scala and I am trying to join multiple dataframes to get th…

[FIXED] Remove square brackets [] from Array in scala

Issue I have the date with square brackets [2014-11-08 06:27:00.0] , and a want remove it. Expect…

[FIXED] Why does Spark SQL fail, but Spark core works after fresh installation (Scala)?

Issue Why am I able to run Spark core, but not Spark SQL in Scala after fresh installation? My bui…

[FIXED] Spark scala UDF in DataFrames is not working

Issue I have defined a function to convert Epoch time to CET and using that function after wrapping…

[FIXED] Assigning parent to spark row

Issue I have a spark dataframe like this: val dataSeq = Seq( (20, "data", 0), (2…

[FIXED] How do I populate a Mutable map using a loop in scala?

Issue import scala.collection.mutable.Map var overlapByY: Map[Int, Int] = (0 to records.length).ma…