Relative Content

Tag Archive for dataframescalaapache-spark

Scala – Convert Map to Dataframe where Keys re the Column Titles

I wish to create a dataframe by using a map such that the keys of the map are the column titles, and the values of the map are the data itself. In python and pyspark, this can be done quite easily in numerous ways- typically with one line of code, even-, but in Scala, I’m having serious trouble.

How to compare last year’s data in Scala?

I’m trying to compare the data from the same month but previous year and add previous year data to a new column ‘qty_ly’. As well as sum the last 3months of qty_cy for each product.