You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/04/27 08:07:02 UTC

[GitHub] [flink] docete opened a new pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

docete opened a new pull request #11917:
URL: https://github.com/apache/flink/pull/11917


   
   ## What is the purpose of the change
   
   This PR supports create/drop temporary table in Flink SQL
   
   ## Brief change log
   
   - e172a38 support parsing TEMPORARY in table definition in sql parser
   - 74191ef support create/drop temporary table in blink planner
   - 487163f support create/drop temporary table in legacy planner
   
   ## Verifying this change
   
   This change added tests 
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (**yes** / no)
     - If yes, how is the feature documented? (not applicable / docs / **JavaDocs** / not documented)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162180374",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 487163f267a4f86452a7588f58182e534b5d7193 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162180374) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on a change in pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on a change in pull request #11917:
URL: https://github.com/apache/flink/pull/11917#discussion_r415605040



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
##########
@@ -649,16 +649,32 @@ public void sqlUpdate(String stmt) {
 	private TableResult executeOperation(Operation operation) {
 		if (operation instanceof CreateTableOperation) {
 			CreateTableOperation createTableOperation = (CreateTableOperation) operation;
-			catalogManager.createTable(
-					createTableOperation.getCatalogTable(),
-					createTableOperation.getTableIdentifier(),
-					createTableOperation.isIgnoreIfExists());
+			if (createTableOperation.isTemporary()) {
+				catalogManager.createTemporaryTable(
+						createTableOperation.getCatalogTable(),
+						createTableOperation.getTableIdentifier(),
+						createTableOperation.isIgnoreIfExists());
+			} else {
+				catalogManager.createTable(
+						createTableOperation.getCatalogTable(),
+						createTableOperation.getTableIdentifier(),
+						createTableOperation.isIgnoreIfExists());
+			}
 			return TableResultImpl.TABLE_RESULT_OK;
 		} else if (operation instanceof DropTableOperation) {
 			DropTableOperation dropTableOperation = (DropTableOperation) operation;
-			catalogManager.dropTable(
-					dropTableOperation.getTableIdentifier(),
-					dropTableOperation.isIfExists());
+			if (dropTableOperation.isTemporary()) {
+				boolean dropped = catalogManager.dropTemporaryTable(dropTableOperation.getTableIdentifier());

Review comment:
       I would suggest to extend `catalogManager.dropTemporaryTable` to take care of the logic about `ifExists`, be consistent with `catalogManager.dropTable`

##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableEnvironmentTest.scala
##########
@@ -137,6 +137,28 @@ class TableEnvironmentTest {
       .tableExists(ObjectPath.fromString(s"${tableEnv.getCurrentDatabase}.tbl1")))
   }
 
+  @Test
+  def testExecuteSqlWithCreateDropTemporaryTable(): Unit = {

Review comment:
       Testing only the simplest "create + drop" will be insufficient. At least we have to cover some illegal cases, adding some cases when temporary & normal table co-exists.  

##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableEnvironmentTest.scala
##########
@@ -137,6 +137,28 @@ class TableEnvironmentTest {
       .tableExists(ObjectPath.fromString(s"${tableEnv.getCurrentDatabase}.tbl1")))
   }
 
+  @Test
+  def testExecuteSqlWithCreateDropTemporaryTable(): Unit = {

Review comment:
       BTW, will "show tables" command also show temporary tables?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-621245147


   @rmetzger Thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on a change in pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on a change in pull request #11917:
URL: https://github.com/apache/flink/pull/11917#discussion_r416394563



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
##########
@@ -649,16 +649,32 @@ public void sqlUpdate(String stmt) {
 	private TableResult executeOperation(Operation operation) {
 		if (operation instanceof CreateTableOperation) {
 			CreateTableOperation createTableOperation = (CreateTableOperation) operation;
-			catalogManager.createTable(
-					createTableOperation.getCatalogTable(),
-					createTableOperation.getTableIdentifier(),
-					createTableOperation.isIgnoreIfExists());
+			if (createTableOperation.isTemporary()) {
+				catalogManager.createTemporaryTable(
+						createTableOperation.getCatalogTable(),
+						createTableOperation.getTableIdentifier(),
+						createTableOperation.isIgnoreIfExists());
+			} else {
+				catalogManager.createTable(
+						createTableOperation.getCatalogTable(),
+						createTableOperation.getTableIdentifier(),
+						createTableOperation.isIgnoreIfExists());
+			}
 			return TableResultImpl.TABLE_RESULT_OK;
 		} else if (operation instanceof DropTableOperation) {
 			DropTableOperation dropTableOperation = (DropTableOperation) operation;
-			catalogManager.dropTable(
-					dropTableOperation.getTableIdentifier(),
-					dropTableOperation.isIfExists());
+			if (dropTableOperation.isTemporary()) {
+				boolean dropped = catalogManager.dropTemporaryTable(dropTableOperation.getTableIdentifier());

Review comment:
       Since we are talking about CatalogManager's interface, I think it's make sense to compare the interfaces belong to CatalogManager. It looks a bit strange that some of the 'ignoreIfNotExists' logic is happened inside CatalogManager, but some of them are handled out of CatalogManager. I would suggest to keep it consistent. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162180374",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 487163f267a4f86452a7588f58182e534b5d7193 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162180374) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] docete commented on a change in pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
docete commented on a change in pull request #11917:
URL: https://github.com/apache/flink/pull/11917#discussion_r415627411



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableEnvironmentTest.scala
##########
@@ -137,6 +137,28 @@ class TableEnvironmentTest {
       .tableExists(ObjectPath.fromString(s"${tableEnv.getCurrentDatabase}.tbl1")))
   }
 
+  @Test
+  def testExecuteSqlWithCreateDropTemporaryTable(): Unit = {

Review comment:
       The ITCase `testTemporaryTableMaskPermanentTableWithSameName` test co-exists cases. 

##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableEnvironmentTest.scala
##########
@@ -137,6 +137,28 @@ class TableEnvironmentTest {
       .tableExists(ObjectPath.fromString(s"${tableEnv.getCurrentDatabase}.tbl1")))
   }
 
+  @Test
+  def testExecuteSqlWithCreateDropTemporaryTable(): Unit = {

Review comment:
       `show tables` show both temporary and permanent tables




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162180374",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162221841",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     }, {
       "hash" : "91669c729482b8d2b9476f0216ed88b3612f8637",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162601736",
       "triggerID" : "91669c729482b8d2b9476f0216ed88b3612f8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "91669c729482b8d2b9476f0216ed88b3612f8637",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=396",
       "triggerID" : "91669c729482b8d2b9476f0216ed88b3612f8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "647f123e52bbe3ed8704029baac1fdea5c0811e1",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "647f123e52bbe3ed8704029baac1fdea5c0811e1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 012133641bb130c7c5f79c5d1f4bfede326a3961 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162221841) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322) 
   * 91669c729482b8d2b9476f0216ed88b3612f8637 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162601736) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=396) 
   * 647f123e52bbe3ed8704029baac1fdea5c0811e1 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-621203515


   Sorry for these issues Kurt! I asked Chesnay to look into the bot.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162180374",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162221841",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 012133641bb130c7c5f79c5d1f4bfede326a3961 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162221841) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-621196151


   @docete can you do a rebase and force push to trigger the tests?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162180374",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 487163f267a4f86452a7588f58182e534b5d7193 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162180374) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302) 
   * 012133641bb130c7c5f79c5d1f4bfede326a3961 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162180374",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162221841",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     }, {
       "hash" : "91669c729482b8d2b9476f0216ed88b3612f8637",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "91669c729482b8d2b9476f0216ed88b3612f8637",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 012133641bb130c7c5f79c5d1f4bfede326a3961 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162221841) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322) 
   * 91669c729482b8d2b9476f0216ed88b3612f8637 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-621233310


   Chesnay has deployed a (hopefully) fixed version of the bot.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162180374",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162221841",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 487163f267a4f86452a7588f58182e534b5d7193 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162180374) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302) 
   * 012133641bb130c7c5f79c5d1f4bfede326a3961 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162221841) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] docete commented on a change in pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
