Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/datafusion_integration/prql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@ pub fn is_prql(input: &str) -> bool {

/// Compile PRQL source to SQL.
///
/// Uses the `prqlc` compiler with the generic SQL dialect, which should
/// be compatible with DataFusion.
/// Uses the `prqlc` compiler with the PostgreSQL dialect, which is most
/// compatible with DataFusion's SQL parser. Key differences from generic:
/// - Regex: `~=` compiles to `~` operator (not `REGEXP()` function)
/// - String functions and operators match DataFusion's PostgreSQL-style syntax
///
/// # Errors
///
Expand All @@ -202,7 +204,7 @@ pub fn compile_prql(prql: &str) -> Result<String> {
use prqlc::{Options, Target};

let opts = Options::default()
.with_target(Target::Sql(Some(prqlc::sql::Dialect::Generic)))
.with_target(Target::Sql(Some(prqlc::sql::Dialect::Postgres)))
.no_format();

prqlc::compile(prql, &opts).map_err(|e| {
Expand Down