Parquet store fails to addElements when using HDFS
The final task for the addElements operations is to move the data from the tempDir/sorted to the dataDir/timestamp, which works fine when working on the local file system. However if you are working on HDFS then the files will be moved to dataDir/timestamp/sorted.
diff --git a/store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/operation/addelements/handler/AddElementsHandler.java b/store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/operation/addelements/handler/AddElementsHandler.java
index 2e69c31142..bc8cf94b84 100755
--- a/store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/operation/addelements/handler/AddElementsHandler.java
+++ b/store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/operation/addelements/handler/AddElementsHandler.java
@@ -111,7 +111,7 @@ public class AddElementsHandler implements OperationHandler<AddElements> {
         final long snapshot = System.currentTimeMillis();
         final String destPath = dataDirString + "/" + snapshot;
         LOGGER.debug("Creating directory {}", destPath);
-        fs.mkdirs(new Path(destPath));
+        fs.mkdirs(new Path(destPath).getParent());
         final String tempPath = tempDataDirString + "/" + ParquetStoreConstants.SORTED;
         LOGGER.debug("Renaming {} to {}", tempPath, destPath);
         fs.rename(new Path(tempPath), new Path(destPath));
diff --git a/store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/operation/addelements/handler/ImportRDDOfElementsHandler.java b/store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/operation/addelements/handler/ImportRDDOfElementsHandler.java
index 25dc58c4c7..0d37fd93ca 100644
--- a/store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/operation/addelements/handler/ImportRDDOfElementsHandler.java
+++ b/store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/operation/addelements/handler/ImportRDDOfElementsHandler.java
@@ -105,7 +105,7 @@ public class ImportRDDOfElementsHandler implements OperationHandler<ImportRDDOfE
         // Move data from temp to data
         final long snapshot = System.currentTimeMillis();
         final String destPath = rootDataDirString + "/" + snapshot;
-        fs.mkdirs(new Path(destPath));
+        fs.mkdirs(new Path(destPath).getParent());
         fs.rename(new Path(tempDataDirString + "/" + ParquetStoreConstants.SORTED), new Path(destPath));
         // Reload indices
         newGraphIndex.setSnapshotTimestamp(snapshot);
['store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/operation/addelements/handler/AddElementsHandler.java', 'store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/operation/addelements/handler/ImportRDDOfElementsHandler.java']