Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 29.4k
[SPARK-56956][SPARK-56651][CONNECT][SDP][FOLLOWUP] Address review comments for AutoCDC flow dataclasses and Python APIs#56113
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
5cb85c580b4b5e0790d5557211733e6f2c5File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -18,7 +18,7 @@ | ||
| package org.apache.spark.sql.pipelines.autocdc | ||
| import org.apache.spark.SparkException | ||
| import org.apache.spark.sql.{functions => F, AnalysisException} | ||
| import org.apache.spark.sql.{functions => F} | ||
| import org.apache.spark.sql.Column | ||
| import org.apache.spark.sql.catalyst.TableIdentifier | ||
| import org.apache.spark.sql.catalyst.util.QuotingUtils | ||
| @@ -130,9 +130,6 @@ case class Scd1BatchProcessor( | ||
| */ | ||
| private[autocdc] def extendMicrobatchRowsWithCdcMetadata( | ||
| validatedMicrobatch: DataFrame): DataFrame = { | ||
| // Proactively validate the reserved CDC metadata column does not exist in the microbatch. | ||
| validateCdcMetadataColumnNotPresent(validatedMicrobatch) | ||
| val rowDeleteSequence: Column = changeArgs.deleteCondition match { | ||
| case Some(deleteCondition) => | ||
| F.when(deleteCondition, changeArgs.sequencing).otherwise(F.lit(null)) | ||
| @@ -409,25 +406,6 @@ case class Scd1BatchProcessor( | ||
| .insert(columnsToInsertOnNewKey) | ||
| .merge() | ||
| } | ||
| private def validateCdcMetadataColumnNotPresent(microbatch: DataFrame): Unit = { | ||
| val microbatchSqlConf = microbatch.sparkSession.sessionState.conf | ||
| val resolver = microbatchSqlConf.resolver | ||
| microbatch.schema.fieldNames | ||
| .find(resolver(_, Scd1BatchProcessor.cdcMetadataColName)) | ||
| .foreach { conflictingColumnName => | ||
| throw new AnalysisException( | ||
| errorClass = "AUTOCDC_RESERVED_COLUMN_NAME_CONFLICT", | ||
| messageParameters = Map( | ||
| "caseSensitivity" -> CaseSensitivityLabels.of(microbatchSqlConf.caseSensitiveAnalysis), | ||
| "columnName" -> conflictingColumnName, | ||
| "schemaName" -> "microbatch", | ||
| "reservedColumnName" -> Scd1BatchProcessor.cdcMetadataColName | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
Comment on lines
-412
to
-430
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, this was supposed to be removed in the other PR but I think it got accidentally added back as I rebased the stack! | ||
| } | ||
| object Scd1BatchProcessor { | ||
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 looks like a real bug, formatting will break