Skip to content

Commit

Permalink
Merge pull request #355 from ankiiitraj/patch-1
Browse files Browse the repository at this point in the history
fix #354: Notify user when dataframe contains only key column
  • Loading branch information
fe2s authored Oct 10, 2022
2 parents aca7908 + 8ee93ea commit ed602b6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ class RedisSourceRelation(override val sqlContext: SQLContext,
}
}
}
// If dataframe contains only key column
val colCount = data.columns.length
if (colCount < 2) {
logInfo(s"Dataframe only contains key.column specified in options. No data was writen to redis.")
}
}

override def buildScan(requiredColumns: Array[String], filters: Array[Filter]): RDD[Row] = {
Expand Down

0 comments on commit ed602b6

Please sign in to comment.