-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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] Introduce V2 Checkpoint actions, table feature #1983
Conversation
6d6699a
to
37458a9
Compare
37458a9
to
b420f6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few nits
|
||
/** Converts a `name` String into a [[Policy]] */ | ||
def fromName(name: String): Policy = ALL.find(_.name == name).getOrElse { | ||
throw new IllegalStateException(s"Invalid policy $name") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason it's IllegalState instead of IllegalArgument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IllegalArgument suits better - fixing this.
fromString = str => CheckpointPolicy.fromName(str), | ||
validationFunction = (v => CheckpointPolicy.ALL.exists(_.name == v.name)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we care that it's case sensitive?
(I'm fine either way, just checking that it's intentional)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most of the other table properties don't handle lower/upper case - following the same pattern.
DeltaUtils.isTesting || SparkSession.getActiveSession.map { spark => | ||
spark.conf.get(DeltaSQLConf.EXPOSE_CHECKPOINT_V2_TABLE_FEATURE_FOR_TESTING) | ||
}.getOrElse(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: simpler?
DeltaUtils.isTesting || SparkSession.getActiveSession.map { spark => | |
spark.conf.get(DeltaSQLConf.EXPOSE_CHECKPOINT_V2_TABLE_FEATURE_FOR_TESTING) | |
}.getOrElse(false) | |
DeltaUtils.isTesting || SparkSession.getActiveSession.exists { spark => | |
spark.conf.get(DeltaSQLConf.EXPOSE_CHECKPOINT_V2_TABLE_FEATURE_FOR_TESTING) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could also do
DeltaUtils.isTesting || SparkSession.getActiveSession.map { spark => | |
spark.conf.get(DeltaSQLConf.EXPOSE_CHECKPOINT_V2_TABLE_FEATURE_FOR_TESTING) | |
}.getOrElse(false) | |
SparkSession.getActiveSession.map { spark => | |
spark.conf.get(DeltaSQLConf.EXPOSE_CHECKPOINT_V2_TABLE_FEATURE_FOR_TESTING) | |
}.getOrElse(DeltaUtils.isTesting) |
val tagMapWithSchema = sidecarFileSchemaOpt | ||
.map(schema => Map(Tags.SIDECAR_FILE_SCHEMA.name -> schema.json)) | ||
.getOrElse(Map.empty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val tagMapWithSchema = sidecarFileSchemaOpt | |
.map(schema => Map(Tags.SIDECAR_FILE_SCHEMA.name -> schema.json)) | |
.getOrElse(Map.empty) | |
val tagMapWithSchema = sidecarFileSchemaOpt.map(Tags.SIDECAR_FILE_SCHEMA.name -> _.json) |
(Map.++
below accepts anything that resembles TraversibleOnce
)
.checkValues(Set("json", "parquet")) | ||
.createOptional | ||
|
||
val EXPOSE_CHECKPOINT_V2_TABLE_FEATURE_FOR_TESTING = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is temporary, to be removed once the feature is ready for general use?
LGTM. |
This PR introduces actions and placeholder TableFeature for V2 Checkpoints. Closes [delta-io#1983](delta-io#1983) GitOrigin-RevId: fd41917ea6b21701defe422ef643fd0ff59e125f
Merged as 22ade20 |
Which Delta project/connector is this regarding?
Description
Introduces actions for V2 Checkpoints - checkpointMetadata, sidecarFiles. Also introduces TableFeature for V2 Checkpoints.
Currently the feature is named with suffix
-under-development
. It will be removed in a later PR when all other pieces are merged.Part of #1793 .
How was this patch tested?
UTs
Does this PR introduce any user-facing changes?
No