All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clickzetta.platform.client.MultiRowCreate Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.clickzetta.platform.client;

import com.clickzetta.platform.client.api.Row;

public interface MultiRowCreate extends RowCreate {

  /**
   * create InsertRow.
   *
   * @return
   */
  Row createInsertRow(String schemaName, String tableName);

  /**
   * create InsertIgnoreRow.
   *
   * @return
   */
  Row createInsertIgnoreRow(String schemaName, String tableName);

  /**
   * create UpdateRow.
   *
   * @return
   */
  Row createUpdateRow(String schemaName, String tableName);

  /**
   * create UpsertRow.
   *
   * @return
   */
  Row createUpsertRow(String schemaName, String tableName);

  /**
   * create DeleteRow.
   *
   * @return
   */
  Row createDeleteRow(String schemaName, String tableName);

  /**
   * create DeleteIgnoreRow.
   *
   * @return
   */
  Row createDeleteIgnoreRow(String schemaName, String tableName);

  /**
   * create stream row with target operator.
   *
   * @param operator
   * @return
   */
  default Row createRow(Operator operator, String schemaName, String tableName) {
    Row row = null;
    switch (operator) {
      case INSERT:
        row = createInsertRow(schemaName, tableName);
        break;
      case INSERT_IGNORE:
        row = createInsertIgnoreRow(schemaName, tableName);
        break;
      case UPDATE:
        row = createUpdateRow(schemaName, tableName);
        break;
      case UPSERT:
        row = createUpsertRow(schemaName, tableName);
        break;
      case DELETE:
        row = createDeleteRow(schemaName, tableName);
        break;
      case DELETE_IGNORE:
        row = createDeleteIgnoreRow(schemaName, tableName);
        break;
    }
    return row;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy