请教一下,我在用flink-sql-gateway的1.11.1版本的SET语法设置hive dialect时(SET table.sql-dialect=hive),flink-sql-gateway出现了报错,同样的语法在sql-client是支持的,那如果我想在session级切换hive dialect我应该怎么做呢? 多谢 我的环境如下:
flink-sql-gateway:1.11.1 flink:1.11.1 hive:3.1.2 hadoop:3.0.0 日志如下: 2020-08-31 20:39:56,051 INFO com.ververica.flink.table.gateway.rest.session.Session [] - Session: dc5b8e66111bd59a4c7abe0acc625275, runstatement: set table.sql-dialect=hive 2020-08-31 20:39:56,051 ERROR com.ververica.flink.table.gateway.rest.session.Session [] - Session: dc5b8e66111bd59a4c7abe0acc625275, Failed to parse statement: set table.sql-dialect=hive 2020-08-31 20:39:56,052 ERROR com.ververica.flink.table.gateway.rest.handler.StatementExecuteHandler [] - Exception occurred in REST handler. org.apache.flink.runtime.rest.handler.RestHandlerException: Failed to parse statement. at com.ververica.flink.table.gateway.rest.handler.StatementExecuteHandler.handleRequest(StatementExecuteHandler.java:91) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] at com.ververica.flink.table.gateway.rest.handler.AbstractRestHandler.respondToRequest(AbstractRestHandler.java:77) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] at com.ververica.flink.table.gateway.rest.handler.AbstractHandler.channelRead0(AbstractHandler.java:178) [flink-sql-gateway-0.2-SNAPSHOT.jar:?] at com.ververica.flink.table.gateway.rest.handler.AbstractHandler.channelRead0(AbstractHandler.java:75) [flink-sql-gateway-0.2-SNAPSHOT.jar:?] at org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.runtime.rest.handler.router.RouterHandler.routed(RouterHandler.java:110) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.runtime.rest.handler.router.RouterHandler.channelRead0(RouterHandler.java:89) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.runtime.rest.handler.router.RouterHandler.channelRead0(RouterHandler.java:54) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.runtime.rest.FileUploadHandler.channelRead0(FileUploadHandler.java:174) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.runtime.rest.FileUploadHandler.channelRead0(FileUploadHandler.java:68) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1421) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:697) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918) [flink-dist_2.11-1.11.1.jar:1.11.1] at org.apache.flink.shaded.netty4.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [flink-dist_2.11-1.11.1.jar:1.11.1] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251] Caused by: com.ververica.flink.table.gateway.utils.SqlGatewayException: Failed to parse statement. at com.ververica.flink.table.gateway.rest.session.Session.runStatement(Session.java:102) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] at com.ververica.flink.table.gateway.rest.handler.StatementExecuteHandler.handleRequest(StatementExecuteHandler.java:81) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] ... 43 more Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "table" at line 1, column 5. Was expecting one of: <BRACKET_QUOTED_IDENTIFIER> ... <QUOTED_IDENTIFIER> ... <BACK_QUOTED_IDENTIFIER> ... <IDENTIFIER> ... <UNICODE_QUOTED_IDENTIFIER> ... at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.convertException(FlinkSqlParserImpl.java:416) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.normalizeException(FlinkSqlParserImpl.java:201) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.calcite.sql.parser.SqlParser.handleException(SqlParser.java:148) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.calcite.sql.parser.SqlParser.parseStmtList(SqlParser.java:203) ~[flink-table_2.11-1.11.1.jar:1.11.1] at com.ververica.flink.table.gateway.operation.SqlCommandParser.parseStmt(SqlCommandParser.java:115) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] at com.ververica.flink.table.gateway.operation.SqlCommandParser.parse(SqlCommandParser.java:103) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] at com.ververica.flink.table.gateway.rest.session.Session.runStatement(Session.java:93) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] at com.ververica.flink.table.gateway.rest.handler.StatementExecuteHandler.handleRequest(StatementExecuteHandler.java:81) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] ... 43 more Caused by: org.apache.flink.sql.parser.impl.ParseException: Encountered "table" at line 1, column 5. Was expecting one of: <BRACKET_QUOTED_IDENTIFIER> ... <QUOTED_IDENTIFIER> ... <BACK_QUOTED_IDENTIFIER> ... <IDENTIFIER> ... <UNICODE_QUOTED_IDENTIFIER> ... at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.generateParseException(FlinkSqlParserImpl.java:36086) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.jj_consume_token(FlinkSqlParserImpl.java:35900) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.IdentifierSegment(FlinkSqlParserImpl.java:21331) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.CompoundIdentifier(FlinkSqlParserImpl.java:21410) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlSetOption(FlinkSqlParserImpl.java:18285) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlStmt(FlinkSqlParserImpl.java:3302) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlStmtList(FlinkSqlParserImpl.java:2775) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.parseSqlStmtList(FlinkSqlParserImpl.java:252) ~[flink-table_2.11-1.11.1.jar:1.11.1] at org.apache.calcite.sql.parser.SqlParser.parseStmtList(SqlParser.java:201) ~[flink-table_2.11-1.11.1.jar:1.11.1] at com.ververica.flink.table.gateway.operation.SqlCommandParser.parseStmt(SqlCommandParser.java:115) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] at com.ververica.flink.table.gateway.operation.SqlCommandParser.parse(SqlCommandParser.java:103) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] at com.ververica.flink.table.gateway.rest.session.Session.runStatement(Session.java:93) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] at com.ververica.flink.table.gateway.rest.handler.StatementExecuteHandler.handleRequest(StatementExecuteHandler.java:81) ~[flink-sql-gateway-0.2-SNAPSHOT.jar:?] ... 43 more shougou <80562...@qq.com> 于2020年8月31日周一 上午10:58写道: > 感谢各位的辛苦付出,今天就准备试一下。 > > > > -- > Sent from: http://apache-flink.147419.n8.nabble.com/ >