Skip to content

Commit

Permalink
style: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tshauck committed Mar 25, 2024
1 parent 362e5af commit 1b966e3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions datafusion-examples/examples/sql_parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
use std::fmt::Display;

use datafusion::error::Result;
use datafusion_sql::{parser::{CopyToSource, CopyToStatement, DFParser, Statement}, sqlparser::{keywords::Keyword, parser::ParserError, tokenizer::Token}};
use datafusion_sql::{
parser::{CopyToSource, CopyToStatement, DFParser, Statement},
sqlparser::{keywords::Keyword, parser::ParserError, tokenizer::Token},
};

/// This example demonstrates how to use the DFParser to parse a statement in a custom way
#[tokio::main]
async fn main() -> Result<()> {
let mut my_parser = MyParser::new("COPY source_table TO 'file.fasta' STORED AS FASTA")?;
let mut my_parser =
MyParser::new("COPY source_table TO 'file.fasta' STORED AS FASTA")?;

let my_statement = my_parser.parse_statement()?;

Expand Down Expand Up @@ -72,7 +76,6 @@ impl MyParser<'_> {
}
}
}

}

enum MyStatement {
Expand Down Expand Up @@ -121,6 +124,10 @@ impl From<CopyToStatement> for MyCopyToStatement {

impl Display for MyCopyToStatement {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "COPY {} TO '{}' STORED AS FASTA", self.source, self.target)
write!(
f,
"COPY {} TO '{}' STORED AS FASTA",
self.source, self.target
)
}
}

0 comments on commit 1b966e3

Please sign in to comment.