001package gudusoft.gsqlparser.stmt;
002
003import gudusoft.gsqlparser.*;
004import gudusoft.gsqlparser.nodes.*;
005import gudusoft.gsqlparser.nodes.EHiveInsertType;
006import gudusoft.gsqlparser.nodes.EOnConflictActionType;
007import gudusoft.gsqlparser.nodes.oracle.TErrorLoggingClause;
008import gudusoft.gsqlparser.stmt.mssql.TMssqlExecute;
009
010import java.util.ArrayList;
011
012/**
013 * SQL insert statement.
014 * <br>
015 * <br> {@link #getTargetTable} returns the table or view that receive the data.
016 * <br> {@link #getColumnList()} returns the list of columns in target table if specified.
017 * <br> Usually, the data comes from a value clause, you can get those values from {@link #getValues()}.
018 * <br> Always checking {@link #getInsertSource} before fetch the data source which may various from value clause
019 * to subquery and other forms. Below are some data source types:
020 * <ul>
021 *     <li>{@link EInsertSource#values} -&gt; {@link #getValues()}</li>
022 *     <li>{@link EInsertSource#subquery} -&gt; {@link #getSubQuery()}</li>
023 * </ul>
024 *
025 * <br>Examples:
026 * <pre>
027 * INSERT INTO Production.UnitMeasure (Name, UnitMeasureCode,ModifiedDate)
028 * VALUES (N'Square Yards', N'Y2', GETDATE());
029 * </pre>
030 * Table name: Production.UnitMeasure. Fetched from {@link #getTargetTable} or the first element of {@link #tables}
031 * <br>column list: (Name, UnitMeasureCode,ModifiedDate). Fetch from {@link #getColumnList}
032 * <br>value list: (N'Square Yards', N'Y2', GETDATE()). Fetch from {@link #getValues}
033 * <br>
034 * <pre>
035 * INSERT INTO dbo.EmployeeSales
036 * SELECT 'SELECT', sp.BusinessEntityID, c.LastName, sp.SalesYTD
037 * FROM Sales.SalesPerson AS sp
038 * INNER JOIN Person.Person AS c
039 * ON sp.BusinessEntityID = c.BusinessEntityID
040 * WHERE sp.BusinessEntityID LIKE '2%'
041 * ORDER BY sp.BusinessEntityID, c.LastName;
042 * </pre>
043 * select query in above insert statement can be fetched from {@link #getSubQuery}
044 *
045 * @see TCustomSqlStatement#cteList
046 * @see TCustomSqlStatement#targetTable
047 * @see TCustomSqlStatement#outputClause
048 * @see TCustomSqlStatement#returningClause
049 *
050 */
051public class TInsertSqlStatement extends TCustomSqlStatement {
052
053    private ArrayList<TInsertSqlStatement> multiInsertStatements;
054
055    /**
056     * Hive, from table insert..., insert ...
057     * @return
058     */
059    public ArrayList<TInsertSqlStatement> getMultiInsertStatements() {
060        if (this.multiInsertStatements == null){
061            this.multiInsertStatements = new ArrayList<>();
062        }
063        return multiInsertStatements;
064    }
065
066    private String fileFormat;
067    private String fileOptions = null;
068
069    public String getFileFormat() {
070        return fileFormat;
071    }
072
073    public String getFileOptions() {
074        return fileOptions;
075    }
076
077    private TObjectName sourceValueTable;
078
079    public TObjectName getSourceValueTable() {
080        return sourceValueTable;
081    }
082
083    private boolean insertAll = false;
084    private boolean insertFirst = false;
085
086    public void setInsertAll(boolean insertAll) {
087        this.insertAll = insertAll;
088    }
089
090    public void setInsertFirst(boolean insertFirst) {
091        this.insertFirst = insertFirst;
092    }
093
094    /**
095     * Oracle insert all
096     * @return Oracle insert all
097     */
098    public boolean isInsertAll() {
099
100        return insertAll;
101    }
102
103    /**
104     * Oracle insert first
105     * @return Oracle insert first
106     */
107    public boolean isInsertFirst() {
108        return insertFirst;
109    }
110
111    private TErrorLoggingClause errorLoggingClause;
112
113    /**
114     * Oracle error logging clause
115     * @return Oracle error logging clause
116     */
117    public TErrorLoggingClause getErrorLoggingClause() {
118        return errorLoggingClause;
119    }
120
121    /**
122     * Hive insert type
123     * @return Hive insert type
124     */
125    public EHiveInsertType getHiveInsertType() {
126        return hiveInsertType;
127    }
128
129    /**
130     * Hive directory name
131     * @return directory name
132     */
133    public TObjectName getDirectoryName() {
134        if( (directoryName == null)&&(fileOptions != null)){
135            String a[] = fileOptions.split("[,]");
136            for(String s:a){
137                if (s.trim().startsWith("\'path\'")){
138                    directoryName = TObjectName.createObjectName (this.dbvendor, EDbObjectType.directory_path, new TSourceToken(s.split("[ ]")[1]));
139                    break;
140                }
141            }
142        }
143        return directoryName;
144    }
145
146
147    private EHiveInsertType hiveInsertType = EHiveInsertType.intoUnknown;
148    private TObjectName directoryName = null;
149
150    private TPTNodeList<TInsertCondition>  insertConditions;
151    private TPTNodeList<TInsertIntoValue> insertIntoValues;
152
153    /**
154     * Oracle insert condition
155     * @return Oracle insert condition
156     */
157    public TPTNodeList<TInsertCondition> getInsertConditions() {
158        return insertConditions;
159    }
160
161    /**
162     * Oracle insert into values used after insert all/first clause
163     * @return Oracle insert into values used after insert all/first clause
164     */
165    public TPTNodeList<TInsertIntoValue> getInsertIntoValues() {
166        return insertIntoValues;
167    }
168
169    public void setInsertToken(TSourceToken insertToken) {
170        this.insertToken = insertToken;
171    }
172
173    /**
174     * INSERT keyword
175     * @return INSERT keyword
176     */
177    public TSourceToken getInsertToken() {
178
179        return insertToken;
180    }
181
182    private TSourceToken insertToken = null;
183    
184    /**
185     * value clause valid when {@link #getInsertSource} is {@link gudusoft.gsqlparser.EInsertSource#subquery}.
186     * @return {@link gudusoft.gsqlparser.stmt.TSelectSqlStatement sub-query}
187     */
188    public TSelectSqlStatement getSubQuery() {
189        return subQuery;
190    }
191
192    private TSelectSqlStatement subQuery = null;
193
194    private TFunctionCall functionCall = null;
195
196    private TMssqlExecute executeStmt = null;
197
198    /**
199     * value clause valid when {@link #getInsertSource} is {@link gudusoft.gsqlparser.EInsertSource#values_function}.
200     * @return row value was constructed by a function.
201     */
202    public TFunctionCall getFunctionCall() {
203        return functionCall;
204    }
205
206    /**
207     * Oracle PLSQL record name in values clause, {@link #getInsertSource} returns {@link  EInsertSource#values_oracle_record}
208     * @return record name in plsql.
209     */
210    public TObjectName getRecordName() {
211        return recordName;
212    }
213
214    private  TObjectName recordName = null;
215
216    /**
217     * Type of the source from where the data is coming for this insert statement.
218     * @return Type of the data source
219     */
220    public EInsertSource getInsertSource() {
221        return insertSource;
222    }
223
224    private EInsertSource insertSource = EInsertSource.values;
225
226    /**
227     * @deprecated As of v1.6.4.9, use {@link #getInsertSource} instead.
228     *
229     * @return how rows was insert into table. value can be one of
230     * <p>vt_values,  {@link #getValues}
231     * <p>vt_values_empty, syntax like: value ()
232     * <p>vt_query,   {@link #getSubQuery}
233     * <p>vt_default_values,
234     * <p>vt_execute,
235     * <p>vt_values_function, {@link #getFunctionCall} 
236     */
237    public int getValueType() {
238        return valueType;
239    }
240
241    /**
242     * value clause, valid when {@link #getInsertSource} is {@link EInsertSource#values}.
243     * represents in format like this: ((1,2,3),(4,5),(6,7,8)),
244     * if even value clause is (1,2,3), it will be saved in {@link TMultiTargetList} like ((1,2,3))
245     * <br>
246     * @return a single row value, or multi row values returned by query or value constructor.
247     */
248    public TMultiTargetList getValues() {
249        return values;
250    }
251
252    private TMultiTargetList values = null;
253
254    private int valueType = TBaseType.vt_values;
255
256    private TResultColumnList setColumnValues = null;
257
258    private TSourceToken ignore;
259    private TSourceToken priority_delayed;
260
261    private TResultColumnList onDuplicateKeyUpdate = null;
262
263    /**
264     * MySQL on duplicate key update column list.
265     * @return MySQL on duplicate key update column list
266     */
267    public TResultColumnList getOnDuplicateKeyUpdate() {
268        return onDuplicateKeyUpdate;
269    }
270
271    /**
272     * MySQL 8.0.20+ row alias for INSERT ... ON DUPLICATE KEY UPDATE.
273     * Allows referencing the inserted row values without using VALUES() function.
274     * Example: INSERT INTO t1 (a,b,c) VALUES (1,2,3) AS new ON DUPLICATE KEY UPDATE c = new.a+new.b;
275     */
276    private TObjectName insertRowAlias = null;
277
278    /**
279     * MySQL 8.0.20+ optional column aliases for the row alias.
280     * Example: INSERT INTO t1 (a,b,c) VALUES (1,2,3) AS new(m,n,p) ON DUPLICATE KEY UPDATE c = m+n;
281     */
282    private TObjectNameList insertRowAliasColumnList = null;
283
284    /**
285     * Get MySQL 8.0.20+ row alias for INSERT ... ON DUPLICATE KEY UPDATE.
286     * @return the row alias name, or null if not specified
287     */
288    public TObjectName getInsertRowAlias() {
289        return insertRowAlias;
290    }
291
292    /**
293     * Get MySQL 8.0.20+ optional column aliases for the row alias.
294     * @return the column alias list, or null if not specified
295     */
296    public TObjectNameList getInsertRowAliasColumnList() {
297        return insertRowAliasColumnList;
298    }
299
300    private TOnConflictClause onConflictClause;
301
302    /**
303     * PostgreSQL ON CONFLICT clause (UPSERT).
304     * <p>Provides access to the conflict target (columns or constraint name),
305     * the action type (DO NOTHING or DO UPDATE), and the SET/WHERE clauses
306     * for DO UPDATE actions.
307     *
308     * <p>Example:
309     * <pre>
310     * INSERT INTO tbl VALUES (1, 2) ON CONFLICT (id) DO UPDATE SET col = EXCLUDED.col;
311     * </pre>
312     *
313     * @return the ON CONFLICT clause, or null if not present
314     */
315    public TOnConflictClause getOnConflictClause() {
316        return onConflictClause;
317    }
318
319    /**
320     * IGNORE keyword used in the insert statement.
321     * @return IGNORE keyword if used, otherwise, returns null.
322     */
323    public TSourceToken getIgnore() {
324
325        return ignore;
326    }
327
328    /**
329     * DELAY, LOW_PRIORITY, HIGH_PRIORITY keyword used in insert statement.
330     * @return null if none of those keywords is used: DELAY, LOW_PRIORITY, HIGH_PRIORITY
331     */
332    public TSourceToken getPriority_delayed() {
333        return priority_delayed;
334    }
335
336    /**
337     * set column value clauses in MySQL insert statement.
338     * @return MySQL specific column value list.
339     */
340    public TResultColumnList getSetColumnValues() {
341        return setColumnValues;
342    }
343
344    public TInsertSqlStatement(EDbVendor dbvendor) {
345        super(dbvendor);
346        sqlstatementtype = ESqlStatementType.sstinsert;
347    }
348
349    void buildsql() {
350    }
351
352    void clear() {
353    }
354
355    String getasprettytext() {
356        return "";
357    }
358
359    void iterate(TVisitorAbs pvisitor) {
360    }
361
362    /**
363     * columns of the target table.
364     * @return column name list in insert into clause.
365     */
366    public TObjectNameList getColumnList() {
367        return columnList;
368    }
369
370    private TObjectNameList columnList = null;
371
372    public void setValues(TMultiTargetList values) {
373        this.values = values;
374    }
375
376    public void setColumnList(TObjectNameList columnList) {
377        this.columnList = columnList;
378    }
379
380    public void setSubQuery(TSelectSqlStatement subQuery) {
381        insertSource = EInsertSource.subquery;
382        this.subQuery = subQuery;
383    }
384
385    /**
386     * SQL Server, execute statement used in the insert statement.
387     * {@link #getInsertSource()} returns {@link EInsertSource#execute}
388     *
389     * @return SQL Server, execute statement
390     */
391    public TMssqlExecute getExecuteStmt() {
392        return executeStmt;
393    }
394
395    private TPTNodeList<TInsertIntoValue> elseIntoValues;
396
397    /**
398     * Oracle,  values in else clause
399     * @return values in else clause
400     */
401    public TPTNodeList<TInsertIntoValue> getElseIntoValues() {
402        return elseIntoValues;
403    }
404
405    public int doParseStatement(TCustomSqlStatement psql) {
406        if (rootNode == null) return -1;
407        TInsertSqlNode insertNode = (TInsertSqlNode)rootNode;
408
409        if (this.sourcetokenlist.size() == 0){
410            // subquery nested in other statements.
411            this.setStartToken(insertNode.getStartToken());
412            this.setEndToken(insertNode.getEndToken());
413        }
414
415        super.doParseStatement(psql);
416
417        this.insertToken = insertNode.getInsertToken();
418        this.ignore = insertNode.getIgnore();
419        this.priority_delayed = insertNode.getPriority_delayed();
420        this.insertAll = insertNode.isInsertAll();
421        this.insertFirst = insertNode.isInsertFirst();
422        this.hiveInsertType = insertNode.getHiveInsertType();
423
424        this.valueType = insertNode.getValueType();
425
426        if((dbvendor == EDbVendor.dbvhive)||(dbvendor == EDbVendor.dbvsparksql)){
427
428            this.hiveInsertType = insertNode.getHiveInsertType();
429            this.directoryName = insertNode.getDirectoryName();
430            this.fileFormat = insertNode.getFileFormat();
431            this.fileOptions = insertNode.getFileOptions();
432            if (insertNode.getInsertSqlNodes() != null){
433                for(int i=1;i<insertNode.getInsertSqlNodes().size();i++){
434                    // i=1, start from the second insert statement, the first is this insert statement itself.
435                    TInsertSqlStatement newInsert = new TInsertSqlStatement(this.dbvendor);
436                    newInsert.rootNode = insertNode.getInsertSqlNodes().get(i);
437                    newInsert.setFrameStack(this.getFrameStack());
438                    newInsert.doParseStatement(psql);
439                    this.getMultiInsertStatements().add(newInsert);
440                }
441            }
442        }
443
444        if (insertNode.cteList != null){
445            this.setCteList( insertNode.cteList);
446            this.getCteList().doParse(this, ESqlClause.cte);
447        }
448
449
450        if (insertNode.getTopClause() != null){
451           insertNode.getTopClause().doParse(this,ESqlClause.top);
452           this.setTopClause(insertNode.getTopClause());
453        }
454
455        if ((this.valueType != TBaseType.vt_values_multi_table)
456                &&(insertNode.getTargetTable() != null)
457            )
458        {
459           // System.out.println(insertNode.getTargetTable().toString());
460           TTable lcTable = analyzeFromTable(insertNode.getTargetTable(),true);
461           lcTable.setEffectType(ETableEffectType.tetInsert);
462           setTargetTable(lcTable);
463           this.getRelations().add(lcTable);
464        }
465
466        if (insertNode.getColumnList() != null){
467            this.columnList = insertNode.getColumnList(); 
468            TObjectName crf ;
469            for (int i=0;i< insertNode.getColumnList().size();i++){
470                crf =insertNode.getColumnList().getObjectName(i);
471                // link this column to last 2 tables
472                crf.setLocation(ESqlClause.insertColumn);
473                getTargetTable().getObjectNameReferences().addObjectName(crf);
474                getTargetTable().getLinkedColumns().addObjectName(crf);
475                crf.setSourceTable(getTargetTable());
476            }
477
478            //insertNode.getColumnList().doParse(this,TBaseType.insertColumnClause);
479        }
480
481        if (insertNode.getOutputClause() != null){
482            insertNode.getOutputClause().doParse(this,ESqlClause.output);
483            this.setOutputClause(insertNode.getOutputClause());
484        }
485
486        switch(valueType){
487            case TBaseType.vt_values:
488                insertSource = EInsertSource.values;
489                insertNode.getValues().doParse(this,ESqlClause.insertValues);
490                this.values = insertNode.getValues();
491                // check is count of value list is the same as column list
492                if (columnList != null){
493                    TMultiTarget mt;
494                    TSourceToken st1;
495                    for(int k=0;k<values.size();k++){
496                        mt = values.getMultiTarget(k);
497                        if (mt.getColumnList() == null) continue;
498                        if (mt.getColumnList().size() == 0) continue;
499                        if (mt.getColumnList().getResultColumn(0).getExpr() == null) continue;
500                        if (mt.getColumnList().getResultColumn(0).getExpr().getExpressionType() == EExpressionType.subquery_t) continue;
501                        if (mt.getColumnList().size() != columnList.size()){
502                            st1 = mt.getColumnList().getStartToken();
503                            TSyntaxError err = new TSyntaxError(st1.toString()
504                                    ,st1.lineNo,st1.columnNo
505                                    ,String.format("value count(%d) is not the same as column list(%d)",mt.getColumnList().size(),columnList.size())
506                                    ,EErrorType.sperror ,TBaseType.MSG_ERROR_INSERT_VALUE_COLUMN_NUMBER_NOT_MATCH,this,st1.posinlist);
507                            this.parseerrormessagehandle( err);
508                        }
509                    }
510                }
511                break;
512            case TBaseType.vt_values_empty:
513                insertSource = EInsertSource.values_empty;
514                break;
515            case TBaseType.vt_values_multi_table:
516                insertSource = EInsertSource.values_multi_table;
517                if (subQuery == null){
518                    subQuery = new TSelectSqlStatement(this.dbvendor);
519                    subQuery.rootNode = insertNode.getSubQueryNode();
520                }
521                subQuery.doParseStatement(this);
522
523                break;
524            case TBaseType.vt_query:
525                insertSource = EInsertSource.subquery;
526                if (subQuery == null){
527                    subQuery = new TSelectSqlStatement(this.dbvendor);
528                    subQuery.rootNode = insertNode.getSubQueryNode();
529                }
530                subQuery.doParseStatement(this);
531                break;
532            case TBaseType.vt_hive_query:
533                insertSource = EInsertSource.hive_query;
534                if (subQuery == null){
535                    subQuery = new TSelectSqlStatement(this.dbvendor);
536                    subQuery.rootNode = insertNode.getSubQueryNode();
537                }
538                subQuery.doParseStatement(this);
539                break;
540            case TBaseType.vt_default_values:
541                insertSource = EInsertSource.default_values;
542                break;
543            case TBaseType.vt_execute:
544                insertSource = EInsertSource.execute;
545                executeStmt = new TMssqlExecute(EDbVendor.dbvmssql);
546                executeStmt.rootNode = insertNode.getExecuteSqlNode();
547                executeStmt.doParseStatement(this);
548                break;
549            case TBaseType.vt_values_function:
550                insertSource = EInsertSource.values_function;
551                insertNode.getFunctionCall().doParse(this,ESqlClause.insertValues);
552
553                this.functionCall = insertNode.getFunctionCall(); 
554                break;
555            case TBaseType.vt_values_oracle_record:
556                insertSource = EInsertSource.values_oracle_record;
557                insertNode.getRecordName().doParse(this,ESqlClause.insertValues);
558                this.recordName = insertNode.getRecordName();
559                break;
560            case TBaseType.vt_set_column_value:
561                insertSource = EInsertSource.set_column_value;
562                this.setColumnValues = insertNode.getSetColumnValues();
563                this.setColumnValues.doParse(this,ESqlClause.insertValues);
564                break;
565            case TBaseType.vt_table:
566                insertSource = EInsertSource.value_table;
567                this.sourceValueTable = insertNode.getSourceValueTable();
568                break;
569        }
570
571        if (insertNode.getInsertConditions() != null){
572            this.valueType = TBaseType.vt_values_multi_table;
573            this.insertConditions = insertNode.getInsertConditions();
574            this.insertConditions.doParse(this,ESqlClause.insertValues);
575            setTargetTable(insertConditions.getElement(0).getInsertIntoValues().getElement(0).getTable() );
576        }
577
578        if (insertNode.getInsertIntoValues() != null){
579            this.valueType = TBaseType.vt_values_multi_table;
580            this.insertIntoValues = insertNode.getInsertIntoValues();
581            this.insertIntoValues.doParse(this,ESqlClause.insertValues);
582            setTargetTable(insertIntoValues.getElement(0).getTable());
583        }
584
585        if (insertNode.getElseIntoValues() != null){
586            this.valueType = TBaseType.vt_values_multi_table;
587            this.elseIntoValues = insertNode.getElseIntoValues();
588            this.elseIntoValues.doParse(this,ESqlClause.insertValues);
589            setTargetTable(elseIntoValues.getElement(0).getTable());
590        }
591
592        if (insertNode.getReturningClause() != null){
593            insertNode.getReturningClause().doParse(this,ESqlClause.returning);
594            this.setReturningClause(insertNode.getReturningClause());
595        }
596
597        if (insertNode.getOnDuplicateKeyUpdate() != null){
598            this.onDuplicateKeyUpdate = insertNode.getOnDuplicateKeyUpdate();
599            onDuplicateKeyUpdate.doParse(this,ESqlClause.unknown);
600        }
601
602        // MySQL 8.0.20+ row alias for INSERT ... ON DUPLICATE KEY UPDATE
603        this.insertRowAlias = insertNode.getInsertRowAlias();
604        this.insertRowAliasColumnList = insertNode.getInsertRowAliasColumnList();
605
606        // PostgreSQL ON CONFLICT clause
607        if (insertNode.getOnConflictClause() != null){
608            this.onConflictClause = insertNode.getOnConflictClause();
609            onConflictClause.doParse(this, ESqlClause.unknown);
610        }
611
612        errorLoggingClause = insertNode.getErrorLoggingClause();
613        return 0;
614    }
615
616    public void accept(TParseTreeVisitor v){
617        v.preVisit(this);
618
619        v.postVisit(this);
620    }
621
622    public void acceptChildren(TParseTreeVisitor v){
623        v.preVisit(this);
624
625        if (this.getCteList() != null){
626            this.getCteList().acceptChildren(v);
627        }
628
629        if (this.getTopClause() != null){
630            this.getTopClause().acceptChildren(v);
631        }
632
633        if (this.getTargetTable() != null){
634            this.getTargetTable().acceptChildren(v);
635        }
636
637        if (this.getColumnList() != null){
638            this.getColumnList().acceptChildren(v);
639        }
640
641        if (this.getOutputClause() != null){
642            this.getOutputClause().acceptChildren(v);
643        }
644
645        switch(this.getValueType()){
646            case TBaseType.vt_values:
647                if (this.getValues() != null) {
648                    this.getValues().acceptChildren(v);
649                }
650                break;
651            case TBaseType.vt_values_empty:
652                break;
653            case TBaseType.vt_query:
654                if (this.getSubQuery() != null) {
655                    this.getSubQuery().acceptChildren(v);
656                }
657                break;
658            case TBaseType.vt_values_function:
659                if (this.getFunctionCall() != null) {
660                    this.getFunctionCall().acceptChildren(v);
661                }
662                break;
663            case TBaseType.vt_values_oracle_record:
664                if (this.getRecordName() != null) {
665                    this.getRecordName().acceptChildren(v);
666                }
667                break;
668            case TBaseType.vt_set_column_value:
669                if (this.getSetColumnValues() != null) {
670                    this.getSetColumnValues().acceptChildren(v);
671                }
672                break;
673            case TBaseType.vt_values_multi_table:
674                // Oracle INSERT ALL/FIRST: traverse conditional inserts, unconditional inserts, else clause, and source subquery
675                if (this.getInsertConditions() != null) {
676                    this.getInsertConditions().acceptChildren(v);
677                }
678                if (this.getInsertIntoValues() != null) {
679                    this.getInsertIntoValues().acceptChildren(v);
680                }
681                if (this.getElseIntoValues() != null) {
682                    this.getElseIntoValues().acceptChildren(v);
683                }
684                if (this.getSubQuery() != null) {
685                    this.getSubQuery().acceptChildren(v);
686                }
687                break;
688            default:
689                break;
690        }
691
692        if (this.onConflictClause != null){
693            this.onConflictClause.acceptChildren(v);
694        }
695
696        if (this.getReturningClause() != null){
697            this.getReturningClause().acceptChildren(v);
698        }
699
700        v.postVisit(this);
701    }
702
703    public void setErrorLoggingClause(TErrorLoggingClause errorLoggingClause) {
704        this.errorLoggingClause = errorLoggingClause;
705    }
706
707    public void setHiveInsertType(EHiveInsertType hiveInsertType) {
708        this.hiveInsertType = hiveInsertType;
709    }
710
711    public void setDirectoryName(TObjectName directoryName) {
712        this.directoryName = directoryName;
713    }
714
715    public void setInsertConditions(TPTNodeList<TInsertCondition> insertConditions) {
716        this.insertConditions = insertConditions;
717    }
718
719    public void setInsertIntoValues(TPTNodeList<TInsertIntoValue> insertIntoValues) {
720        this.insertIntoValues = insertIntoValues;
721    }
722
723    public void setFunctionCall(TFunctionCall functionCall) {
724        this.functionCall = functionCall;
725    }
726
727    public void setExecuteStmt(TMssqlExecute executeStmt) {
728        this.executeStmt = executeStmt;
729    }
730
731    public void setRecordName(TObjectName recordName) {
732        this.recordName = recordName;
733    }
734
735    public void setInsertSource(EInsertSource insertSource) {
736        this.insertSource = insertSource;
737    }
738
739    public void setValueType(int valueType) {
740        this.valueType = valueType;
741    }
742
743    public void setSetColumnValues(TResultColumnList setColumnValues) {
744        this.setColumnValues = setColumnValues;
745    }
746
747    public void setOnDuplicateKeyUpdate(TResultColumnList onDuplicateKeyUpdate) {
748        this.onDuplicateKeyUpdate = onDuplicateKeyUpdate;
749    }
750}