Skip to content

Commit 42a45d1

Browse files
authored
Attach Diagnostic to syntax errors (#15680)
* ParserError->DataFusionError+attach a diagnostic * fix: ci * fix: fmt * fix:clippy * does this fix ci test? * this fixes sqllogictest * fix: cargo test * fix: fmt * add tests * cleanup * suggestions + expect EOF nicely * fix: clippy
1 parent 727c0dc commit 42a45d1

File tree

5 files changed

+112
-84
lines changed

5 files changed

+112
-84
lines changed

datafusion-examples/examples/sql_dialect.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
use std::fmt::Display;
1919

20-
use datafusion::error::Result;
20+
use datafusion::error::{DataFusionError, Result};
2121
use datafusion::sql::{
2222
parser::{CopyToSource, CopyToStatement, DFParser, DFParserBuilder, Statement},
23-
sqlparser::{keywords::Keyword, parser::ParserError, tokenizer::Token},
23+
sqlparser::{keywords::Keyword, tokenizer::Token},
2424
};
2525

2626
/// This example demonstrates how to use the DFParser to parse a statement in a custom way
@@ -62,7 +62,7 @@ impl<'a> MyParser<'a> {
6262

6363
/// This is the entry point to our parser -- it handles `COPY` statements specially
6464
/// but otherwise delegates to the existing DataFusion parser.
65-
pub fn parse_statement(&mut self) -> Result<MyStatement, ParserError> {
65+
pub fn parse_statement(&mut self) -> Result<MyStatement, DataFusionError> {
6666
if self.is_copy() {
6767
self.df_parser.parser.next_token(); // COPY
6868
let df_statement = self.df_parser.parse_copy()?;

0 commit comments

Comments
 (0)