Skip to content

Instantly share code, notes, and snippets.

@soin08
Created April 12, 2023 12:05
Show Gist options
  • Save soin08/5e0038dbefeba9192706e05a78ef3bc1 to your computer and use it in GitHub Desktop.
Save soin08/5e0038dbefeba9192706e05a78ef3bc1 to your computer and use it in GitHub Desktop.
package com.soin.demo.flink.sqlrunner;
import org.apache.flink.table.api.EnvironmentSettings;
import org.apache.flink.table.api.TableEnvironment;
public class TestRunner {
public static void main(String[] args) {
EnvironmentSettings settings = EnvironmentSettings
.newInstance()
.inStreamingMode()
.build();
TableEnvironment tEnv = TableEnvironment.create(settings);
var sql2 = "select CAST(commissions AS ARRAY<ROW<amount DOUBLE>>) as commissions " +
" from (select ARRAY[ROW(123), ROW(234)] commissions);";
tEnv.sqlQuery(sql2).execute().print();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment