Skip to content

Commit

Permalink
Fix the data type of Delta partition data type.
Browse files Browse the repository at this point in the history
  • Loading branch information
yruslan committed Apr 17, 2023
1 parent a8082d5 commit f6075a4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package za.co.absa.pramen.core.metastore.peristence

import org.apache.hadoop.fs.Path
import org.apache.spark.sql.functions._
import org.apache.spark.sql.types.DateType
import org.apache.spark.sql.{Column, DataFrame, SaveMode, SparkSession}
import org.slf4j.LoggerFactory
import za.co.absa.pramen.api.Query
Expand Down Expand Up @@ -60,7 +61,7 @@ class MetastorePersistenceDelta(query: Query,
override def saveTable(infoDate: LocalDate, df: DataFrame, numberOfRecordsEstimate: Option[Long]): MetaTableStats = {
val infoDateStr = dateFormatter.format(infoDate)

val dfIn = df.withColumn(infoDateColumn, lit(infoDateStr))
val dfIn = df.withColumn(infoDateColumn, lit(infoDateStr).cast(DateType))

val whereCondition = s"$infoDateColumn='$infoDateStr'"

Expand Down

0 comments on commit f6075a4

Please sign in to comment.