Skip to content

Conversation

@xinlifoobar
Copy link
Contributor

@xinlifoobar xinlifoobar commented Jul 2, 2024

Which issue does this PR close?

Part of #11207 and closes #11220

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added sql SQL Planner logical-expr Logical plan and expressions core Core DataFusion crate labels Jul 2, 2024
Copy link
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged this PR up from main to resolve some conflicts

@alamb alamb merged commit 9d48045 into apache:main Jul 3, 2024
@alamb
Copy link
Contributor

alamb commented Jul 3, 2024

Thanks again @xinlifoobar

@xinlifoobar xinlifoobar deleted the dev/xinli/date_part branch July 5, 2024 04:28
@Omega359
Copy link
Contributor

Omega359 commented Jul 5, 2024

I just reset my branch with upstream main just now and I'm getting this in 4 of my tests:

---- network_time_parsing_should_work::case_2 stdout ----
Error: Result failed: Unable to transform sql expression 'extract(year FROM transaction_date)' to datafusion Expr: Some(NotImplemented("Extract not supported by UserDefinedExtensionPlanners: [Literal(Utf8(\"YEAR\")), Column(Column { relation: None, name: \"transaction_date\" })]"))

Is there some required changes to supporting code to facilitate the changes in this issue?

@Omega359
Copy link
Contributor

Omega359 commented Jul 5, 2024

Adding this clause to the plan_to_sql.rs:roundtrip_expr() test showcases the issue:

(
            TableReference::bare("person"),
            r#"extract(year from "2024-12-30"::date)"#,
            r#"fixme"#,
        ),

@Omega359
Copy link
Contributor

Omega359 commented Jul 5, 2024

The issue boils down to SqlToRel::new_with_options(..) not setting the planners. Unfortunately, I can't find a way to retrieve the list of planners set on the context to set them myself - I'll file a ticket for that shortly.

@alamb
Copy link
Contributor

alamb commented Jul 7, 2024

The issue boils down to SqlToRel::new_with_options(..) not setting the planners. Unfortunately, I can't find a way to retrieve the list of planners set on the context to set them myself - I'll file a ticket for that shortly.

issue / PR: #11296 / #11294

comphead pushed a commit to comphead/arrow-datafusion that referenced this pull request Jul 8, 2024
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate logical-expr Logical plan and expressions sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement user defined planner for date_part

4 participants