i was trying to query a postgresql table, and convert it to dataStream:
StreamExecutionEnvironment bsEnv = StreamExecutionEnvironment.getExecutionEnvironment();
StreamTableEnvironment tEnv = StreamTableEnvironment.create(bsEnv);
.
.
.
.
catalog config and register
.
.
.
Table tb = tEnv.sqlQuery("SELECT * FROM mytable);
DataStream<Row> dataStream = tEnv.toDataStream(tb)
dataStream.print();
But it seems that the datastream is empty..
the query is fine , when i print the TableResult i can see my table.
TableResult tb1 = tEnv.sqlQuery("SELECT * FROM mytable).execute();
tb1.print();
is this the right way to do it?
i wondered because according to Table doc:
“A Table object describes a pipeline of data transformations. **It does not contain the data **itself in any way.”
so if its not containing the data, what the point by convert it to datastream?
or maybe the datastream supposed to hold the data?
thank you!
Dor kat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.