[TAP] Add an optional feature to enable quick fix of input ADQL query on error:
`fix_on_fail` in the configuration file. By default, this feature is disabled.
_With 15cd5944, this commit finishes the resolution of the GitHub issue #104 ._
* <li>Drop all uploaded tables from the "database"</li>
* </ol>
*
*
* <h3>Job execution mode</h3>
*
*
* <p>
* This executor is able to process queries coming from a synchronous job (the result must be written directly in the HTTP response)
* and from an asynchronous job (the result must be written, generally, in a file). Two start(...) functions let deal with
* the differences between the two job execution modes: {@link #start(AsyncThread)} for asynchronous jobs
* and {@link #start(Thread, String, TAPParameters, HttpServletResponse)} for synchronous jobs.
* </p>
*
*
* <h3>Input/Output formats</h3>
*
*
* <p>Uploaded tables must be provided in VOTable format.</p>
*
*
* <p>
* Query results must be formatted in the format specified by the user in the job parameters. A corresponding formatter ({@link OutputFormat})
* is asked to the description of the TAP service ({@link ServiceConnection}). If none can be found, VOTable will be chosen by default.
* </p>
*
*
* <h3>Executor customization</h3>
*
*
* <p>It is totally possible to customize some parts of the ADQL query processing. However, the main algorithm must remain the same and is implemented
* by {@link #start()}. This function is final, like {@link #start(AsyncThread)} and {@link #start(Thread, String, TAPParameters, HttpServletResponse)},
* which are just preparing the execution for {@link #start()} in function of the job execution mode (asynchronous or synchronous).
* </p>
*
*
* <p><i>Note:
* {@link #start()} is using the Template Method Design Pattern: it defines the skeleton/algorithm of the processing, and defers some steps
* to other functions.
* </i></p>
*
*
* <p>
* So, you are able to customize almost all individual steps of the ADQL query processing: {@link #parseADQL()}, {@link #executeADQL(ADQLQuery)} and
* TAPLibrary is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* TAPLibrary is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with TAPLibrary. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2012-2015 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
*
* Copyright 2012-2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
* Astronomisches Rechen Institut (ARI)
*/
importtap.parameters.TAPParameters;
importadql.db.DBColumn;
/**
* <p>Report the execution (including the parsing and the output writing) of an ADQL query.
* It gives information on the job parameters, the job ID, whether it is a synchronous task or not, times of each execution step (uploading, parsing, executing and writing),
* the resulting columns and the success or not of the execution.</p>
*
* <p>This report is completely filled by {@link ADQLExecutor}, and aims to be used/read only at the end of the job or when it is definitely finished.</p>
*
* Report the execution (including the parsing and the output writing) of an
* ADQL query.
*
* <p>
* It gives information on the job parameters, the job ID, whether it is a
* synchronous task or not, times of each execution step (uploading, parsing,
* executing and writing), the resulting columns and the success or not of the
* execution.
* </p>
*
* <p>
* This report is completely filled by {@link ADQLExecutor}, and aims to be
* used/read only at the end of the job or when it is definitely finished.
* </p>
*
* @author Grégory Mantelet (CDS;ARI)
* @version 2.0 (04/2015)
* @version 2.3 (03/2019)
*/
publicclassTAPExecutionReport{
/** ID of the job whose the execution is reported here. */
publicfinalStringjobID;
/** Indicate whether this execution is done in a synchronous or asynchronous job. */
/** Indicate whether this execution is done in a synchronous or asynchronous
* job. */
publicfinalbooleansynchronous;
/** List of all parameters provided in the user request. */
publicfinalTAPParametersparameters;
/** Input ADQL query after an automatic fix by TAP-Lib.
* <p>This field is set only if the option fix_on_fail is enabled in the TAP
* configuration and that a query has been fixed.</p>
* @since 2.3 */
publicStringfixedQuery=null;
/** List of all resulting columns. <i>Empty array, if not yet known.</i> */
publicDBColumn[]resultingColumns=newDBColumn[0];
@@ -51,21 +68,26 @@ public class TAPExecutionReport {
* @since 2.0 */
publiclongnbRows=-1;
/** Duration of all execution steps. <i>For the moment only 4 steps (in the order): uploading, parsing, executing and writing.</i> */