@@ -0,0 +1,2311 @@
+package de.uni_freiburg.informatik.dbis.sempala.loader.sql;%0A%0A//TODO add comments if time left%0A/**%0A * %0A * @author Manuel Schneider %3Cschneidm@informatik.uni-freiburg.de%3E%0A *%0A */%0Apublic final class InsertStatement %7B%0A%09%0A%09private String tablename = null;%0A%09private Boolean overwrite = false;%0A%09private String partitions = null;%0A%09private String selectStatement = null;%0A%0A%09public InsertStatement() %7B%0A%09%0A%09%7D %0A%09%0A%09public InsertStatement(String tablename) %7B%0A%09%09this.tablename = tablename;%0A%09%7D%0A%09%0A%09public static InsertStatement createNew()%7B%0A%09%09return new InsertStatement();%0A%09%7D%0A%0A%09public InsertStatement tablename(String tablename) %7B%0A%09%09this.tablename = tablename;%0A%09%09return this;%0A%09%7D%0A%0A%09public InsertStatement overwrite() %7B%0A%09%09this.overwrite = true;%0A%09%09return this;%0A%09%7D%0A%0A%09public InsertStatement addPartition(final String partition) %7B%0A%09%09if (this.partitions==null)%0A%09%09%09partitions = partition;%0A%09%09else%0A%09%09%09partitions+=String.format(%22, %25s%22, partition);%0A%09%09return this;%0A%09%7D%0A%09%0A%09public InsertStatement selectStatement(final String selectStatement) %7B%0A%09%09this.selectStatement = selectStatement;%0A%09%09return this;%0A%09%7D%0A%09%0A%09public InsertStatement selectStatement(final SelectStatement selectStatement) %7B%0A%09%09this.selectStatement = selectStatement.toString();%0A%09%09return this;%0A%09%7D%0A%0A%09public String toString() throws IllegalArgumentException %7B%0A%09%09if (this.tablename == null %7C%7C this.selectStatement == null)%0A%09%09%09throw new IllegalArgumentException(%22tablename and either some columnDefinitions or asSelect must be specified%22);%0A%09%09/*%0A%09%09 * %5Bwith_clause%5D%0A%09     * INSERT %7B INTO %7C OVERWRITE %7D %5BTABLE%5D table_name%0A%09     *   %5B(column_list)%5D%0A%09     *   %5B PARTITION (partition_clause)%5D%0A%09     * %7B%0A%09     *     %5Bhint_clause%5D select_statement%0A%09     *   %7C VALUES (value %5B, value ...%5D) %5B, (value %5B, value ...%5D) ...%5D%0A%09     * %7D%0A%09     * %0A%09     * partition_clause ::= col_name %5B= constant%5D %5B, col_name %5B= constant%5D ...%5D%0A%09     * %0A%09     * hint_clause ::= %5BSHUFFLE%5D %7C %5BNOSHUFFLE%5D    (Note: the square brackets are part of the syntax.)%0A%09%09 */%0A%09%09%0A%09%09StringBuilder sb = new StringBuilder();%0A%09%09sb.append(String.format(%22INSERT%25s TABLE %25s%22, this.overwrite ? %22 OVERWRITE%22 : %22 INTO%22, this.tablename));%0A%09%09if (partitions != null)%0A%09%09%09sb.append(String.format(%22%5CnPARTITION (%25s)%22, partitions));%0A%09%09if (this.selectStatement != null)%0A%09%09%09sb.append(String.format(%22%5Cn%25s%22, this.selectStatement));%0A%09%09return sb.toString();%0A%09%7D%0A%0A%7D

Revert InsertStatement which was deleted with the previous commit.