开发者社区> 问答> 正文

按照官网进行flink-shell操作,出现Only BatchTableSource and In

具体操作及错误信息我贴到下面,各位大佬帮忙看下如何解决,不知道是不是BUG。

scala> import org.apache.flink.table.catalog.hive.HiveCatalog import org.apache.flink.table.catalog.hive.HiveCatalog

scala> val hiveCatalog = new HiveCatalog("hive", "mydatabase", "/opt/hive2.3.3/conf", "2.3.3"); hiveCatalog: org.apache.flink.table.catalog.hive.HiveCatalog = org.apache.flink.table.catalog.hive.HiveCatalog@193f3306

scala> btenv.registerCatalog("hive", hiveCatalog) Thu May 21 15:10:05 CST 2020 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Thu May 21 15:10:05 CST 2020 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

scala> btenv.useCatalog("hive")

scala> btenv.listTables res2: Array[String] = Array(mytable)

scala> btenv.sqlQuery("select * from mytable").toDataSet[Row].print() org.apache.flink.table.api.TableException: Only BatchTableSource and InputFormatTableSource are supported in BatchTableEnvironment. at org.apache.flink.table.plan.nodes.dataset.BatchTableSourceScan.translateToPlan(BatchTableSourceScan.scala:118) at org.apache.flink.table.api.internal.BatchTableEnvImpl.translate(BatchTableEnvImpl.scala:306) at org.apache.flink.table.api.internal.BatchTableEnvImpl.translate(BatchTableEnvImpl.scala:281) at org.apache.flink.table.api.scala.internal.BatchTableEnvironmentImpl.toDataSet(BatchTableEnvironmentImpl.scala:69) at org.apache.flink.table.api.scala.TableConversions.toDataSet(TableConversions.scala:53) ... 30 elided

来自志愿者整理的flink邮件归档来自志愿者整理的FLINK邮件归档

展开
收起
小阿怪 2021-12-04 20:45:49 575 0
1 条回答
写回答
取消 提交回答
  • 不好意思,现在版本hive connector已经不支持old planner了, 但是scala shell还是默认old planner。

    来自志愿者整理的flink邮件归档来自志愿者整理的FLINK邮件归档

    2021-12-04 22:36:35
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Flink CDC Meetup PPT - 龚中强 立即下载
Flink CDC Meetup PPT - 王赫 立即下载
Flink CDC Meetup PPT - 覃立辉 立即下载