-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feature/1416 S3 input/output for Enceladus on EMR (S2.4, H2.8.5) #1483
Changes from 5 commits
60d2948
d41cc7e
67e4012
ac0785d
a8d53f9
85570d7
0bd704c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,8 +52,8 @@ trait ConformanceExecution extends CommonJobExecution { | |
cmd: ConformanceConfigParser[T], | ||
fsUtils: FileSystemVersionUtils, | ||
spark: SparkSession): Unit = { | ||
val stdDirSize = fsUtils.getDirectorySize(preparationResult.pathCfg.standardizationPath) | ||
preparationResult.performance.startMeasurement(stdDirSize) | ||
//val stdDirSize = fsUtils.getDirectorySize(preparationResult.pathCfg.standardizationPath) | ||
//preparationResult.performance.startMeasurement(stdDirSize) // TODO fix for s3 [ref issue #1416] | ||
|
||
log.info(s"standardization path: ${preparationResult.pathCfg.standardizationPath}") | ||
log.info(s"publish path: ${preparationResult.pathCfg.publishPath}") | ||
|
@@ -67,11 +67,13 @@ trait ConformanceExecution extends CommonJobExecution { | |
} | ||
|
||
// InputPath is standardizationPath in the combined job | ||
spark.enableControlMeasuresTracking(s"${preparationResult.pathCfg.standardizationPath}/_INFO") | ||
.setControlMeasuresWorkflow(sourceId.toString) | ||
// TODO fix for s3 [ref issue #1416] | ||
// spark.enableControlMeasuresTracking(s"${preparationResult.pathCfg.standardizationPath}/_INFO") | ||
// .setControlMeasuresWorkflow(sourceId.toString) | ||
|
||
// Enable control framework performance optimization for pipeline-like jobs | ||
Atum.setAllowUnpersistOldDatasets(true) | ||
// TODO fix for s3 [ref issue #1416] | ||
//Atum.setAllowUnpersistOldDatasets(true) | ||
|
||
// Enable Menas plugin for Control Framework | ||
MenasPlugin.enableMenas( | ||
|
@@ -105,16 +107,16 @@ trait ConformanceExecution extends CommonJobExecution { | |
implicit val featureSwitcher: FeatureSwitches = conformanceReader.readFeatureSwitches() | ||
|
||
Try { | ||
handleControlInfoValidation() | ||
// handleControlInfoValidation() // TODO fix for s3 [ref issue #1416] | ||
DynamicInterpreter.interpret(preparationResult.dataset, inputData) | ||
} match { | ||
case Failure(e: ValidationException) => | ||
AtumImplicits.SparkSessionWrapper(spark).setControlMeasurementError(sourceId.toString, e.getMessage, e.techDetails) | ||
// AtumImplicits.SparkSessionWrapper(spark).setControlMeasurementError(sourceId.toString, e.getMessage, e.techDetails) // TODO fix for s3 [ref issue #1416] | ||
throw e | ||
case Failure(NonFatal(e)) => | ||
val sw = new StringWriter | ||
e.printStackTrace(new PrintWriter(sw)) | ||
AtumImplicits.SparkSessionWrapper(spark).setControlMeasurementError(sourceId.toString, e.getMessage, sw.toString) | ||
// AtumImplicits.SparkSessionWrapper(spark).setControlMeasurementError(sourceId.toString, e.getMessage, sw.toString) // TODO fix for s3 [ref issue #1416] | ||
throw e | ||
case Success(conformedDF) => | ||
if (SchemaUtils.fieldExists(Constants.EnceladusRecordId, conformedDF.schema)) { | ||
|
@@ -134,43 +136,48 @@ trait ConformanceExecution extends CommonJobExecution { | |
fsUtils: FileSystemVersionUtils): Unit = { | ||
val cmdLineArgs: String = args.mkString(" ") | ||
|
||
PerformanceMetricTools.addJobInfoToAtumMetadata( | ||
"conform", | ||
preparationResult.pathCfg.standardizationPath, | ||
preparationResult.pathCfg.publishPath, | ||
menasCredentials.username, cmdLineArgs | ||
) | ||
// TODO fix for s3 [ref issue #1416] | ||
// PerformanceMetricTools.addJobInfoToAtumMetadata( | ||
// "conform", | ||
// preparationResult.pathCfg.standardizationPath, | ||
// preparationResult.pathCfg.publishPath, | ||
// menasCredentials.username, cmdLineArgs | ||
// ) | ||
|
||
val withPartCols = result | ||
.withColumnIfDoesNotExist(InfoDateColumn, to_date(lit(cmd.reportDate), ReportDateFormat)) | ||
.withColumnIfDoesNotExist(InfoDateColumnString, lit(cmd.reportDate)) | ||
.withColumnIfDoesNotExist(InfoVersionColumn, lit(preparationResult.reportVersion)) | ||
|
||
val recordCount = result.lastCheckpointRowCount match { | ||
case None => withPartCols.count | ||
case Some(p) => p | ||
} | ||
// TODO fix for s3 [ref issue #1416] | ||
val recordCount = 100 | ||
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. -1 would be better if there is no check for it to be > 0. Because 100 seems like a valid value. 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, took your advice (=> -1; #1416 (comment)) |
||
// val recordCount = result.lastCheckpointRowCount match { | ||
// case None => withPartCols.count | ||
// case Some(p) => p | ||
// } | ||
if (recordCount == 0) { | ||
handleEmptyOutput(SourcePhase.Conformance) | ||
} | ||
|
||
// ensure the whole path but version exists | ||
fsUtils.createAllButLastSubDir(preparationResult.pathCfg.publishPath) | ||
//fsUtils.createAllButLastSubDir(preparationResult.pathCfg.publishPath) // TODO fix for s3 [ref issue #1416] | ||
|
||
withPartCols.write.parquet(preparationResult.pathCfg.publishPath) | ||
|
||
val publishDirSize = fsUtils.getDirectorySize(preparationResult.pathCfg.publishPath) | ||
preparationResult.performance.finishMeasurement(publishDirSize, recordCount) | ||
PerformanceMetricTools.addPerformanceMetricsToAtumMetadata( | ||
spark, | ||
"conform", | ||
preparationResult.pathCfg.standardizationPath, | ||
preparationResult.pathCfg.publishPath, | ||
menasCredentials.username, cmdLineArgs | ||
) | ||
|
||
withPartCols.writeInfoFile(preparationResult.pathCfg.publishPath) | ||
writePerformanceMetrics(preparationResult.performance, cmd) | ||
// TODO fix for s3 [ref issue #1416] | ||
//val publishDirSize = fsUtils.getDirectorySize(preparationResult.pathCfg.publishPath) | ||
// preparationResult.performance.finishMeasurement(publishDirSize, recordCount) | ||
// PerformanceMetricTools.addPerformanceMetricsToAtumMetadata( | ||
// spark, | ||
// "conform", | ||
// preparationResult.pathCfg.standardizationPath, | ||
// preparationResult.pathCfg.publishPath, | ||
// menasCredentials.username, cmdLineArgs | ||
// ) | ||
|
||
// TODO fix for s3 [ref issue #1416] | ||
//withPartCols.writeInfoFile(preparationResult.pathCfg.publishPath) | ||
//writePerformanceMetrics(preparationResult.performance, cmd) | ||
|
||
if (conformanceReader.isAutocleanStdFolderEnabled()) { | ||
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. I think this should also be commented out 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, done. |
||
fsUtils.deleteDirectoryRecursively(preparationResult.pathCfg.standardizationPath) | ||
|
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.
Note that the SDK is not being used, yet as of now, but the support is now added because the usage is expected based on the S3 PoC.