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/02/18 04:16:14 UTC

[GitHub] [flink] bowenli86 opened a new pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

bowenli86 opened a new pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116
 
 
   ## What is the purpose of the change
   
   add 'create catalog' DDL to blink planner
   
   ## Brief change log
   
   - add ddl to sql parser and table environment
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - FlinkSqlParserImplTest
   - CatalogITCase in blink planner
   
   ## Does this pull request potentially affect one of the following parts:
   
   n/a
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (docs)
   
   docs will be in a separate pr
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-588476570
 
 
   @danny0405 thanks for the review! please take 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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149381924 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/149507422 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   -->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149381924) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262) 
   * 53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/149507422) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] libenchao commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
libenchao commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r380455435
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/operations/SqlToOperationConverter.java
 ##########
 @@ -358,6 +364,22 @@ private Operation convertUseCatalog(SqlUseCatalog useCatalog) {
 		return new UseCatalogOperation(useCatalog.getCatalogName());
 	}
 
+	/** Convert CREATE CATALOG statement. */
+	private Operation convertCreateCatalog(SqlCreateCatalog sqlCreateCatalog) {
+		String catalogName = sqlCreateCatalog.catalogName();
+
+		// set with properties
+		Map<String, String> properties = new HashMap<>();
+		sqlCreateCatalog.getPropertyList().getList().forEach(p ->
+			properties.put(((SqlTableOption) p).getKeyString(), ((SqlTableOption) p).getValueString()));
 
 Review comment:
   maybe we can use `Collectors.toMap` ?

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587270611
 
 
   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 7d09ea38e74e801907d3f1da660c41f5cf739a29 (Tue Feb 18 04:18:16 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


With regards,
Apache Git Services

[GitHub] [flink] danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r382341656
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/catalog/CatalogITCase.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.catalog;
+
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.api.EnvironmentSettings;
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.api.java.StreamTableEnvironment;
+import org.apache.flink.table.catalog.GenericInMemoryCatalog;
+
+import org.junit.Test;
+
+import static org.apache.flink.table.descriptors.GenericInMemoryCatalogValidator.CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * IT Case for catalog ddl.
+ */
+public class CatalogITCase {
+
+	@Test
+	public void testCreateCatalog() {
+		String name = "c1";
+		TableEnvironment tableEnv = getTableEnvironment();
+		String ddl = String.format("create catalog %s with('type'='%s')", name, CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY);
+
+		tableEnv.sqlUpdate(ddl);
+
+		assertTrue(tableEnv.getCatalog(name).isPresent());
 
 Review comment:
   The catalog was created when calling sqlupdate, very different wtih other DDL cmds. Does this have some side-effects ? Just a curious.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-591146890
 
 
   @danny0405 thanks for the review. merging

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 closed pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 closed pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116
 
 
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149381924 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149507422 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   Hash:0df712030e9001c6d478269f2b9f7db1e51681c6 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/149869861 TriggerType:PUSH TriggerID:0df712030e9001c6d478269f2b9f7db1e51681c6
   Hash:0df712030e9001c6d478269f2b9f7db1e51681c6 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5388 TriggerType:PUSH TriggerID:0df712030e9001c6d478269f2b9f7db1e51681c6
   -->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149381924) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262) 
   * 53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149507422) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292) 
   * 0df712030e9001c6d478269f2b9f7db1e51681c6 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/149869861) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5388) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r380862484
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/operations/SqlToOperationConverter.java
 ##########
 @@ -358,6 +364,22 @@ private Operation convertUseCatalog(SqlUseCatalog useCatalog) {
 		return new UseCatalogOperation(useCatalog.getCatalogName());
 	}
 
