Skip to content

Commit

Permalink
Improve ds to save errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoLaval committed Jan 27, 2024
1 parent c707e23 commit 82d580d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/fr/insee/trevas/lab/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ public static void writeSparkDatasetsJDBC(Bindings bindings,
Map<String, QueriesForBindingsToSave> queriesForBindingsToSave
) {
queriesForBindingsToSave.forEach((name, values) -> {
if (!bindings.containsKey(name)) {
try {
throw new Exception(name + " is not defined in script");
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Object ds = bindings.get(name);
if (!(ds instanceof PersistentDataset)) {
try {
Expand Down

0 comments on commit 82d580d

Please sign in to comment.