Skip to content

Attach Diagnostic to syntax errors #15680

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

Merged
merged 12 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions datafusion-examples/examples/sql_dialect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

use std::fmt::Display;

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

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

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