Skip to content

Conversation

@utk14
Copy link
Contributor

@utk14 utk14 commented Aug 5, 2021

StorySB-24793 Assessments Archival - Jobs Implementation and testing

https://project-sunbird.atlassian.net/browse/SB-24793

Type of change

Please choose appropriate options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes in the below checkboxes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Ran Test A
  • Ran Test B

Test Configuration:

  • Software versions:
  • Hardware versions:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

val azureFetcherConfig = config.modelParams.get("assessmentFetcherConfig").asInstanceOf[Map[String, AnyRef]]

val store = azureFetcherConfig("store")
val format:String = azureFetcherConfig.getOrElse("format", "csv").asInstanceOf[String]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the multiple archived data has created and data has been duplicated for a batch then how are we handling it here? If not could you please handle this scenario?

@sonarqubecloud
Copy link

@utk14 utk14 changed the base branch from release-4.2.0 to release-4.4.0 October 21, 2021 05:51
Comment on lines +15 to +24
val url = store match {
case "local" =>
filePath + s"${batchid}-*.${format}"
// $COVERAGE-OFF$ for azure testing
case "s3" | "azure" =>
val key = AppConf.getConfig("azure_storage_key")
val file = s"${filePath}${batchid}-*.${format}"
s"wasb://$bucket@$key.blob.core.windows.net/$file."
// $COVERAGE-ON$
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to a commonutil method

Comment on lines +60 to +71
val assessAggregateData = loadData(assessmentAggDBSettings, cassandraFormat, new StructType())

val joinedDF = try {
val assessBlobData = getAssessmentBlobDF(batchid, config)

val joinDF = assessAggregateData.join(assessBlobData, Seq("batch_id", "course_id", "user_id"), "left")
.select(assessAggregateData.col("*"))
joinDF
} catch {
case e => JobLogger.log("Blob does not contain any file for batchid: " + batchid)
assessAggregateData
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we still creating one single CSV file of few GBs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants