Dear Flink Community,
I'm missing Spark's table.show() method in Flink. I'm using the following alternative at the moment: Table results = tableEnv.sqlQuery("SELECT * FROM my_table"); Is it the recommended way to print the content of a table?
Thanks, Matyas |
Hi Matyas, AFAIK, currently, this is the recommended way to print result of table. In FLIP-84 [1] , which is targeted to 1.11, we will introduce some new APIs to do the fluent printing like this. Table table2 = tEnv.sqlQuery("select yy ..."); TableResult result2 = table2.execute(); result2.print(); cc @Godfrey, please correct if I misunderstand the above API. Best, Jark On Tue, 5 May 2020 at 20:19, Őrhidi Mátyás <[hidden email]> wrote:
|
A more straightforward way after FLIP-84 would be: TableResult result = tEnv.executeSql("select xxx ..."); result.print(); And if you are using 1.10 now, you can use TableUtils#collectToList(table) to collect the result to a list, and then print rows by yourself. Best, Kurt On Tue, May 5, 2020 at 8:44 PM Jark Wu <[hidden email]> wrote:
|
Thanks guys for the prompt answers! On Tue, May 5, 2020 at 2:49 PM Kurt Young <[hidden email]> wrote:
|
There's also the Table API approach if you want to avoid typing a "full" SQL query: Table t = tEnv.from("myTable"); Cheers, Fabian Am Di., 5. Mai 2020 um 16:34 Uhr schrieb Őrhidi Mátyás <[hidden email]>:
|
Free forum by Nabble | Edit this page |