用subscribetable函数时报错The publisher doesn't have the table

用subscribetable函数时报错The publisher doesn't have the table,确认已经建过表了,作为tableName的表名也确认没有错误,请问是什么原因导致报错?

请先 登录 后评论

1 个回答

Yating Xie
  • 报错解释:在subscribeTable时通过tableName参数指定订阅的数据表名,该表必须为共享的流数据表,否则报错

  • 解决方法:将需要订阅的流表创建为共享流数据表,检查一下您的tableName参数对应的表是否可能是普通流表


    可以用以下语句创建共享流表:

    使用share创建共享流表

    t1= streamTable(1 2 3 as id, 4 5 6 as value);
    share t1 as table1;  


    使用enableTableShareAndPersistence创建持久化共享流表

    colName=["time","x"]
    colType=["timestamp","int"]
    t = streamTable(100:0, colName, colType);
    enableTableShareAndPersistence(table=t, tableName=`table2, cacheSize=1200000)



请先 登录 后评论