diff --git a/src/main/java/eu/openaire/urls_controller/util/ParquetFileUtils.java b/src/main/java/eu/openaire/urls_controller/util/ParquetFileUtils.java index 6e23478..dc63ae5 100644 --- a/src/main/java/eu/openaire/urls_controller/util/ParquetFileUtils.java +++ b/src/main/java/eu/openaire/urls_controller/util/ParquetFileUtils.java @@ -192,6 +192,8 @@ public class ParquetFileUtils { // In case the above method returns an error, nothing happens. We just have only the initial payloads to insert to the DB. int sizeOfEachSubList = (int)(sizeOfUrlReports * 0.33); // We want 3 sub-lists for the payloads. + if ( sizeOfEachSubList == 0 ) // If the "sizeOfUrlReports" is <= 3. + sizeOfEachSubList = 1; // There may be 1 more with very few elements, due to non-persisted splitting. Unfortunately, we cannot st the number of splits, only the size of most splits. if ( sizeOfEachSubList > 10 ) { List> finalSubLists = Lists.partition(urlReports, sizeOfEachSubList); // This needs the "sizeOfEachSubList" to be above < 0 >.