[ 
https://issues.apache.org/jira/browse/FLINK-16366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

godfrey he updated FLINK-16366:
-------------------------------
    Description: 
This issue aims to introduce {{executeStatement}} which synchronously executes 
the given single statement immediately, and returns the execution result.

The method looks like:
{code:java}
/**
 * Synchronously execute the given single statement immediately and the 
statement can be DDL/DML/SHOW/DESCRIBE/EXPLAIN/USE. 
 * If the statement is translated to a Flink job, the result will be returned 
until the job is finished.
 *  
 * @return result for SHOW/DESCRIBE/EXPLAIN, the affected row count for `DML` 
(-1 means unknown), or a string message ("OK") for other  statements.
 * @throws Exception which occurs during the execution.
*/
ResultTable executeStatement(String statement) throws Exception;

/** 
 * A ResultTable is the representation of the statement execution result.
 */
public interface ResultTable {

  /** 
   * Get the schema of ResultTable. 
   */
    TableSchema getResultSchema();

  /**
    *Get the result contents as an iterable rows. 
    */
    Iterable<Row> getResultRows();
}
{code}



  was:
This issue aims to introduce {{executeStatement}} which synchronously executes 
the given single statement immediately, and returns the execution result.


{code:java}
/**
 * Synchronously execute the given single statement immediately and the 
statement can be DDL/DML/SHOW/DESCRIBE/EXPLAIN/USE. 
 * If the statement is translated to a Flink job, the result will be returned 
until the job is finished.
 *  
 * @return result for SHOW/DESCRIBE/EXPLAIN, the affected row count for `DML` 
(-1 means unknown), or a string message ("OK") for other  statements.
 * @throws Exception which occurs during the execution.
*/
ResultTable executeStatement(String statement) throws Exception;
{code}


{code:java}
/** 
 * A ResultTable is the representation of the statement execution result.
 */
public interface ResultTable {


  /** 
   * Get the schema of ResultTable. 
   */
    TableSchema getResultSchema();


  /**
    *Get the result contents as an iterable rows. 
    */
    Iterable<Row> getResultRows();
}
{code}




> Introduce executeStatement method in TableEnvironment
> -----------------------------------------------------
>
>                 Key: FLINK-16366
>                 URL: https://issues.apache.org/jira/browse/FLINK-16366
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / API
>            Reporter: godfrey he
>            Priority: Major
>             Fix For: 1.11.0
>
>
> This issue aims to introduce {{executeStatement}} which synchronously 
> executes the given single statement immediately, and returns the execution 
> result.
> The method looks like:
> {code:java}
> /**
>  * Synchronously execute the given single statement immediately and the 
> statement can be DDL/DML/SHOW/DESCRIBE/EXPLAIN/USE. 
>  * If the statement is translated to a Flink job, the result will be returned 
> until the job is finished.
>  *  
>  * @return result for SHOW/DESCRIBE/EXPLAIN, the affected row count for `DML` 
> (-1 means unknown), or a string message ("OK") for other  statements.
>  * @throws Exception which occurs during the execution.
> */
> ResultTable executeStatement(String statement) throws Exception;
> /** 
>  * A ResultTable is the representation of the statement execution result.
>  */
> public interface ResultTable {
>   /** 
>    * Get the schema of ResultTable. 
>    */
>     TableSchema getResultSchema();
>   /**
>     *Get the result contents as an iterable rows. 
>     */
>     Iterable<Row> getResultRows();
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to