Skip to content

Commit

Permalink
Merge pull request #178 from ishawakankar/report-changes
Browse files Browse the repository at this point in the history
Course and Assessment report changes for userid column in redis
  • Loading branch information
SanthoshVasabhaktula authored Aug 7, 2020
2 parents b4d24a0 + a8f54ae commit bd1c924
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ object AssessmentMetricsJobV2 extends optional.Application with IJob with BaseRe

def getUserData(spark: SparkSession, loadData: (SparkSession, Map[String, String], String, StructType) => DataFrame): DataFrame = {
val schema = Encoders.product[UserData].schema
loadData(spark, Map("keys.pattern" -> "user:*","infer.schema" -> "true"), "org.apache.spark.sql.redis", schema)
loadData(spark, Map("keys.pattern" -> "user:*","infer.schema" -> "true", "key.column"-> "userid"), "org.apache.spark.sql.redis", schema)
.withColumn("username",concat_ws(" ", col("firstname"), col("lastname")))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ object CourseMetricsJobV2 extends optional.Application with IJob with ReportGene

def getUserData(spark: SparkSession, loadData: (SparkSession, Map[String, String], String, StructType) => DataFrame): DataFrame = {
val schema = Encoders.product[UserData].schema
loadData(spark, Map("keys.pattern" -> "user:*","infer.schema" -> "true"),"org.apache.spark.sql.redis", schema)
loadData(spark, Map("keys.pattern" -> "user:*","infer.schema" -> "true", "key.column"-> "userid"),"org.apache.spark.sql.redis", schema)
.withColumn("username",concat_ws(" ", col("firstname"), col("lastname")))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class TestAssessmentMetricsJobV2 extends BaseReportSpec with MockFactory {

val schema = Encoders.product[UserData].schema
(reporterMock.loadData _)
.expects(spark, Map("keys.pattern" -> "user:*","infer.schema" -> "true"),"org.apache.spark.sql.redis", schema)
.expects(spark, Map("keys.pattern" -> "user:*","infer.schema" -> "true", "key.column"-> "userid"),"org.apache.spark.sql.redis", schema)
.anyNumberOfTimes()
.returning(userInfoDF)

Expand Down Expand Up @@ -145,7 +145,7 @@ class TestAssessmentMetricsJobV2 extends BaseReportSpec with MockFactory {

val schema = Encoders.product[UserData].schema
(reporterMock.loadData _)
.expects(spark, Map("keys.pattern" -> "user:*","infer.schema" -> "true"),"org.apache.spark.sql.redis", schema)
.expects(spark, Map("keys.pattern" -> "user:*","infer.schema" -> "true", "key.column"-> "userid"),"org.apache.spark.sql.redis", schema)
.anyNumberOfTimes()
.returning(userInfoDF)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class TestCourseMetricsJobV2 extends BaseReportSpec with MockFactory with BaseRe

val schema = Encoders.product[UserData].schema
(reporterMock.loadData _)
.expects(spark, Map("keys.pattern" -> "user:*","infer.schema" -> "true"),"org.apache.spark.sql.redis", schema)
.expects(spark, Map("keys.pattern" -> "user:*","infer.schema" -> "true", "key.column"-> "userid"),"org.apache.spark.sql.redis", schema)
.anyNumberOfTimes()
.returning(userDF)

Expand Down

0 comments on commit bd1c924

Please sign in to comment.