Skip to content

Execute SQL query against the registered data

Source code

Description

Parse the given SQL query and execute it against the registered frame data.

Usage

<SQLContext>$execute(query)

Arguments

query A character of the SQL query to execute.

Value

A LazyFrame

Examples

library("polars")


query = "SELECT * FROM mtcars WHERE cyl = 4"

pl$SQLContext(mtcars = mtcars)$execute(query)
#> polars LazyFrame
#>  $explain(): Show the optimized query plan.
#> 
#> Naive plan:
#>  SELECT [col("mpg"), col("cyl"), col("disp"), col("hp"), col("drat"), col("wt"), col("qsec"), col("vs"), col("am"), col("gear"), col("carb")] FROM
#>   FILTER [(col("cyl")) == (4.0)] FROM
#>     DF ["mpg", "cyl", "disp", "hp"]; PROJECT */11 COLUMNS; SELECTION: None