Skip to content

Commit

Permalink
Re-use new date formatting functions from toHiveSting
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGekk committed May 19, 2020
1 parent af816e6 commit d8b0ed4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ object HiveResult {
def toHiveString(a: (Any, DataType), nested: Boolean = false): String = a match {
case (null, _) => if (nested) "null" else "NULL"
case (b, BooleanType) => b.toString
case (d: Date, DateType) => dateFormatter.format(DateTimeUtils.fromJavaDate(d))
case (ld: LocalDate, DateType) =>
dateFormatter.format(DateTimeUtils.localDateToDays(ld))
case (d: Date, DateType) => dateFormatter.format(d)
case (ld: LocalDate, DateType) => dateFormatter.format(ld)
case (t: Timestamp, TimestampType) => timestampFormatter.format(t)
case (i: Instant, TimestampType) => timestampFormatter.format(i)
case (bin: Array[Byte], BinaryType) => new String(bin, StandardCharsets.UTF_8)
Expand Down

0 comments on commit d8b0ed4

Please sign in to comment.