Skip to content

Instantly share code, notes, and snippets.

@marhan
Last active April 18, 2017 21:02
Show Gist options
  • Save marhan/d10f0fc80099c636586e7212fad0c813 to your computer and use it in GitHub Desktop.
Save marhan/d10f0fc80099c636586e7212fad0c813 to your computer and use it in GitHub Desktop.
Transform haspa spark data frame into computable formats (Zeppelin Paragraph)
%spark
val account = df.withColumn("Betrag", regexp_replace( regexp_replace( df("Betrag"), "\\.","" ) , "\\,",".").cast(DecimalType(10,2)))
.withColumn("Buchung", to_date( unix_timestamp( col("Buchung") , "dd.MM.yyyy" ).cast("timestamp") ) )
.withColumn("Wert", to_date( unix_timestamp( col("Wert") , "dd.MM.yyyy" ).cast("timestamp") ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment