SQL#
The sql() function runs a SQL SELECT query against DataFrames
in scope and returns a new DataFrame. DataFrames can be bound to
SQL names explicitly via keyword arguments, or auto-detected from the caller’s local and
global scope.
Example:
>>> import pyflink.dataframe as pf
>>> df1 = pf.from_dict({"a": [1, 2, 3], "b": ["x", "y", "z"]})
>>> df2 = pf.from_dict({"a": [1, 2, 3], "c": ["p", "q", "r"]})
>>> pf.sql("SELECT * FROM df1 JOIN df2 ON df1.a = df2.a").show()
|
Run a SQL SELECT query against DataFrames in scope, returning a DataFrame. |