Skip to content

Commit

Permalink
A little refactor
Browse files Browse the repository at this point in the history
Signed-off-by: grapebaba <[email protected]>
  • Loading branch information
GrapeBaBa committed Dec 6, 2021
1 parent 4858ef9 commit 1840c52
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions query/src/sql/sql_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,8 @@ impl<'a> DfParser<'a> {
} else {
Compression::None
};
let file_format = if "CSV" == format.to_uppercase().as_str() {
let file_format = if self.consume_token("RECORD_DELIMITER") {
if "CSV" == format.to_uppercase().as_str() {
if self.consume_token("RECORD_DELIMITER") {
self.parser.expect_token(&Token::Eq)?;

let record_delimiter = match self.parser.next_token() {
Expand All @@ -746,14 +746,10 @@ impl<'a> DfParser<'a> {
compression,
record_delimiter: String::from(""),
})
};

file_format
}
} else {
Some(FileFormat::Parquet { compression })
};

file_format
}
}
"JSON" => Some(FileFormat::Json),
unexpected => {
Expand Down

0 comments on commit 1840c52

Please sign in to comment.