danny0405 commented on a change in pull request #11791:
URL: https://github.com/apache/flink/pull/11791#discussion_r414956231



##########
File path: 
flink-table/flink-sql-parser-hive/src/main/java/org/apache/flink/sql/parser/hive/package-info.java
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+/**
+ * Flink sql parser for hive dialect.
+ *
+ * <p>This module contains the DDLs and some custom DMLs for Apache Flink.
+ *
+ * <p>Most of the sql grammars belong to sql standard or Flink's dialect. To 
support
+ * a new sql dialect, add a new sql conformance to
+ * {@link org.apache.flink.sql.parser.validate.FlinkSqlConformance},
+ * then use this sql conformance to make context aware decisions in parse 
block. See the usage of
+ * {@link org.apache.flink.sql.parser.validate.FlinkSqlConformance#HIVE} in 
{@code parserimpls.ftl}.
+ *
+ * <p>To use a specific sql dialect for the parser, config the parser to the 
specific sql conformance
+ * with a code snippet like below:
+ * <blockquote><pre>
+ *   SqlParser.create(source,
+ *             SqlParser.configBuilder()
+ *                     .setParserFactory(parserImplFactory())
+ *                             .setQuoting(Quoting.DOUBLE_QUOTE)
+ *                             .setUnquotedCasing(Casing.TO_UPPER)
+ *                             .setQuotedCasing(Casing.UNCHANGED)
+ *                             .setConformance(conformance0) // the sql 
conformance you want use.
+ *                             .build());
+ * </pre></blockquote>

Review comment:
       The comment id not correct now, we actually do not switch parser dialect 
with the `setConformance` interface.

##########
File path: 
flink-table/flink-sql-parser-hive/src/main/java/org/apache/flink/sql/parser/hive/package-info.java
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+/**
+ * Flink sql parser for hive dialect.
+ *
+ * <p>This module contains the DDLs and some custom DMLs for Apache Flink.
+ *
+ * <p>Most of the sql grammars belong to sql standard or Flink's dialect. To 
support
+ * a new sql dialect, add a new sql conformance to
+ * {@link org.apache.flink.sql.parser.validate.FlinkSqlConformance},
+ * then use this sql conformance to make context aware decisions in parse 
block. See the usage of
+ * {@link org.apache.flink.sql.parser.validate.FlinkSqlConformance#HIVE} in 
{@code parserimpls.ftl}.
+ *
+ * <p>To use a specific sql dialect for the parser, config the parser to the 
specific sql conformance
+ * with a code snippet like below:
+ * <blockquote><pre>
+ *   SqlParser.create(source,
+ *             SqlParser.configBuilder()
+ *                     .setParserFactory(parserImplFactory())
+ *                             .setQuoting(Quoting.DOUBLE_QUOTE)
+ *                             .setUnquotedCasing(Casing.TO_UPPER)
+ *                             .setQuotedCasing(Casing.UNCHANGED)
+ *                             .setConformance(conformance0) // the sql 
conformance you want use.
+ *                             .build());
+ * </pre></blockquote>

Review comment:
       The comment is not correct now, we actually do not switch parser dialect 
with the `setConformance` interface.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to