Skip to content

Issue #TG-488 : MergeScript Implementation#67

Open
RevathiKotla wants to merge 7 commits intoSunbird-Obsrv:release-3.4.0from
RevathiKotla:release-3.4.0
Open

Issue #TG-488 : MergeScript Implementation#67
RevathiKotla wants to merge 7 commits intoSunbird-Obsrv:release-3.4.0from
RevathiKotla:release-3.4.0

Conversation

@RevathiKotla
Copy link
Contributor

No description provided.

Comment on lines +262 to +265
case class MergeScriptConfig(`type`: String, id: String, frequency: String, basePath: String, rollup: Integer, rollupAge: Option[String] = None, rollupCol: Option[String] = None, rollupRange: Option[Integer] = None,
merge: MergeFiles, container: String, postContainer: Option[String] = None, deltaFileAccess: Option[Boolean] = Option(true), reportFileAccess: Option[Boolean] = Option(true))
case class MergeFiles(files: List[Map[String, String]], dims: List[String])

Copy link
Contributor

Choose a reason for hiding this comment

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

Rename as MergeConfig. This is no longer a script

Comment on lines +25 to +29
val deltaDF = downloadAzureFile(filePaths("deltaPath"),
mergeConfig.deltaFileAccess.getOrElse(true), mergeConfig.container)

val reportDF = downloadAzureFile(filePaths("reportPath"), mergeConfig.reportFileAccess.getOrElse(true),
mergeConfig.postContainer.getOrElse("reports"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to download file?

Comment on lines +35 to +36
mergeDF.saveToBlobStore(mergeResult._2, "csv", FilenameUtils.removeExtension(path.getName), Option(Map("header" -> "true", "mode" -> "overwrite")), None)
mergeDF.saveToBlobStore(mergeResult._2, "json", FilenameUtils.removeExtension(path.getName), Option(Map("header" -> "true", "mode" -> "overwrite")), None)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename the older file with date before overwriting?

Comment on lines +43 to +45
if (mergeConfig.rollup > 0) {
val defaultFormat = "dd-MM-yyyy"
val reportDfColumns = reportDF.columns
Copy link
Contributor

Choose a reason for hiding this comment

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

We would need an append mode where we just append the delta data to the existing data on few columns for the same on the same rollupCol? For ex: adding data to a cumulative report (yearly or monthly or weekly cumulative files)

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (1.8.0_131) you have used to run this analysis is deprecated and we will stop accepting it accepting it soon.Please update to at least Java 11.
Read more here

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.

2 participants