mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-07-05 05:20:38 +00:00
feat: support headerless CSV copy from (#8233)
* feat: support headerless CSV copy from Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com> * fix: update csv copy sqlness result Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com> * test: cover headerless CSV copy from Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com> * test: cover headerless CSV column count mismatch Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com> --------- Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
This commit is contained in:
@@ -403,8 +403,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_parse_copy_table_from_csv_options() {
|
||||
let sql =
|
||||
"COPY my_table FROM '/tmp/test.csv' WITH (FORMAT = 'CSV', SKIP_BAD_RECORDS = 'false')";
|
||||
let sql = "COPY my_table FROM '/tmp/test.csv' WITH (FORMAT = 'CSV', SKIP_BAD_RECORDS = 'false', HEADERS = 'false')";
|
||||
let mut result =
|
||||
ParserContext::create_with_dialect(sql, &GreptimeDbDialect {}, ParseOptions::default())
|
||||
.unwrap();
|
||||
@@ -418,6 +417,7 @@ mod tests {
|
||||
))) => {
|
||||
assert_eq!(copy_table.with.get("format"), Some("CSV"));
|
||||
assert_eq!(copy_table.with.get("skip_bad_records"), Some("false"));
|
||||
assert_eq!(copy_table.with.get("headers"), Some("false"));
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user