-
Notifications
You must be signed in to change notification settings - Fork 2k
Port tests in csv_files.rs to sqllogictest
#8251
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
Changes from 13 commits
7afeb8b
6332bec
cc5e0c7
a114310
928c811
839093e
a836cde
5648dc7
a670409
22894a3
73a59d2
46409c2
8a86a4c
cf5c584
737d73c
447eed2
3492266
62ae9b9
da02fa2
d98eb2e
79e7216
fec6eea
3a6e362
126b3c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
|
|
||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| ############# | ||
| ## Csv Files Tests | ||
| ############# | ||
|
|
||
| statement ok | ||
| CREATE EXTERNAL TABLE csv_custom_quote ( | ||
| c1 VARCHAR DEFAULT NULL, | ||
| c2 VARCHAR DEFAULT NULL | ||
| ) | ||
| STORED AS CSV | ||
| WITH HEADER ROW | ||
| DELIMITER ',' | ||
| OPTIONS ('quote' '~') | ||
| LOCATION '../../testing/data/csv/csv_custom_quote.csv'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is needed here, but I don't know how to create it. The contents of the file( c1,c2 |
||
|
|
||
| statement ok | ||
| CREATE EXTERNAL TABLE csv_custom_escape ( | ||
| c1 VARCHAR DEFAULT NULL, | ||
| c2 VARCHAR DEFAULT NULL | ||
| ) | ||
| STORED AS CSV | ||
| WITH HEADER ROW | ||
| DELIMITER ',' | ||
| OPTIONS ('escape' '\') | ||
| LOCATION '../../testing/data/csv/csv_custom_escape.csv'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the same The contents of the file( c1,c2 |
||
|
|
||
| query TT | ||
| SELECT * from csv_custom_quote; | ||
| ---- | ||
| id0 value0 | ||
| id1 value1 | ||
| id2 value2 | ||
| id3 value3 | ||
| id4 value4 | ||
| id5 value5 | ||
| id6 value6 | ||
| id7 value7 | ||
| id8 value8 | ||
| id9 value9 | ||
|
|
||
|
|
||
| query TT | ||
| SELECT * from csv_custom_escape; | ||
| ---- | ||
| id0 value"0 | ||
| id1 value"1 | ||
| id2 value"2 | ||
| id3 value"3 | ||
| id4 value"4 | ||
| id5 value"5 | ||
| id6 value"6 | ||
| id7 value"7 | ||
| id8 value"8 | ||
| id9 value"9 | ||
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.
I'm not sure if this is the best way, maybe we can open another issue to improve it
Uh oh!
There was an error while loading. Please reload this page.
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.
TBH I'd prefer to file a separate issue for integrating
QUOTE&ESCAPEintoCreateExternalTablepipeline. My concern here is that it probably will be confusing for end-users to pass read options into clause reserved for write options (and without any effect on writing CSV).