CuteChuanChuan commented on issue #2215:
URL: 
https://github.com/apache/datafusion-comet/issues/2215#issuecomment-3239365326

   Hi @andygrove and @kazuyukitanimura,
   
   After analyzing the error stack trace, I found that the error is thrown from 
nativeLib.executePlan.
   
   Based on this analysis, I propose the following approach to address issue 
#2215:
   
   1. Create a private method to retrieve the current SQL text: I'm currently 
investigating whether we can use SQLExecution.EXECUTION_ID_KEY to fetch the 
actual SQL query text. However, I'm still exploring the best way to access the 
original SQL statement at this execution stage.
   2. Modify the error handling in spark-expr/src/error.rs: Extend the error 
structs (e.g., CastInvalidValue) to include an optional SQL context field that 
can store the original query text.
   3. Modify Java_org_apache_comet_Native_executePlan in jni_api.rs: Pass the 
SQL context from step 1 to the native execution context, so it's available when 
errors are generated.
   
   Does this approach seem reasonable and feasible? I would greatly appreciate 
your guidance and feedback on this proposed solution, particularly regarding:
   - The feasibility of accessing SQL text at the execution phase
   - Whether modifying the JNI interface to pass SQL context is the right 
approach
   - Any potential issues or better alternatives you might suggest
   
   Thank you for your time and guidance!


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