petern48 commented on code in PR #18423:
URL: https://github.com/apache/datafusion/pull/18423#discussion_r2495000885
##########
datafusion/core/src/execution/session_state.rs:
##########
@@ -2095,6 +2105,36 @@ mod tests {
assert!(sql_to_expr(&state).is_err())
}
+ #[test]
+ #[cfg(feature = "sql")]
+ fn test_create_logical_expr_from_sql_expr() {
+ let state = SessionStateBuilder::new().with_default_features().build();
+
+ let provider = SessionContextProvider {
+ state: &state,
+ tables: HashMap::new(),
+ };
+
+ let schema = Schema::new(vec![Field::new("a", DataType::Int32, true)]);
+ let df_schema = DFSchema::try_from(schema).unwrap();
+ let dialect = state.config.options().sql_parser.dialect;
+ let query = SqlToRel::new_with_options(&provider,
state.get_parser_options());
+
+ for sql in ["[1,2,3]", "a > 10", "SUM(a)"] {
+ let sql_expr = state.sql_to_expr(sql, &dialect).unwrap();
Review Comment:
Yeah, it can be a bit ambiguous. Either way, `sql_to_expr` is an existing
public API before this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]