Skip to content
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

Issue #SB-24793: Response Exhaust V2 job to support assessment blob data #451

Open
wants to merge 5 commits into
base: release-4.4.0
Choose a base branch
from

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?

@sonarcloud
Copy link

sonarcloud bot commented Aug 10, 2021

@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