-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Implement user defined planner for position #11243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
bac49cf
515bce6
f6d3ae3
92ac4cb
ceb790f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| //! SQL planning extensions like [`PositionPlanner`] | ||
|
|
||
| use datafusion_common::Result; | ||
| use datafusion_expr::{ | ||
| expr::ScalarFunction, | ||
| planner::{PlannerResult, UserDefinedSQLPlanner}, | ||
| Expr, | ||
| }; | ||
|
|
||
| #[derive(Default)] | ||
| pub struct PositionPlanner {} | ||
|
|
||
| impl UserDefinedSQLPlanner for PositionPlanner { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jayzhan211 do you suggest we have one planner for each module (like a I think this is similar to what you are proposing with We could make this change in a follow on PR too
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. And with different
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Filed #11305 to track. Thank you |
||
| fn plan_position(&self, args: Vec<Expr>) -> Result<PlannerResult<Vec<Expr>>> { | ||
| Ok(PlannerResult::Planned(Expr::ScalarFunction( | ||
| ScalarFunction::new_udf(crate::unicode::strpos(), args), | ||
| ))) | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.