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

Add quote & escape for create external table #8310

Closed
Asura7969 opened this issue Nov 23, 2023 · 1 comment · Fixed by #8351
Closed

Add quote & escape for create external table #8310

Asura7969 opened this issue Nov 23, 2023 · 1 comment · Fixed by #8351
Labels
enhancement New feature or request

Comments

@Asura7969
Copy link
Contributor

Asura7969 commented Nov 23, 2023

Is your feature request related to a problem or challenge?

1、Add quote & escape for create external table
2、In addition, the DELIMITER attribute is only used in csv. Can it also be moved to option?

Describe the solution you'd like

CREATE EXTERNAL TABLE custom(
    c1  VARCHAR DEFAULT NULL,
    c2  VARCHAR DEFAULT NULL
)
STORED AS CSV
WITH HEADER ROW
OPTIONS ('delimiter' ',','read.escape' '\', 'read.quote' '~')
LOCATION 'custom.csv';

read.escape & read.quote from https://github.com/apache/arrow-datafusion/pull/8251 comment

Describe alternatives you've considered

No

Additional context

Related: #8251

@Asura7969
Copy link
Contributor Author

For this, I will do 3 things:

  • 1、Add quote & escape attributes to OPTIONS.
  • 2、delimiter will not be moved to OPTIONS.
  • 3、quote & escape will not change to read.escape & read.quote

for 2 & 3: I'm not sure if it will cause trouble to users,so keep it as is

final:

CREATE EXTERNAL TABLE custom(
    c1  VARCHAR DEFAULT NULL,
    c2  VARCHAR DEFAULT NULL
)
STORED AS CSV
DELIMITER ','
WITH HEADER ROW
OPTIONS ('escape' '\', 'quote' '~')
LOCATION 'custom.csv';

If you have better suggestions, please leave a message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant