-
Notifications
You must be signed in to change notification settings - Fork 121
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
Support expressions in on
option for complex Joins
#969
Comments
The best option is most likely to massage the data frame you are joining before hand, by creating the collapsed column, and then joining in that. @cigrainger is this something you want to support? |
In many cases it is best to massage the dataframe, but this is a legit usecase and there's a lot to be said for expressions in the on arg. |
AFAIK, this is also not supported on
So in this case I think we can utilize and enhance the
pub fn lf_sql(
lf: ExLazyFrame,
sql_string: &str,
table_name: &str,
) -> Result<ExLazyFrame, ExplorerError> {
|
Description:
I would like to propose a new feature in Elixir Explorer that allows the
on
option in thejoin
function to support more complex expressions. Currently, Explorer provides functionality for join operations with a limited ability to specify joins using simple equalitychecks (e.g.,
on: [{"column1", "column2"}]
). To enhance the flexibility of joining tables based on complex conditions that cannot be easily expressed with only column names, it would be beneficial to extend the joinon
clause to accept Explorer expressions.Example Use Case:
Consider the following SQL query, where a complex condition is used in the
ON
clause to perform a left join:Currently, to achieve this behavior in Explorer, one has to perform two joins, as shown below:
Proposed Enhancement:
I propose that the
on
option be enhanced to allow expressions, making it possible to perform complex joins more succinctly. Ideally, the code would look something like this:The text was updated successfully, but these errors were encountered: