diff --git a/doc/src/site/sphinx/outputs.rst b/doc/src/site/sphinx/outputs.rst index 1a3efa4853..59e6d54118 100644 --- a/doc/src/site/sphinx/outputs.rst +++ b/doc/src/site/sphinx/outputs.rst @@ -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 \ No newline at end of file diff --git a/plugins/output-csv/src/main/scala/com/stratio/sparkta/plugin/output/csv/CsvOutput.scala b/plugins/output-csv/src/main/scala/com/stratio/sparkta/plugin/output/csv/CsvOutput.scala index 1e74a35153..bcb8dbcfe4 100644 --- a/plugins/output-csv/src/main/scala/com/stratio/sparkta/plugin/output/csv/CsvOutput.scala +++ b/plugins/output-csv/src/main/scala/com/stratio/sparkta/plugin/output/csv/CsvOutput.scala @@ -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 = {