Skip to content

Commit c95ed16

Browse files
committed
[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 apache#253 from dongjoon-hyun/SPARK-52526. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent a182864 commit c95ed16

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

examples/spark-thrift-server.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
apiVersion: spark.apache.org/v1beta1
16+
kind: SparkApplication
17+
metadata:
18+
name: spark-thrift-server
19+
spec:
20+
mainClass: "org.apache.spark.sql.hive.thriftserver.HiveThriftServer2"
21+
sparkConf:
22+
spark.dynamicAllocation.enabled: "true"
23+
spark.dynamicAllocation.shuffleTracking.enabled: "true"
24+
spark.dynamicAllocation.minExecutors: "3"
25+
spark.dynamicAllocation.maxExecutors: "3"
26+
spark.kubernetes.authenticate.driver.serviceAccountName: "spark"
27+
spark.kubernetes.container.image: "apache/spark:4.0.0-java21-scala"
28+
runtimeVersions:
29+
sparkVersion: "4.0.0"
30+
applicationTolerations:
31+
restartConfig:
32+
restartPolicy: Always
33+
maxRestartAttempts: 9223372036854775807

0 commit comments

Comments
 (0)