pan3793 opened a new pull request, #7455:
URL: https://github.com/apache/kyuubi/pull/7455

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: 
https://kyuubi.readthedocs.io/en/master/contributing/code/index.html
     2. If the PR is related to an issue in 
https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, 
e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
'[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug, and what versions 
are affected.
   -->
   
   Close #6832. This connector gives the Hadoop administrator a chance to 
analyze YARN aggregated logs at the cluster level - aggregate logs across 
applications by host to diagnose potential host hardware issues
   
   The current initial implementation has several limitations:
   - feat: only support `TFile`, but not `IFile`
   - perf: only supports pushing down `app_id`, `user`, `host` filters, does 
not support pushing down `container_id`, `log_type`, though they are supposed 
to be selective
   - perf: listing aggregated log files runs in a single thread during the 
planning phase - for a large cluster, it should be run in parallel on the 
driver side or launch a job to do that on the executor side.
   - etc. 
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some 
test cases that check the changes thoroughly including negative and positive 
cases if possible.
   If it was tested in a way different from regular unit tests, please clarify 
how you tested step by step, ideally copy and paste-able, so that other 
reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why 
it was difficult to add.
   -->
   UT is not added yet, as this requires a real YARN cluster with history agg 
logs.
   
   ```
   kyuubi-beeline -u 'jdbc:kyuubi://spark-dev1.foo.bar:10009/default' \
     --conf 
spark.jars=/tmp/kyuubi-spark-connector-yarn_2.12-1.12.0-SNAPSHOT.jar \
     --conf 
spark.sql.catalog.yarn=org.apache.kyuubi.spark.connector.yarn.YarnCatalog
   0: > select
   . .>   mtime, app_id, container_id, host, log_type, message
   . .> from yarn.app_logs
   . .> where
   . .>   user = 'hadoop'
   . .>   and host = 'spark-dev2.foo.bar'
   . .>   and message like '%ERROR%'
   . .>   and message  not like '%RECEIVED SIGNAL TERM%'
   . .>   and message not like '%Aborting task%'
   . .> limit 2;
   ...
   
+--------------------------+---------------------------------+-----------------------------------------+---------------------+-----------+----------------------------------------------------+
   |          mtime           |             app_id              |              
container_id               |        host         | log_type  |                  
    message                       |
   
+--------------------------+---------------------------------+-----------------------------------------+---------------------+-----------+----------------------------------------------------+
   | 2025-04-03 18:07:18.893  | application_1743671377509_0001  | 
container_1743671377509_0001_01_000001  | spark-dev2.foo.bar  | stdout    | 
25/04/03 18:07:15 ERROR ApplicationMaster$AMEndpoint: Driver terminated with 
exit code 1! Shutting down. spark-dev1.foo.bar:16601 |
   | 2025-04-03 18:07:18.893  | application_1743671377509_0001  | 
container_1743671377509_0001_01_000001  | spark-dev2.foo.bar  | stdout    | 
25/04/03 18:07:15 ERROR ApplicationMaster$AMEndpoint: Driver terminated with 
exit code 1! Shutting down. spark-dev1.foo.bar:16601 |
   
+--------------------------+---------------------------------+-----------------------------------------+---------------------+-----------+----------------------------------------------------+
   2 rows selected (0.648 seconds)
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   <!--
   If a generative AI tooling has been used in the process of authoring this 
patch, please include
   phrase 'Generated-by: ' followed by the name of the tool and its version.
   If no, write 'No'.
   Please refer to the [ASF Generative Tooling 
Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   -->
   Assisted-by: Claude Opus 4.7.
   


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