仔细看了Table API部分的文档,有以下理论和实际编程问题,盼逐个解答:
1.跟BatchTableEnvironment 和StreamTableEnvironment 相比,TableEnvironment 应该用在什么场景? 2.文中提到Register an External Catalog,什么情况下会用到external Catalog? 但是在API文档里,registerExternalCatalog已经被定为Deprecated。那就只能使用 registerCatalog了。 内部Catalog和外部Catalog有什么区别?为什么需要不同的 Catalog?在什么情况下需要注册多个Catalog? 3.注册一个Table,注册一个TableSource,然后怎么用呢?怎么写代码?文档语焉不 详。注册的作用是什么? 4.API文档中TableEnvironment的方法scan的入参是tablePath,请问什么是 tablePath? 在文档 https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/streaming/time_attributes.html 中看到如下示例代码: 这么看起来,UserActions是TableSource的名字,scan就是把TableSource的名字作 为入参。但是当我自己按照这个方法来写的时候,却报错: 这是我的代码: 这是运行结果: 我明明把user_moid注册成TableSource,TableSource的名字作为scan的入参。