cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Warehousing & Analytics
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Does Koalas support Structured Streaming

User16826994223
Honored Contributor III

Does Koalas support Structured Streaming

1 ACCEPTED SOLUTION

Accepted Solutions

User16826994223
Honored Contributor III

No, Koalas does not support Structured Streaming officially.

As a workaround, you can use Koalas APIs with foreachBatch in Structured Streaming which allows batch APIs:

>>> def func(batch_df, batch_id):
 
...     koalas_df = ks.DataFrame(batch_df)
 
...     koalas_df['a'] = 1
 
...     print(koalas_df)
 
โ€‹
 
>>> spark.readStream.format("rate").load().writeStream.foreachBatch(func).start()
 
                timestamp  value  a
 
0 2020-02-21 09:49:37.574      4  1
 
                timestamp  value  a
 
0 2020-02-21 09:49:38.574      5  

View solution in original post

1 REPLY 1

User16826994223
Honored Contributor III

No, Koalas does not support Structured Streaming officially.

As a workaround, you can use Koalas APIs with foreachBatch in Structured Streaming which allows batch APIs:

>>> def func(batch_df, batch_id):
 
...     koalas_df = ks.DataFrame(batch_df)
 
...     koalas_df['a'] = 1
 
...     print(koalas_df)
 
โ€‹
 
>>> spark.readStream.format("rate").load().writeStream.foreachBatch(func).start()
 
                timestamp  value  a
 
0 2020-02-21 09:49:37.574      4  1
 
                timestamp  value  a
 
0 2020-02-21 09:49:38.574      5  

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.