Skip to content

Commit 5734702

Browse files
committed
feat: add possibility to not simplify UDTF args
1 parent 0a925a0 commit 5734702

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

datafusion/common/src/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ config_namespace! {
257257
/// parallel file scanning. Setting this to `true` ensures that newlines in values are
258258
/// parsed successfully, which may reduce performance.
259259
pub newlines_in_values: bool, default = false
260+
261+
/// Specifies whether UDTF arguments expressions must be simplified.
262+
pub simplify_udtf_args: bool, default = true
260263
}
261264
}
262265

datafusion/core/src/execution/session_state.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,14 +1844,17 @@ impl ContextProvider for SessionContextProvider<'_> {
18441844
);
18451845
let simplifier = ExprSimplifier::new(simplify_context);
18461846
let schema = DFSchema::empty();
1847-
let args = args
1848-
.into_iter()
1849-
.map(|arg| {
1850-
simplifier
1851-
.coerce(arg, &schema)
1852-
.and_then(|e| simplifier.simplify(e))
1853-
})
1854-
.collect::<datafusion_common::Result<Vec<_>>>()?;
1847+
let args = if !self.state.config.options().catalog.simplify_udtf_args {
1848+
args
1849+
} else {
1850+
args.into_iter()
1851+
.map(|arg| {
1852+
simplifier
1853+
.coerce(arg, &schema)
1854+
.and_then(|e| simplifier.simplify(e))
1855+
})
1856+
.collect::<datafusion_common::Result<Vec<_>>>()?
1857+
};
18551858
let provider = tbl_func.create_table_provider_with_args(TableFunctionArgs {
18561859
args: &args,
18571860
session: self.state,

0 commit comments

Comments
 (0)