davisp opened a new pull request, #12653:
URL: https://github.com/apache/datafusion/pull/12653

   Currently, the CreateExternalTable::definition field is just a stringfied 
version of the statement. Its slightly awkward to have the definition not be 
the same as what a user provided.
   
   ## Which issue does this PR close?
   
   Closes #12652
   
   ## Rationale for this change
   
   The CreateExternalTable::definition field isn't the same as what was 
provided to the SQL parser.
   
   ## What changes are included in this PR?
   
   This is a first draft at updating the CreateExternalTable::definition value 
to reflect what was provided.
   
   Heads up, if folks are generally on board with the motivation here, I'm 
pretty sure we'll want to move the "render SQL between these two token indices" 
logic to live in the sqlparser crate. Here I've just implemented a less than 
optimal approach directly in `DFParser` to sketch out that the idea is vaguely 
possible. If folks are on board with this, I'd be more than happy to split that 
out and provide a proper implementation in the sqlparser crate that this change 
could then use.
   
   ## Are these changes tested?
   
   Yes-ish. I've updated the sql parser tests to match. Though there are tests 
in other parts of the project that are now failing after the change that I've 
not investigated. I'll obviously go chase down all those loose ends if/when 
there's consensus that this change is wanted at all.
   
   ## Are there any user-facing changes?
   
   Yes, though I expect a few requests for changes as I just wrote enough to 
show that it could work before polishing up into a complete PR.
   
   * `datafusion_sql::parser::Statement::CreateExternalTable` now has an 
`Option<String>` element.
   
   I'm assuming the public enum change warrants the API change label, so I'll 
add that. 
   


-- 
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]

Reply via email to