+	/** Convert CREATE CATALOG statement. */
+	private Operation convertCreateCatalog(SqlCreateCatalog sqlCreateCatalog) {
+		String catalogName = sqlCreateCatalog.catalogName();
+
+		// set with properties
+		Map<String, String> properties = new HashMap<>();
+		sqlCreateCatalog.getPropertyList().getList().forEach(p ->
+			properties.put(((SqlTableOption) p).getKeyString(), ((SqlTableOption) p).getValueString()));
 
 Review comment:
   it should be fine, same as how other methods are done

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r383384203
 
 

 ##########
 File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
 ##########
 @@ -663,6 +665,15 @@ public void sqlUpdate(String stmt) {
 			DropTempSystemFunctionOperation dropTempSystemFunctionOperation =
 				(DropTempSystemFunctionOperation) operation;
 			dropSystemFunction(dropTempSystemFunctionOperation);
+		} else if (operation instanceof CreateCatalogOperation) {
+			CreateCatalogOperation createCatalogOperation = (CreateCatalogOperation) operation;
+			String exMsg = getDDLOpExecuteErrorMsg(createCatalogOperation.asSummaryString());
+			try {
+				catalogManager.registerCatalog(
+					createCatalogOperation.getCatalogName(), createCatalogOperation.getCatalog());
+			} catch (CatalogException e) {
+				throw new ValidationException(exMsg, e);
+			}
 
 Review comment:
   we only throw TableException(system error) and ValidationException(user error) in table env

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7d09ea38e74e801907d3f1da660c41f5cf739a29",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262",
       "triggerID" : "7d09ea38e74e801907d3f1da660c41f5cf739a29",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7d09ea38e74e801907d3f1da660c41f5cf739a29",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149381924",
       "triggerID" : "7d09ea38e74e801907d3f1da660c41f5cf739a29",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53361a9c2aeaefc852862ca8ed9ed5082fe31fe2",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149507422",
       "triggerID" : "53361a9c2aeaefc852862ca8ed9ed5082fe31fe2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53361a9c2aeaefc852862ca8ed9ed5082fe31fe2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292",
       "triggerID" : "53361a9c2aeaefc852862ca8ed9ed5082fe31fe2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0df712030e9001c6d478269f2b9f7db1e51681c6",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149869861",
       "triggerID" : "0df712030e9001c6d478269f2b9f7db1e51681c6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0df712030e9001c6d478269f2b9f7db1e51681c6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5388",
       "triggerID" : "0df712030e9001c6d478269f2b9f7db1e51681c6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0df712030e9001c6d478269f2b9f7db1e51681c6 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/149869861) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5388) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r381047849
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/operations/SqlToOperationConverter.java
 ##########
 @@ -358,6 +364,22 @@ private Operation convertUseCatalog(SqlUseCatalog useCatalog) {
 		return new UseCatalogOperation(useCatalog.getCatalogName());
 	}
 
+	/** Convert CREATE CATALOG statement. */
+	private Operation convertCreateCatalog(SqlCreateCatalog sqlCreateCatalog) {
+		String catalogName = sqlCreateCatalog.catalogName();
+
+		// set with properties
+		Map<String, String> properties = new HashMap<>();
+		sqlCreateCatalog.getPropertyList().getList().forEach(p ->
+			properties.put(((SqlTableOption) p).getKeyString(), ((SqlTableOption) p).getValueString()));
 
 Review comment:
   Why not use the `.map` directly.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r381048669
 
 

 ##########
 File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/catalog/CatalogITCase.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.catalog;
+
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.api.EnvironmentSettings;
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.api.java.StreamTableEnvironment;
+import org.apache.flink.test.util.AbstractTestBase;
+
+import org.junit.Test;
+
+import static org.apache.flink.table.descriptors.GenericInMemoryCatalogValidator.CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * IT Case for catalog ddl.
+ */
+public class CatalogITCase extends AbstractTestBase {
+
 
 Review comment:
   Can we reuse the `BatchTestBase` and `StreamingTestBase` ? 

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587639693
 
 
   @danny0405  @JingsongLi @lirui-apache can you take a 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


With regards,
Apache Git Services

[GitHub] [flink] libenchao commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
libenchao commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r380455859
 
 

 ##########
 File path: flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
 ##########
 @@ -56,6 +56,31 @@ SqlUseCatalog SqlUseCatalog() :
 }
 
 /**
+* Parses a create catalog statement.
+* CREATE CATALOG catalog_name [WITH (property_name=property_value, ...)];
+*/
+SqlCreate SqlCreateCatalog(Span s, boolean replace) :
+{
+    SqlParserPos startPos;
+    SqlIdentifier catalogName;
+    SqlNodeList propertyList = SqlNodeList.EMPTY;
+}
+{
+    <CATALOG> { startPos = getPos(); }
+    catalogName = CompoundIdentifier()
+    [
+        <WITH>
+        propertyList = TableProperties()
+    ]
+    {
+        return new SqlCreateCatalog(startPos.plus(getPos()),
+            catalogName,
+            propertyList);
+    }
+}
+
+
+                                            /**
 
 Review comment:
   seems an unintentional indent.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-589239893
 
 
   @danny0405 @lirui-apache please take another look. 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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149381924 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149507422 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   Hash:0df712030e9001c6d478269f2b9f7db1e51681c6 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:0df712030e9001c6d478269f2b9f7db1e51681c6
   -->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149381924) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262) 
   * 53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149507422) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292) 
   * 0df712030e9001c6d478269f2b9f7db1e51681c6 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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r382171023
 
 

 ##########
 File path: flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
 ##########
 @@ -55,6 +55,30 @@ SqlUseCatalog SqlUseCatalog() :
     }
 }
 
+/**
+* Parses a create catalog statement.
+* CREATE CATALOG catalog_name [WITH (property_name=property_value, ...)];
+*/
+SqlCreate SqlCreateCatalog(Span s, boolean replace) :
+{
+    SqlParserPos startPos;
+    SqlIdentifier catalogName;
+    SqlNodeList propertyList = SqlNodeList.EMPTY;
+}
+{
+    <CATALOG> { startPos = getPos(); }
+    catalogName = CompoundIdentifier()
 
 Review comment:
   should be simple identifier. Fixed

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r381047293
 
 

 ##########
 File path: flink-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/FlinkSqlParserImplTest.java
 ##########
 @@ -95,6 +95,21 @@ public void testUseCatalog() {
 		check("use catalog a", "USE CATALOG `A`");
 	}
 
+	@Test
+	public void testCreateCatalog() {
+		check(
+			"create catalog c1\n" +
+				" WITH (\n" +
 
 Review comment:
   We can test with compound identifier directly, e.g. 'a.b.c1', because that is actually what the syntax supports.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r383383189
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/catalog/CatalogITCase.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.catalog;
+
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.api.EnvironmentSettings;
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.api.java.StreamTableEnvironment;
+import org.apache.flink.table.catalog.GenericInMemoryCatalog;
+
+import org.junit.Test;
+
+import static org.apache.flink.table.descriptors.GenericInMemoryCatalogValidator.CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * IT Case for catalog ddl.
+ */
+public class CatalogITCase {
+
+	@Test
+	public void testCreateCatalog() {
+		String name = "c1";
+		TableEnvironment tableEnv = getTableEnvironment();
+		String ddl = String.format("create catalog %s with('type'='%s')", name, CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY);
+
+		tableEnv.sqlUpdate(ddl);
+
+		assertTrue(tableEnv.getCatalog(name).isPresent());
 
 Review comment:
   yes

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   -->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149381924 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   -->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149381924) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149381924 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/149507422 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   -->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149381924) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262) 
   * 53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/149507422) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r381550817
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/operations/SqlToOperationConverter.java
 ##########
 @@ -358,6 +364,22 @@ private Operation convertUseCatalog(SqlUseCatalog useCatalog) {
 		return new UseCatalogOperation(useCatalog.getCatalogName());
 	}
 
+	/** Convert CREATE CATALOG statement. */
+	private Operation convertCreateCatalog(SqlCreateCatalog sqlCreateCatalog) {
+		String catalogName = sqlCreateCatalog.catalogName();
+
+		// set with properties
+		Map<String, String> properties = new HashMap<>();
+		sqlCreateCatalog.getPropertyList().getList().forEach(p ->
+			properties.put(((SqlTableOption) p).getKeyString(), ((SqlTableOption) p).getValueString()));
 
 Review comment:
   i'd leave it as is. if anyone is interested, they can refactor all the methods in SqlToOperationConverter all together

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7d09ea38e74e801907d3f1da660c41f5cf739a29",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262",
       "triggerID" : "7d09ea38e74e801907d3f1da660c41f5cf739a29",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7d09ea38e74e801907d3f1da660c41f5cf739a29",
       "status" : "FAILURE",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149381924",
       "triggerID" : "7d09ea38e74e801907d3f1da660c41f5cf739a29",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53361a9c2aeaefc852862ca8ed9ed5082fe31fe2",
       "status" : "FAILURE",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149507422",
       "triggerID" : "53361a9c2aeaefc852862ca8ed9ed5082fe31fe2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53361a9c2aeaefc852862ca8ed9ed5082fe31fe2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292",
       "triggerID" : "53361a9c2aeaefc852862ca8ed9ed5082fe31fe2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0df712030e9001c6d478269f2b9f7db1e51681c6",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149869861",
       "triggerID" : "0df712030e9001c6d478269f2b9f7db1e51681c6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0df712030e9001c6d478269f2b9f7db1e51681c6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5388",
       "triggerID" : "0df712030e9001c6d478269f2b9f7db1e51681c6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149381924) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262) 
   * 53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149507422) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292) 
   * 0df712030e9001c6d478269f2b9f7db1e51681c6 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/149869861) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5388) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149381924 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   -->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149381924) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262) 
   * 53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r382705010
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/catalog/CatalogITCase.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.catalog;
+
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.api.EnvironmentSettings;
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.api.java.StreamTableEnvironment;
+import org.apache.flink.table.catalog.GenericInMemoryCatalog;
+
+import org.junit.Test;
+
+import static org.apache.flink.table.descriptors.GenericInMemoryCatalogValidator.CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * IT Case for catalog ddl.
+ */
+public class CatalogITCase {
+
+	@Test
+	public void testCreateCatalog() {
+		String name = "c1";
+		TableEnvironment tableEnv = getTableEnvironment();
+		String ddl = String.format("create catalog %s with('type'='%s')", name, CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY);
+
+		tableEnv.sqlUpdate(ddl);
+
+		assertTrue(tableEnv.getCatalog(name).isPresent());
 
 Review comment:
   aren't table and function also created upon calling sqlupdate?
   
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] lirui-apache commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r381654413
 
 

 ##########
 File path: flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
 ##########
 @@ -55,6 +55,30 @@ SqlUseCatalog SqlUseCatalog() :
     }
 }
 
+/**
+* Parses a create catalog statement.
+* CREATE CATALOG catalog_name [WITH (property_name=property_value, ...)];
+*/
+SqlCreate SqlCreateCatalog(Span s, boolean replace) :
+{
+    SqlParserPos startPos;
+    SqlIdentifier catalogName;
+    SqlNodeList propertyList = SqlNodeList.EMPTY;
+}
+{
+    <CATALOG> { startPos = getPos(); }
+    catalogName = CompoundIdentifier()
 
 Review comment:
   Why do we support CompoundIdentifier for catalog names?

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] danny0405 commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-588005825
 
 
   Thanks @bowenli86 for the PR, overall looks good, i have left some minor comments.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149381924 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149507422 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   Hash:0df712030e9001c6d478269f2b9f7db1e51681c6 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/149869861 TriggerType:PUSH TriggerID:0df712030e9001c6d478269f2b9f7db1e51681c6
   Hash:0df712030e9001c6d478269f2b9f7db1e51681c6 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5388 TriggerType:PUSH TriggerID:0df712030e9001c6d478269f2b9f7db1e51681c6
   -->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149381924) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262) 
   * 53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149507422) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292) 
   * 0df712030e9001c6d478269f2b9f7db1e51681c6 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/149869861) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5388) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r381549968
 
 

 ##########
 File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/catalog/CatalogITCase.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.catalog;
