Skip to content

Commit

Permalink
Merge pull request #1295 from gserranojc/bugfest/csv-versioned-policies
Browse files Browse the repository at this point in the history
Csv versioned policies
  • Loading branch information
aalfonso-stratio committed Nov 17, 2015
2 parents b09d723 + d277531 commit 211b4f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions doc/src/site/sphinx/outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,9 @@ Csv Configuration
+--------------------------+-----------------------------------------------+----------+-----------------------+
| dateGranularity | Specify the granularity from second to year | Yes | Day |
+--------------------------+-----------------------------------------------+----------+-----------------------+

When you are using CSV as output, it will save the result in a path concatenating a base path, the dimension names
of the cube and a version starting in one.
Example: if the basePath is /user/stratio, the cube has 2 dimensions (name, price) and it is the first time that
you save the policy then the final path will be /user/stratio/name_price_v1.
If you modify some dimension of this cube then the version will be increased in one: /user/stratio/name_price_v2
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ class CsvOutput(keyName: String,
require(path.isDefined, "Destination path is required. You have to set 'path' on properties")
val pathParsed = if (path.get.endsWith("/")) path.get else path.get + "/"
val subPath = DateOperations.subPath(dateGranularityFile, datePattern)

saveAction(s"$pathParsed$tableName$subPath.csv", dataFrame)
saveAction(s"$pathParsed${versionedTableName(tableName)}$subPath.csv", dataFrame)
}

protected[csv] def saveAction(path: String, dataFrame: DataFrame): Unit = {
Expand Down

0 comments on commit 211b4f5

Please sign in to comment.