Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaschat-db committed Apr 4, 2024
1 parent 719573f commit b4cfb69
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ trait TableFeatureSupport { this: Protocol =>
}

// When `to` protocol contains table features, protocol versions may still
// get downgraded. However, the resulting protocol need to support at least writer features.
// get downgraded. However, the resulting protocol needs to support at least writer features.
// Note, we check the minimum required versions only when table features exist in the protocol.
// This because we do not always downgrade the versions of protocols with no table features.
if (!to.supportsWriterFeatures ||
Expand Down Expand Up @@ -395,8 +395,8 @@ trait TableFeatureSupport { this: Protocol =>
// end up with invalid protocol versions such as (3, 3). Nevertheless,
// we double check it here.
val newProtocol =
Protocol(minReaderVersion, minWriterVersion).withFeatures(readerAndWriterFeatures)
require(
Protocol(minReaderVersion, minWriterVersion).withFeatures(readerAndWriterFeatures)
assert(
newProtocol.supportsWriterFeatures,
s"Downgraded protocol should at least support writer features, but got $newProtocol.")
return newProtocol
Expand All @@ -406,7 +406,7 @@ trait TableFeatureSupport { this: Protocol =>
TableFeatureProtocolUtils.minimumRequiredVersions(readerAndWriterFeatures)
val newProtocol = Protocol(minReaderVersion, minWriterVersion)

require(
assert(
!newProtocol.supportsReaderFeatures && !newProtocol.supportsWriterFeatures,
s"Downgraded protocol should not support table features, but got $newProtocol.")

Expand Down

0 comments on commit b4cfb69

Please sign in to comment.