Created
November 16, 2023 09:05
-
-
Save ebongzzang/687e71a9fe988e9902096ff62024edc7 to your computer and use it in GitHub Desktop.
Flink tableenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val tableEnv: StreamTableEnvironment by lazy { | |
val tableEnvConfigMap = mapOf( | |
"lookup.cache" to "PARTIAL", | |
"lookup.partial-cache.max-rows" to "50000", | |
"lokup.partial-cache.expire-after-access" to "60min" | |
) | |
val tableEnvSetting = EnvironmentSettings.Builder() | |
.withConfiguration(Configuration.fromMap(tableEnvConfigMap)) | |
.build() | |
val tableEnv = StreamTableEnvironment.create(env, tableEnvSetting) | |
val catalog = JdbcCatalog( | |
"catalogName", | |
"dbname", | |
config.database.mysql.username, | |
config.database.mysql.password, | |
config.database.mysql.url, | |
) | |
tableEnv.registerCatalog("catalogName", catalog) | |
tableEnv.useCatalog("catalogName") | |
tableEnv | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment