bombsimon opened a new pull request, #2016:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2016

   This adds support for the valid syntax of using wildcard metrics. It also 
improves the error message on unexpected tokens.
   
   ---
   
   I opted to use the less used `parse_object_name_inner` but allow wildcards 
instead of `Parser::parse_wildcard_expr`. Reason being that the latter would 
require metrics to be `Vec<Expr>` which we know isn't semantics.
   
   Given that this code doesn't care about that, we could still opt to use that 
one instead, but I think this is a better approach resulting in a similar AST 
but always carrying `ObjectName`.
   
   
   <details>
   <summary>Example output</summary>
   
   ```sh
   // SELECT * FROM SEMANTIC_VIEW(model DIMENSIONS dim1 METRICS m.*, m2.a, m3)
   metrics: [
       ObjectName(
           [
               Identifier(
                   Ident {
                       value: "m",
                       quote_style: None,
                       span: Span(Location(1,59)..Location(1,60)),
                   },
               ),
               Identifier(
                   Ident {
                       value: "*",
                       quote_style: None,
                       span: Span(Location(1,61)..Location(1,62)),
                   },
               ),
           ],
       ),
       ObjectName(
           [
               Identifier(
                   Ident {
                       value: "m2",
                       quote_style: None,
                       span: Span(Location(1,64)..Location(1,66)),
                   },
               ),
               Identifier(
                   Ident {
                       value: "a",
                       quote_style: None,
                       span: Span(Location(1,67)..Location(1,68)),
                   },
               ),
           ],
       ),
       ObjectName(
           [
               Identifier(
                   Ident {
                       value: "m3",
                       quote_style: None,
                       span: Span(Location(1,70)..Location(1,72)),
                   },
               ),
           ],
       ),
   ]
   ```
   </details>


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