+
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.api.EnvironmentSettings;
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.api.java.StreamTableEnvironment;
+import org.apache.flink.test.util.AbstractTestBase;
+
+import org.junit.Test;
+
+import static org.apache.flink.table.descriptors.GenericInMemoryCatalogValidator.CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * IT Case for catalog ddl.
+ */
+public class CatalogITCase extends AbstractTestBase {
+
 
 Review comment:
   it actually doesn't need to extend any test base. Removed it.
   
   also it should be in blink planner, so relocated the module

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r381046554
 
 

 ##########
 File path: flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/cli/SqlCommandParserTest.java
 ##########
 @@ -83,6 +83,7 @@ public void testCommands() {
 		testValidSqlCommand("reset;", new SqlCommandCall(SqlCommand.RESET));
 		testValidSqlCommand("source /my/file", new SqlCommandCall(SqlCommand.SOURCE, new String[] {"/my/file"}));
 		testInvalidSqlCommand("source"); // missing path
+		testValidSqlCommand("create CATALOG c1", new SqlCommandCall(SqlCommand.CREATE_CATALOG, new String[]{"create catalog c1"}));
 		testValidSqlCommand("USE CATALOG default", new SqlCommandCall(SqlCommand.USE_CATALOG, new String[]{"default"}));
 
 Review comment:
   Can also add a test with explicit 'WITH' options.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r381670264
 
 

 ##########
 File path: flink-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/FlinkSqlParserImplTest.java
 ##########
 @@ -95,6 +95,21 @@ public void testUseCatalog() {
 		check("use catalog a", "USE CATALOG `A`");
 	}
 
+	@Test
+	public void testCreateCatalog() {
+		check(
+			"create catalog c1\n" +
+				" WITH (\n" +
 
 Review comment:
   But your syntax allows that.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r381547673
 
 

 ##########
 File path: flink-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/FlinkSqlParserImplTest.java
 ##########
 @@ -95,6 +95,21 @@ public void testUseCatalog() {
 		check("use catalog a", "USE CATALOG `A`");
 	}
 
+	@Test
+	public void testCreateCatalog() {
+		check(
+			"create catalog c1\n" +
+				" WITH (\n" +
 
 Review comment:
   it is catalog, not table, so it doesn't have name space

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149381924 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149507422 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   -->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149381924) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262) 
   * 53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149507422) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
bowenli86 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r382718135
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/catalog/CatalogITCase.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.catalog;
+
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.api.EnvironmentSettings;
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.api.java.StreamTableEnvironment;
+import org.apache.flink.table.catalog.GenericInMemoryCatalog;
+
+import org.junit.Test;
+
+import static org.apache.flink.table.descriptors.GenericInMemoryCatalogValidator.CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * IT Case for catalog ddl.
+ */
+public class CatalogITCase {
+
+	@Test
+	public void testCreateCatalog() {
+		String name = "c1";
+		TableEnvironment tableEnv = getTableEnvironment();
+		String ddl = String.format("create catalog %s with('type'='%s')", name, CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY);
+
+		tableEnv.sqlUpdate(ddl);
+
+		assertTrue(tableEnv.getCatalog(name).isPresent());
 
 Review comment:
   see FunctionITCase

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r383064486
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/catalog/CatalogITCase.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.catalog;
+
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.api.EnvironmentSettings;
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.api.java.StreamTableEnvironment;
+import org.apache.flink.table.catalog.GenericInMemoryCatalog;
+
+import org.junit.Test;
+
+import static org.apache.flink.table.descriptors.GenericInMemoryCatalogValidator.CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * IT Case for catalog ddl.
+ */
+public class CatalogITCase {
+
+	@Test
+	public void testCreateCatalog() {
+		String name = "c1";
+		TableEnvironment tableEnv = getTableEnvironment();
+		String ddl = String.format("create catalog %s with('type'='%s')", name, CATALOG_TYPE_VALUE_GENERIC_IN_MEMORY);
+
+		tableEnv.sqlUpdate(ddl);
+
+		assertTrue(tableEnv.getCatalog(name).isPresent());
 
 Review comment:
   I know that, just curious if they should have the same life cycle.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#issuecomment-587279527
 
 
   <!--
   Meta data
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:7d09ea38e74e801907d3f1da660c41f5cf739a29 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149381924 TriggerType:PUSH TriggerID:7d09ea38e74e801907d3f1da660c41f5cf739a29
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/149507422 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   Hash:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292 TriggerType:PUSH TriggerID:53361a9c2aeaefc852862ca8ed9ed5082fe31fe2
   Hash:0df712030e9001c6d478269f2b9f7db1e51681c6 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/149869861 TriggerType:PUSH TriggerID:0df712030e9001c6d478269f2b9f7db1e51681c6
   -->
   ## CI report:
   
   * 7d09ea38e74e801907d3f1da660c41f5cf739a29 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149381924) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5262) 
   * 53361a9c2aeaefc852862ca8ed9ed5082fe31fe2 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/149507422) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5292) 
   * 0df712030e9001c6d478269f2b9f7db1e51681c6 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/149869861) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11116: [FLINK-15349] add 'create catalog' DDL to blink planner
URL: https://github.com/apache/flink/pull/11116#discussion_r383064990
 
 

 ##########
 File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
 ##########
 @@ -663,6 +665,15 @@ public void sqlUpdate(String stmt) {
 			DropTempSystemFunctionOperation dropTempSystemFunctionOperation =
 				(DropTempSystemFunctionOperation) operation;
 			dropSystemFunction(dropTempSystemFunctionOperation);
+		} else if (operation instanceof CreateCatalogOperation) {
+			CreateCatalogOperation createCatalogOperation = (CreateCatalogOperation) operation;
+			String exMsg = getDDLOpExecuteErrorMsg(createCatalogOperation.asSummaryString());
+			try {
+				catalogManager.registerCatalog(
+					createCatalogOperation.getCatalogName(), createCatalogOperation.getCatalog());
+			} catch (CatalogException e) {
+				throw new ValidationException(exMsg, e);
+			}
 
 Review comment:
   Why not throw `CatalogException ` directly, does all the failures come from a validation ?

----------------------------------------------------------------
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


With regards,
Apache Git Services