jsai28 commented on issue #15276:
URL: https://github.com/apache/datafusion/issues/15276#issuecomment-2739138667

   Hey I've taken a cursory look at this ticket. So if I'm thinking about this 
correctly, the `FnCallSpan` implementation will build on top of the existing 
`Span` implementation and be something like: 
   
   ```
   pub struct FnCallSpans {
       pub fn_call: Span,   // Span covering the entire function call
       pub fn_name: Span,     // Span for just the function identifier
       pub args: Vec<Span>,   // Spans for each argument
   }
   ``
   
   Then, adding the `diagnose` treat would be something like:
   
   ```
   pub trait ScalarUDFImpl: Debug + Send + Sync {
       fn diagnose(
           &self,
           arg_types: &[DataType],  // Argument types for this callsite
           spans: &FnCallSpans,     // The function call spans
       ) -> Result<(), Diagnostic> {
           // Default implementation: do nothing
           Ok(())
       }
   }
   ```
   
   And then the final part is essentially:
   
   ```
   pub struct ScalarFunctionArgs<'a> {
       ...
   
       /// Spans for function call diagnostics (new field)
       pub spans: &'a FnCallSpans,
   }
   ```
   
   This will need to be done for the other UDFs too. I'm sure I'm missing a few 
things here, but is this the general layout? Thanks for your help!


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to