docete commented on a change in pull request #11917:
URL: https://github.com/apache/flink/pull/11917#discussion_r417059442



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
##########
@@ -649,16 +649,32 @@ public void sqlUpdate(String stmt) {
 	private TableResult executeOperation(Operation operation) {
 		if (operation instanceof CreateTableOperation) {
 			CreateTableOperation createTableOperation = (CreateTableOperation) operation;
-			catalogManager.createTable(
-					createTableOperation.getCatalogTable(),
-					createTableOperation.getTableIdentifier(),
-					createTableOperation.isIgnoreIfExists());
+			if (createTableOperation.isTemporary()) {
+				catalogManager.createTemporaryTable(
+						createTableOperation.getCatalogTable(),
+						createTableOperation.getTableIdentifier(),
+						createTableOperation.isIgnoreIfExists());
+			} else {
+				catalogManager.createTable(
+						createTableOperation.getCatalogTable(),
+						createTableOperation.getTableIdentifier(),
+						createTableOperation.isIgnoreIfExists());
+			}
 			return TableResultImpl.TABLE_RESULT_OK;
 		} else if (operation instanceof DropTableOperation) {
 			DropTableOperation dropTableOperation = (DropTableOperation) operation;
-			catalogManager.dropTable(
-					dropTableOperation.getTableIdentifier(),
-					dropTableOperation.isIfExists());
+			if (dropTableOperation.isTemporary()) {
+				boolean dropped = catalogManager.dropTemporaryTable(dropTableOperation.getTableIdentifier());

Review comment:
       OK. I can refactor the CatalogManager first.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162180374",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162221841",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 487163f267a4f86452a7588f58182e534b5d7193 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162180374) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302) 
   * 012133641bb130c7c5f79c5d1f4bfede326a3961 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162221841) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-621603904


   run mvn verify locally and passed


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on a change in pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on a change in pull request #11917:
URL: https://github.com/apache/flink/pull/11917#discussion_r415752200



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableEnvironmentTest.scala
##########
@@ -137,6 +137,28 @@ class TableEnvironmentTest {
       .tableExists(ObjectPath.fromString(s"${tableEnv.getCurrentDatabase}.tbl1")))
   }
 
