Skip to content
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

GetIndexedFieldExpr dyn_eq implementation causes stack overflow #7621

Closed
mustafasrepo opened this issue Sep 22, 2023 · 0 comments · Fixed by #7623
Closed

GetIndexedFieldExpr dyn_eq implementation causes stack overflow #7621

mustafasrepo opened this issue Sep 22, 2023 · 0 comments · Fixed by #7623
Labels
bug Something isn't working

Comments

@mustafasrepo
Copy link
Contributor

mustafasrepo commented Sep 22, 2023

Describe the bug

impl PartialEq<dyn Any> of GetFieldAccessExpr which is a field of GetIndexedFieldExpr has a recursive implementation without a base case. This causes stack overflow.

To Reproduce

Test below can be used to reproduce bug

#[test]
fn get_indexed_field_eq() -> Result<()>{
    let schema = list_schema(&["list", "error"]);
    let expr = col("list", &schema).unwrap();
    let key = col("error", &schema).unwrap();
    let indexed_field = Arc::new(GetIndexedFieldExpr::new_index(expr.clone(), key.clone())) as Arc<dyn PhysicalExpr>;
    let indexed_field_other = Arc::new(GetIndexedFieldExpr::new_index(key, expr)) as Arc<dyn PhysicalExpr>;
    assert!(indexed_field.eq(&indexed_field));
    assert!(!indexed_field.eq(&indexed_field_other));
    Ok(())
}

Expected behavior

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant