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/20 10:29:06 UTC

[GitHub] [flink] dawidwys opened a new pull request #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

dawidwys opened a new pull request #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156
 
 
   ## What is the purpose of the change
   
   It improves the experience of Table API users as they do not need to escape SQL keywords. Some of the sql keywords might be a commonly used names in Table API (e.g. "table" for Table names). It also lets us support parsing identifiers coming from Java's ExpressionParser (e.g. for a string array(...) it produces a lookup call with an "array" identifier which should be parsed).
   
   ## Verifying this change
   
   This change added tests :
   * org.apache.flink.sql.parser.TableApiIdentifierParsingTest
   
   
   ## 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


With regards,
Apache Git Services

[GitHub] [flink] dawidwys closed pull request #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
dawidwys closed pull request #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156
 
 
   

----------------------------------------------------------------
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 #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#issuecomment-588965591
 
 
   <!--
   Meta data
   Hash:3cae2fb28b6a66eaabe2e99eceead4b077f0264a Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360 TriggerType:PUSH TriggerID:3cae2fb28b6a66eaabe2e99eceead4b077f0264a
   Hash:3cae2fb28b6a66eaabe2e99eceead4b077f0264a Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/149795792 TriggerType:PUSH TriggerID:3cae2fb28b6a66eaabe2e99eceead4b077f0264a
   -->
   ## CI report:
   
   * 3cae2fb28b6a66eaabe2e99eceead4b077f0264a Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/149795792) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360) 
   
   <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 #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#issuecomment-588965591
 
 
   <!--
   Meta data
   Hash:3cae2fb28b6a66eaabe2e99eceead4b077f0264a Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360 TriggerType:PUSH TriggerID:3cae2fb28b6a66eaabe2e99eceead4b077f0264a
   Hash:3cae2fb28b6a66eaabe2e99eceead4b077f0264a Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/149795792 TriggerType:PUSH TriggerID:3cae2fb28b6a66eaabe2e99eceead4b077f0264a
   -->
   ## CI report:
   
   * 3cae2fb28b6a66eaabe2e99eceead4b077f0264a Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/149795792) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360) 
   
   <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 #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#issuecomment-588965591
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360",
       "triggerID" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149795792",
       "triggerID" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150264866",
       "triggerID" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5504",
       "triggerID" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4aaebf247df1c8b2267b001f4310e0d2f3332211 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/150264866) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5504) 
   
   <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 #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#issuecomment-588965591
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360",
       "triggerID" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149795792",
       "triggerID" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150264866",
       "triggerID" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5504",
       "triggerID" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4aaebf247df1c8b2267b001f4310e0d2f3332211 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/150264866) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5504) 
   
   <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 #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#issuecomment-588965591
 
 
   <!--
   Meta data
   Hash:3cae2fb28b6a66eaabe2e99eceead4b077f0264a Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360 TriggerType:PUSH TriggerID:3cae2fb28b6a66eaabe2e99eceead4b077f0264a
   Hash:3cae2fb28b6a66eaabe2e99eceead4b077f0264a Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/149795792 TriggerType:PUSH TriggerID:3cae2fb28b6a66eaabe2e99eceead4b077f0264a
   -->
   ## CI report:
   
   * 3cae2fb28b6a66eaabe2e99eceead4b077f0264a Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/149795792) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360) 
   
   <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 #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#issuecomment-588965591
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360",
       "triggerID" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149795792",
       "triggerID" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3cae2fb28b6a66eaabe2e99eceead4b077f0264a Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/149795792) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360) 
   
   <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 #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#issuecomment-588965591
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360",
       "triggerID" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149795792",
       "triggerID" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3cae2fb28b6a66eaabe2e99eceead4b077f0264a Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/149795792) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360) 
   * 4aaebf247df1c8b2267b001f4310e0d2f3332211 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] twalthr commented on a change in pull request #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#discussion_r383135126
 
 

 ##########
 File path: flink-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/TableApiIdentifierParsingTest.java
 ##########
 @@ -0,0 +1,101 @@
+/*
+ * 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.sql.parser;
+
+import org.apache.flink.sql.parser.impl.FlinkSqlParserImpl;
+import org.apache.flink.sql.parser.impl.ParseException;
+import org.apache.flink.sql.parser.validate.FlinkSqlConformance;
+
+import org.apache.calcite.config.Lex;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.util.SourceStringReader;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.List;
+
+import static java.util.Arrays.asList;
+import static java.util.Collections.singletonList;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Tests for parsing a Table API specific SqlIdentifier.
+ */
+@RunWith(Parameterized.class)
+public class TableApiIdentifierParsingTest {
+
+	@Parameterized.Parameters(name = "Parsing: {0}. Expected identifier: {1}")
+	public static Object[][] parameters() {
+		return new Object[][] {
+			new Object[] {
+				"array",
+				singletonList("array")
+			},
+
+			new Object[] {
+				"table",
+				singletonList("table")
+			},
+
+			new Object[] {
+				"cat.db.array",
+				asList("cat", "db", "array")
+			},
+
+			new Object[] {
+				"`cat.db`.table",
+				asList("cat.db", "table")
+			},
+
+			new Object[] {
+				"db.table",
 
 Review comment:
   can you also add test with unicode and `UESCAPE` like `SELECT U&'#263A' UESCAPE '#'`.

----------------------------------------------------------------
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] twalthr commented on a change in pull request #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#discussion_r383138082
 
 

 ##########
 File path: flink-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/TableApiIdentifierParsingTest.java
 ##########
 @@ -0,0 +1,101 @@
+/*
+ * 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.sql.parser;
+
+import org.apache.flink.sql.parser.impl.FlinkSqlParserImpl;
+import org.apache.flink.sql.parser.impl.ParseException;
+import org.apache.flink.sql.parser.validate.FlinkSqlConformance;
+
+import org.apache.calcite.config.Lex;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.util.SourceStringReader;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.List;
+
+import static java.util.Arrays.asList;
+import static java.util.Collections.singletonList;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Tests for parsing a Table API specific SqlIdentifier.
+ */
+@RunWith(Parameterized.class)
+public class TableApiIdentifierParsingTest {
+
+	@Parameterized.Parameters(name = "Parsing: {0}. Expected identifier: {1}")
+	public static Object[][] parameters() {
+		return new Object[][] {
+			new Object[] {
+				"array",
+				singletonList("array")
+			},
+
+			new Object[] {
+				"table",
+				singletonList("table")
+			},
+
+			new Object[] {
+				"cat.db.array",
+				asList("cat", "db", "array")
+			},
+
+			new Object[] {
+				"`cat.db`.table",
+				asList("cat.db", "table")
+			},
+
+			new Object[] {
+				"db.table",
 
 Review comment:
   Or should we remove this clause? In general, we should also test escapin, e.g. having backticks as part of the name

----------------------------------------------------------------
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 #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#issuecomment-588965591
 
 
   <!--
   Meta data
   Hash:3cae2fb28b6a66eaabe2e99eceead4b077f0264a Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:3cae2fb28b6a66eaabe2e99eceead4b077f0264a
   -->
   ## CI report:
   
   * 3cae2fb28b6a66eaabe2e99eceead4b077f0264a 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 commented on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#issuecomment-588923278
 
 
   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 3cae2fb28b6a66eaabe2e99eceead4b077f0264a (Thu Feb 20 10:31:37 UTC 2020)
   
   **Warnings:**
    * Documentation files were touched, but no `.zh.md` files: Update Chinese documentation or file Jira ticket.
   
   
   <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] flinkbot edited a comment on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#issuecomment-588965591
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360",
       "triggerID" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/149795792",
       "triggerID" : "3cae2fb28b6a66eaabe2e99eceead4b077f0264a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150264866",
       "triggerID" : "4aaebf247df1c8b2267b001f4310e0d2f3332211",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3cae2fb28b6a66eaabe2e99eceead4b077f0264a Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/149795792) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5360) 
   * 4aaebf247df1c8b2267b001f4310e0d2f3332211 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/150264866) 
   
   <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] twalthr commented on a change in pull request #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #11156: [FLINK-16183][table-api] Make identifier parsing in Table API more lenient
URL: https://github.com/apache/flink/pull/11156#discussion_r383133874
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/calcite/CalciteParser.java
 ##########
 @@ -60,12 +62,33 @@ public SqlNode parse(String sql) {
 	 */
 	public SqlIdentifier parseIdentifier(String identifier) {
 		try {
-			SqlParser parser = SqlParser.create(identifier, config);
-			SqlNode sqlNode = parser.parseExpression();
-			return (SqlIdentifier) sqlNode;
+			return createFlinkParser(identifier).TableApiIdentifier();
 		} catch (Exception e) {
 			throw new SqlParserException(String.format(
-				"Invalid SQL identifier %s. All SQL keywords must be escaped.", identifier));
+				"Invalid SQL identifier %s.", identifier));
 		}
 	}
+
+	private FlinkSqlParserImpl createFlinkParser(String expr) {
+		SourceStringReader reader = new SourceStringReader(expr);
 
 Review comment:
   can you document the changes between this method and `SqlParser.create()`?

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