[root@master flink]# cat t104.py
from pyflink.common.typeinfo import Types
from pyflink.datastream import StreamExecutionEnvironment
from pyflink.common.typeinfo import Types
from pyflink.datastream import StreamExecutionEnvironment
from pyflink.table import StreamTableEnvironment
from pyflink.datastream.connectors import NumberSequenceSource
from pyflink.common.typeinfo import Types
from pyflink.common.watermark_strategy import WatermarkStrategy
from pyflink.datastream import StreamExecutionEnvironment
env = StreamExecutionEnvironment.get_execution_environment()
t_env = StreamTableEnvironment.create(stream_execution_environment=env)
t_env.execute_sql("""
CREATE TABLE my_source (
a INT,
b VARCHAR
) WITH (
'connector' = 'datagen',
'number-of-rows' = '5'
)
""")
ds = t_env.to_append_stream(
t_env.from_path('my_source'),
Types.ROW([Types.INT(), Types.STRING()]))
ds.print()
env.execute()文章来源:https://www.toymoban.com/news/detail-457338.html
[root@master flink]# python3 t104.py
2> +I[556711628, d9bb2e9704cc0ce971023cf61ac223733231fc2e29cc04b20ea04362767f30dc09c0af65aed18b6ff4773abdb09b0f9902aa]
3> +I[-1452359858, 9a3f0c8bb5ce1cd713779b9808f24e63ae14584d039d529c3d60a329217dc2be00efad2b4e74cee83ab5f59d65c449353e13]
1> +I[-1129435987, d43fe8f59315423fb6a80f524b38c3fafc972ed1d552886653df3885d1d53234998b580d0bc55cd4d42c93df0a18e1c6dcdc]
1> +I[1669120308, 338c97031aef5fe1f2619b2981f5289b5a7f4c9afa4c75d94bd6eb94f96b4015ad2268f9920e1cf3e26fc70910c9d4e516b4]
4> +I[1863204637, 2c29ac358b119da5e299658f4b192dda9087287421021537033679353849e0d1acca239ad2ba3167d89d68f6a4e773838a82]
[root@master flink]# 文章来源地址https://www.toymoban.com/news/detail-457338.html
到了这里,关于ds.print() 输出到标准输出的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!