Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spark] Improve write table plan explain string #4311

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"
}
}
Loading