Skip to content

Commit ed602b6

Browse files
authored
Merge pull request #355 from ankiiitraj/patch-1
fix #354: Notify user when dataframe contains only key column
2 parents aca7908 + 8ee93ea commit ed602b6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/scala/org/apache/spark/sql/redis/RedisSourceRelation.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ class RedisSourceRelation(override val sqlContext: SQLContext,
136136
}
137137
}
138138
}
139+
// If dataframe contains only key column
140+
val colCount = data.columns.length
141+
if (colCount < 2) {
142+
logInfo(s"Dataframe only contains key.column specified in options. No data was writen to redis.")
143+
}
139144
}
140145

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

0 commit comments

Comments
 (0)