LLDay commented on code in PR #19978:
URL: https://github.com/apache/datafusion/pull/19978#discussion_r2726621896
##########
datafusion/sql/src/parser.rs:
##########
@@ -363,28 +363,48 @@ const DEFAULT_DIALECT: GenericDialect = GenericDialect {};
/// # Ok(())
/// # }
/// ```
-pub struct DFParserBuilder<'a> {
- /// The SQL string to parse
- sql: &'a str,
+pub struct DFParserBuilder<'a, 'b> {
+ /// Parser input: either raw SQL or tokens
+ input: ParserInput<'a>,
/// The Dialect to use (defaults to [`GenericDialect`]
- dialect: &'a dyn Dialect,
+ dialect: &'b dyn Dialect,
/// The recursion limit while parsing
recursion_limit: usize,
}
-impl<'a> DFParserBuilder<'a> {
+/// Describes a possible input for parser
+pub enum ParserInput<'a> {
+ /// Raw SQL. Tokenization will be performed automatically
Review Comment:
I think it should be specified more precisely that tokenization will be
performed at the time of the parser build.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]