// BUT! The is an issue.. these queries may run while a "table-merging" operation is in progress.. thus resulting in "no table reference" and "no file found (fieName.parquet)"
// Thus, we need to have an "error-detection-and-retry" mechanism, in order to avoid returning error that we know will exist in certain times and we can overcome them.
// The final time-to-return of the results-retrieval methods may be somewhat large, but the alternative of returning predictable errors or locking the DB and slowing down the aggregation system are even worse.
returnResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("The number of "+message+" could not be retrieved (it was null) from the database \""+DatabaseConnector.databaseName+"\" using the getNumberQuery: "+getNumberQuery);
returnResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("The number of "+message+" could not be retrieved (empty result) from the database \""+DatabaseConnector.databaseName+"\" using the getNumberQuery: "+getNumberQuery);
// Note that until all the records are inspected, the "attempt" table contains all the inspected records PLUS very few duplicates (id-url) which come from the publications-database.
// After all the records are inspected, it contains duplicate records of more and more id-urls, as time goes on, since for every eligible record the Service re-attempts to get the full-text.
// So in order to get the number of inspected records, we want the distinct number, which at some point it will remain stable, even though the Service will try again and again some records.
// Before all the records are inspected, this endpoint will report all the inspected records MINUS the duplicate records which come straight from the "publication" table.
finalStringgetInspectedRecordsNumberQuery="select count(dist.id) from (select distinct id, original_url from "+DatabaseConnector.databaseName+".attempt) as dist";
returnResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("The inspected records' number could not be retrieved from the database \""+DatabaseConnector.databaseName+"\" using the getInspectedRecordsNumberQuery: "+getInspectedRecordsNumberQuery);
returnResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("The inspected records' number could not be retrieved from the database \""+DatabaseConnector.databaseName+"\" using the getInspectedRecordsNumberQuery: "+getInspectedRecordsNumberQuery);