Skip to content

Commit

Permalink
Improve write table plan explain string
Browse files Browse the repository at this point in the history
  • Loading branch information
ulysses-you committed Oct 11, 2024
1 parent c41d23c commit 9f9e03a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import org.apache.spark.sql.sources.{AlwaysTrue, Filter}

sealed private[spark] trait SaveMode extends Serializable

object InsertInto extends SaveMode
case object InsertInto extends SaveMode

case class Overwrite(filters: Option[Filter]) extends SaveMode

object DynamicOverWrite extends SaveMode
case object DynamicOverWrite extends SaveMode

object ErrorIfExists extends SaveMode
case object ErrorIfExists extends SaveMode

object Ignore extends SaveMode
case object Ignore extends SaveMode

object SaveMode {
def transform(saveMode: SparkSaveMode): SaveMode = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,8 @@ case class SparkTable(table: Table)
throw new RuntimeException("Only FileStoreTable can be written.")
}
}

override def toString: String = {
s"${table.getClass.getSimpleName}[${table.fullName()}]"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ class SparkWrite(val table: FileStoreTable, saveMode: SaveMode, options: Options
WriteIntoPaimonTable(table, saveMode, data, options).run(data.sparkSession)
}
}

override def toString: String = {
s"table: ${table.fullName()}, saveMode: $saveMode, options: ${options.toMap}"
}
}

0 comments on commit 9f9e03a

Please sign in to comment.