开发者社区 > 大数据与机器学习 > 实时计算 Flink > 正文

Flink的 CTAS 目标库为starrocks,为什么报错呢?

Flink的 CTAS 目标库为starrocks,为什么报错呢?语句时照抄 https://help.aliyun.com/zh/emr/emr-on-ecs/user-guide/use-the-ctas-and-cdas-statements-of-realtime-compute-for-apache-flink-to-synchronize-data-from-an-apsaradb-rds-for-mysql-instance-to-a-starrocks-cluster?spm=a2c4g.11186623.0.0.30127e8dDcfzkb 的这里 fae2dfa1ed856733550d2cfde82c0d1d.png
报错:org.apache.flink.table.api.ValidationException: SQL validation failed. CREATE TABLE ... AS TABLE ... statement requires target catalog 'vvp' (VvpCatalog) implements org.apache.flink.table.catalog.CatalogTableProvider interface.
Hint: Please refer the document and use another catalog that supports schema evolution as the target catalog.
at org.apache.flink.table.sqlserver.utils.FormatValidatorExceptionUtils.newValidationException(FormatValidatorExceptionUtils.java:41)
at org.apache.flink.table.sqlserver.utils.ErrorConverter.formatException(ErrorConverter.java:123)
at org.apache.flink.table.sqlserver.utils.ErrorConverter.toErrorDetail(ErrorConverter.java:60)
at org.apache.flink.table.sqlserver.utils.ErrorConverter.toGrpcException(ErrorConverter.java:54)
at org.apache.flink.table.sqlserver.FlinkSqlServiceImpl.findCatalogObjectRefs(FlinkSqlServiceImpl.java:1105)
at org.apache.flink.table.sqlserver.proto.FlinkSqlServiceGrpc$MethodHandlers.invoke(FlinkSqlServiceGrpc.java:3761)
at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
at org.apache.flink.table.sqlserver.interceptor.StatusInterceptor$1.onHalfClose(StatusInterceptor.java:116)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
at org.apache.flink.table.sqlserver.interceptor.CancelHandlerRegister$1.onHalfClose(CancelHandlerRegister.java:59)
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)
at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:820)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1147)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
at java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.flink.table.api.ValidationException: CREATE TABLE ... AS TABLE ... statement requires target catalog 'vvp' (VvpCatalog) implements org.apache.flink.table.catalog.CatalogTableProvider interface.
Hint: Please refer the document and use another catalog that supports schema evolution as the target catalog.
at org.apache.flink.table.planner.operations.SqlCreateTableAsConverter.createUnresolvedCatalogTable(SqlCreateTableAsConverter.java:179)
at org.apache.flink.table.planner.operations.SqlUnresolvedConverter.inferUnresolvedTable(SqlUnresolvedConverter.java:159)
at org.apache.flink.table.planner.catalog.CatalogProber.inferUnresolvedSinkTable(CatalogProber.java:269)
at org.apache.flink.table.planner.calcite.ReferencesFinder$ReferencesVisitor.visitCreateTableAs(ReferencesFinder.java:335)
at org.apache.flink.table.planner.calcite.ReferencesFinder$ReferencesVisitor.visit(ReferencesFinder.java:178)
at org.apache.flink.table.planner.calcite.ReferencesFinder$ReferencesVisitor.visit(ReferencesFinder.java:127)
at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:161)
at org.apache.calcite.sql.util.SqlBasicVisitor.visit(SqlBasicVisitor.java:54)
at org.apache.calcite.sql.SqlNodeList.accept(SqlNodeList.java:266)
at org.apache.flink.table.planner.calcite.ReferencesFinder.findReferences(ReferencesFinder.java:121)
at org.apache.flink.table.planner.delegation.ParserImpl.findCatalogObjectReferences(ParserImpl.java:151)
at org.apache.flink.table.sqlserver.execution.OperationExecutorImpl.findCatalogObjectRefs(OperationExecutorImpl.java:598)
at org.apache.flink.table.sqlserver.execution.DelegateOperationExecutor.lambda$findCatalogObjectRefs$13(DelegateOperationExecutor.java:183)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1729)
at org.apache.flink.table.sqlserver.context.SqlServerSecurityContext.runSecured(SqlServerSecurityContext.java:72)
at org.apache.flink.table.sqlserver.execution.DelegateOperationExecutor.wrapClassLoader(DelegateOperationExecutor.java:322)
at org.apache.flink.table.sqlserver.execution.DelegateOperationExecutor.lambda$wrapExecutor$36(DelegateOperationExecutor.java:349)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 more

展开
收起
三分钟热度的鱼 2024-04-10 14:48:37 93 0
2 条回答
写回答
取消 提交回答
  • fe集群的问题,ctas不支持调试,不要用use语句。自己修改一下吧。此回答整理自钉群“实时计算Flink产品交流群”

    2024-05-10 10:25:10
    赞同 展开评论 打赏
  • 深耕大数据和人工智能

    Flink的CTAS(Create Table As Select)目标库为StarRocks时报错,可能有以下原因:

    版本兼容性:请确保您使用的Flink版本与StarRocks的版本兼容。不兼容的版本可能导致无法正常通信或执行操作。
    配置错误:检查您的Flink作业配置是否正确,包括连接字符串、用户名、密码等,确保这些配置能够正确连接到StarRocks。
    权限问题:确保Flink作业拥有足够的权限在StarRocks上执行CTAS操作。如果没有相应的权限,操作可能会失败。
    语法错误:检查您的CTAS语句是否符合StarRocks的语法规范。例如,如果您使用了CDAS(Create Database As Select)语句,需要确保源表和目标表的结构匹配,并且可以使用including table语法来选择部分表进行操作。
    资源限制:可能是由于资源限制,如内存不足或网络带宽限制,导致数据处理过程中出现问题。
    数据格式问题:确保数据的格式与StarRocks中的表结构相匹配,不匹配的数据格式可能导致写入错误。
    网络问题:检查网络连接是否稳定,不稳定的网络可能导致数据传输中断或超时。
    系统错误:可能是StarRocks本身的问题,比如服务不可用、系统维护等。
    综上所述,为了解决这个问题,您可以从上述几个方面进行排查和调整。如果问题依然存在,建议查看Flink的日志文件以获取更详细的错误信息,或者联系StarRocks的技术支持寻求帮助。

    2024-04-10 15:22:00
    赞同 展开评论 打赏

实时计算Flink版是阿里云提供的全托管Serverless Flink云服务,基于 Apache Flink 构建的企业级、高性能实时大数据处理系统。提供全托管版 Flink 集群和引擎,提高作业开发运维效率。

相关产品

  • 实时计算 Flink版
  • 相关电子书

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