twalthr commented on a change in pull request #9212: [FLINK-13338][table-api]
Sql conformance is hard to config in TableConfig
URL: https://github.com/apache/flink/pull/9212#discussion_r307154327
##########
File path:
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/PlanningConfigurationBuilder.java
##########
@@ -155,11 +156,23 @@ public Context getContext() {
SqlParser
.configBuilder()
.setParserFactory(FlinkSqlParserImpl.FACTORY)
- .setConformance(FlinkSqlConformance.DEFAULT)
+ .setConformance(getSqlConformance())
.setLex(Lex.JAVA)
.build());
}
+ private FlinkSqlConformance getSqlConformance() {
+ SqlDialect sqlDialect = tableConfig.getSqlDialect();
+ switch (sqlDialect) {
+ case HIVE:
+ return FlinkSqlConformance.HIVE;
+ case DEFAULT:
+ return FlinkSqlConformance.DEFAULT;
+ default:
Review comment:
Do not add a default. Because otherwise people might forget to update this
switch once a new dialect is added.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services