+  @Test
+  def testExecuteSqlWithCreateDropTemporaryTable(): Unit = {

Review comment:
       I don't think `testTemporaryTableMaskPermanentTableWithSameName`  is enough either




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] docete commented on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
docete commented on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-620484300


   @KurtYoung added more tests, pls have another look.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-621394249


   @flinkbot run azure


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] docete commented on a change in pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
docete commented on a change in pull request #11917:
URL: https://github.com/apache/flink/pull/11917#discussion_r415691459



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
##########
@@ -649,16 +649,32 @@ public void sqlUpdate(String stmt) {
 	private TableResult executeOperation(Operation operation) {
 		if (operation instanceof CreateTableOperation) {
 			CreateTableOperation createTableOperation = (CreateTableOperation) operation;
-			catalogManager.createTable(
-					createTableOperation.getCatalogTable(),
-					createTableOperation.getTableIdentifier(),
-					createTableOperation.isIgnoreIfExists());
+			if (createTableOperation.isTemporary()) {
+				catalogManager.createTemporaryTable(
+						createTableOperation.getCatalogTable(),
+						createTableOperation.getTableIdentifier(),
+						createTableOperation.isIgnoreIfExists());
+			} else {
+				catalogManager.createTable(
+						createTableOperation.getCatalogTable(),
+						createTableOperation.getTableIdentifier(),
+						createTableOperation.isIgnoreIfExists());
+			}
 			return TableResultImpl.TABLE_RESULT_OK;
 		} else if (operation instanceof DropTableOperation) {
 			DropTableOperation dropTableOperation = (DropTableOperation) operation;
-			catalogManager.dropTable(
-					dropTableOperation.getTableIdentifier(),
-					dropTableOperation.isIfExists());
+			if (dropTableOperation.isTemporary()) {
+				boolean dropped = catalogManager.dropTemporaryTable(dropTableOperation.getTableIdentifier());

Review comment:
       `TableEnvironment#dropTemporaryTable` and `dropTemporaryView` also return `boolean` which is consistent with `CatalogManager#dropTemporaryTable` and `dropTemporaryView`. Shall we refactor these interfaces in another ticket?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619810226


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 487163f267a4f86452a7588f58182e534b5d7193 (Mon Apr 27 08:09:11 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162180374",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162221841",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     }, {
       "hash" : "91669c729482b8d2b9476f0216ed88b3612f8637",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162601736",
       "triggerID" : "91669c729482b8d2b9476f0216ed88b3612f8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "91669c729482b8d2b9476f0216ed88b3612f8637",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=396",
       "triggerID" : "91669c729482b8d2b9476f0216ed88b3612f8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "647f123e52bbe3ed8704029baac1fdea5c0811e1",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "647f123e52bbe3ed8704029baac1fdea5c0811e1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 91669c729482b8d2b9476f0216ed88b3612f8637 Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/162601736) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=396) 
   * 647f123e52bbe3ed8704029baac1fdea5c0811e1 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 487163f267a4f86452a7588f58182e534b5d7193 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11917: [FLINK-15591][table] Support create/drop temporary table in Flink SQL

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11917:
URL: https://github.com/apache/flink/pull/11917#issuecomment-619827493


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162180374",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "487163f267a4f86452a7588f58182e534b5d7193",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=302",
       "triggerID" : "487163f267a4f86452a7588f58182e534b5d7193",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162221841",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     }, {
       "hash" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322",
       "triggerID" : "012133641bb130c7c5f79c5d1f4bfede326a3961",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 012133641bb130c7c5f79c5d1f4bfede326a3961 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162221841) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=322) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org