This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new c95ed16  [SPARK-52526] Add `Spark Thrift Server` example
c95ed16 is described below

commit c95ed16d80d3cdebc4b997af3c6a2f903a4b488f
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Wed Jun 18 12:45:55 2025 -0700

    [SPARK-52526] Add `Spark Thrift Server` example
    
    ### What changes were proposed in this pull request?
    
    This PR aims to add `Spark Thrift Server` example.
    
    ### Why are the changes needed?
    
    To enrich the use case example.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Manual tests.
    
    ```
    $ kubectl apply -f examples/spark-thrift-server.yaml
    sparkapplication.spark.apache.org/spark-thrift-server created
    
    $ kubectl get sparkapp
    NAME                  CURRENT STATE    AGE
    spark-thrift-server   RunningHealthy   26s
    
    $ kubectl port-forward spark-thrift-server-0-driver 10000:10000
    ```
    
    ```
    $ bin/beeline -u jdbc:hive2://localhost:10000/
    Connecting to jdbc:hive2://localhost:10000/
    Connected to: Spark SQL (version 4.0.0)
    Driver: Hive JDBC (version 2.3.10)
    Transaction isolation: TRANSACTION_REPEATABLE_READ
    Beeline version 2.3.10 by Apache Hive
    0: jdbc:hive2://localhost:10000/> show databases;
    +------------+
    | namespace  |
    +------------+
    | default    |
    +------------+
    1 row selected (0.363 seconds)
    0: jdbc:hive2://localhost:10000/> show tables;
    +------------+------------+--------------+
    | namespace  | tableName  | isTemporary  |
    +------------+------------+--------------+
    +------------+------------+--------------+
    No rows selected (0.087 seconds)
    0: jdbc:hive2://localhost:10000/> Closing: 0: jdbc:hive2://localhost:10000/
    ```
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #253 from dongjoon-hyun/SPARK-52526.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 examples/spark-thrift-server.yaml | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/examples/spark-thrift-server.yaml 
b/examples/spark-thrift-server.yaml
new file mode 100644
index 0000000..58a17d3
--- /dev/null
+++ b/examples/spark-thrift-server.yaml
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+apiVersion: spark.apache.org/v1beta1
+kind: SparkApplication
+metadata:
+  name: spark-thrift-server
+spec:
+  mainClass: "org.apache.spark.sql.hive.thriftserver.HiveThriftServer2"
+  sparkConf:
+    spark.dynamicAllocation.enabled: "true"
+    spark.dynamicAllocation.shuffleTracking.enabled: "true"
+    spark.dynamicAllocation.minExecutors: "3"
+    spark.dynamicAllocation.maxExecutors: "3"
+    spark.kubernetes.authenticate.driver.serviceAccountName: "spark"
+    spark.kubernetes.container.image: "apache/spark:4.0.0-java21-scala"
+  runtimeVersions:
+    sparkVersion: "4.0.0"
+  applicationTolerations:
+    restartConfig:
+      restartPolicy: Always
+      maxRestartAttempts: 9223372036854775807


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to