-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix DataFrame::with_column
to handle creating column names with a period
#3700
Conversation
@@ -1378,6 +1383,43 @@ mod tests { | |||
Ok(()) | |||
} | |||
|
|||
#[tokio::test] | |||
async fn with_column_name() -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to @hengfeiyang for this reproducer
datafusion/core/src/dataframe.rs
Outdated
// try and create a column with a '.' in it | ||
.with_column("f.c2", lit("hello")) | ||
.unwrap(); | ||
// Note trying to select causes an error (todo file a separate ticket) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it turns it something still isn't right (select doesn't work) -- I plan to file an issue (or maybe someone else will have the time to debug it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alamb i tested with #3733 , it looks i tested use config: Cargo.toml
with the example code:
Result:
|
You can't use Does it work if you use Expr::Column(Column {
relation: None,
name: "f.c".into(),
}) instead of ? If so we should probably offer an alternate to |
Sorry for that, i updated my test code above, I use |
I will merge this PR and then try your example |
Benchmark runs are scheduled for baseline = 1d634e5 and contender = 1528961. 1528961 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
@hengfeiyang I have merged this PR and now when I run your example from #3700 (comment) it produces this output:
|
Thanks |
Which issue does this PR close?
fixes #3682
Rationale for this change
What changes are included in this PR?
col()
, which tries to parse strings as identifiers (e.g. splits on.
)Are there any user-facing changes?
One fewer bug