Skip to content

Commit

Permalink
check column non empty
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>
  • Loading branch information
pyalex committed Jan 28, 2021
1 parent 7327714 commit 8e2453a
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -35,12 +35,12 @@ object FileReader {
.filter(col(source.eventTimestampColumn) >= new Timestamp(start.getMillis))
.filter(col(source.eventTimestampColumn) < new Timestamp(end.getMillis))

if (source.datePartitionColumn.nonEmpty) {
reader
.filter(col(source.datePartitionColumn.get) >= new Date(start.getMillis))
.filter(col(source.datePartitionColumn.get) <= new Date(end.getMillis))
} else {
reader
source.datePartitionColumn match {
case Some(partitionColumn) if partitionColumn.nonEmpty =>
reader
.filter(col(partitionColumn) >= new Date(start.getMillis))
.filter(col(partitionColumn) <= new Date(end.getMillis))
case _ => reader
}
}
}

0 comments on commit 8e2453a

Please sign in to comment.