Skip to content

Instantly share code, notes, and snippets.

View zariable's full-sized avatar

Jun Yu zariable

View GitHub Profile
@zariable
zariable / DataFrameSuite.scala
Created December 23, 2017 07:46 — forked from umbertogriffo/DataFrameSuite.scala
DataFrameSuite allows you to check if two DataFrames are equal. You can assert the DataFrames equality using method assertDataFrameEquals. When DataFrames contains doubles, you can assert that the DataFrames approximately equal using method assertDataFrameApproximateEquals
import breeze.numerics.abs
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.functions.col
import org.apache.spark.sql.{Column, DataFrame, Row}
object DataFrameSuite {
/**
* Compares if two [[DataFrame]]s are equal.