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

feat: datafusion-cli support executes sql with escaped characters #6498

Merged
merged 2 commits into from
Jun 2, 2023

Conversation

r4ntix
Copy link
Contributor

@r4ntix r4ntix commented May 31, 2023

Which issue does this PR close?

Closes #6397

Rationale for this change

See #6397

What changes are included in this PR?

  • add unescape_input function to unescape the input of datafusion-cli
  • unescape the sql before executing and verifying it

Are these changes tested?

Add unit tests in src/helper.rs

Are there any user-facing changes?

None

@alamb
Copy link
Contributor

alamb commented May 31, 2023

I merged this PR with the main branch to fix the build failure

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.

This looks great -- thank you @r4ntix ❤️

I also tested the reproducer from the original report and it now works 🎉

❯ create external table test stored as csv location '/tmp/test.tsv' delimiter '\t';
0 rows in set. Query took 0.026 seconds.
❯ select * from test;
+----------+----------+
| column_1 | column_2 |
+----------+----------+
| col1     | col2     |
| 1        | 2        |

}

#[test]
fn unescape_readline_input() -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@alamb alamb merged commit d9d06a4 into apache:main Jun 2, 2023
@r4ntix r4ntix deleted the issue-6397 branch June 12, 2023 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

datafusion-cli doesn't accept tab delimiter for CSV files
2 participants