From 5c11a857bb84ec0f1dc199ab9262c999da6254af Mon Sep 17 00:00:00 2001 From: Max Thonagel <12283268+thoniTUB@users.noreply.github.com> Date: Mon, 20 Sep 2021 08:16:09 +0200 Subject: [PATCH] adds table assertion for Import --- .../main/java/com/bakdata/conquery/models/jobs/ImportJob.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/main/java/com/bakdata/conquery/models/jobs/ImportJob.java b/backend/src/main/java/com/bakdata/conquery/models/jobs/ImportJob.java index 689bfc2746..806870a998 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/jobs/ImportJob.java +++ b/backend/src/main/java/com/bakdata/conquery/models/jobs/ImportJob.java @@ -109,6 +109,9 @@ public static ImportJob create( throw new BadRequestException(String.format("Table[%s] does not exist.", tableId)); } + // Ensure that Import and Table have the same schema + header.assertMatch(table); + final ImportId importId = new ImportId(table.getId(), header.getName()); if (namespace.getStorage().getImport(importId) != null) {