Skip to content

Commit 8600b46

Browse files
committed
[SPARK-52293] Use super-linter for markdown files
### What changes were proposed in this pull request? This PR aims to use `super-linter` for markdown files. ### Why are the changes needed? For consistency. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs with the newly added `linter` GitHub Action test. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #173 from dongjoon-hyun/SPARK-52293. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 090cd04 commit 8600b46

File tree

10 files changed

+85
-27
lines changed

10 files changed

+85
-27
lines changed

.github/workflows/build_and_test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,17 @@ jobs:
160160
cd -
161161
swift test --filter DataFrameWriterV2Tests -c release
162162
swift test --filter IcebergTest -c release
163+
164+
linter:
165+
runs-on: ubuntu-latest
166+
steps:
167+
- name: Checkout repository
168+
uses: actions/checkout@v4
169+
with:
170+
fetch-depth: 0
171+
- name: Super-Linter
172+
uses: super-linter/super-linter@12150456a73e248bdc94d0794898f94e23127c88
173+
env:
174+
DEFAULT_BRANCH: main
175+
VALIDATE_MARKDOWN: true
176+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.markdownlint.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
MD013: false

.markdownlintignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
Sources/SparkConnect/Documentation.docc/Examples.md

Examples/app/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ This is an example Swift application to show how to use Apache Spark Connect Swi
66

77
Prepare `Spark Connect Server` via running Docker image.
88

9-
```
9+
```bash
1010
docker run --rm -p 15002:15002 apache/spark:4.0.0 bash -c "/opt/spark/sbin/start-connect-server.sh --wait"
1111
```
1212

1313
Build an application Docker image.
1414

15-
```
15+
```bash
1616
$ docker build -t apache/spark-connect-swift:app .
1717
$ docker images apache/spark-connect-swift:app
1818
REPOSITORY TAG IMAGE ID CREATED SIZE
@@ -21,7 +21,7 @@ apache/spark-connect-swift app e132e1b38348 5 seconds ago 368MB
2121

2222
Run `app` docker image.
2323

24-
```
24+
```bash
2525
$ docker run --rm -e SPARK_REMOTE=sc://host.docker.internal:15002 apache/spark-connect-swift:app
2626
Connected to Apache Spark 4.0.0 Server
2727
EXECUTE: DROP TABLE IF EXISTS t
@@ -49,7 +49,7 @@ SELECT * FROM t
4949

5050
Run from source code.
5151

52-
```
52+
```bash
5353
$ swift run
5454
...
5555
Connected to Apache Spark 4.0.0 Server

Examples/pi/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ This is an example Swift application to show how to use Apache Spark Connect Swi
55
## How to run
66

77
Prepare `Spark Connect Server` via running Docker image.
8-
```
8+
9+
```bash
910
docker run --rm -p 15002:15002 apache/spark:4.0.0 bash -c "/opt/spark/sbin/start-connect-server.sh --wait"
1011
```
1112

1213
Build an application Docker image.
1314

14-
```
15+
```bash
1516
$ docker build -t apache/spark-connect-swift:pi .
1617
$ docker images apache/spark-connect-swift:pi
1718
REPOSITORY TAG IMAGE ID CREATED SIZE
@@ -20,14 +21,14 @@ apache/spark-connect-swift pi d03952577564 4 seconds ago 369MB
2021

2122
Run `pi` docker image.
2223

23-
```
24+
```bash
2425
$ docker run --rm -e SPARK_REMOTE=sc://host.docker.internal:15002 apache/spark-connect-swift:pi
2526
Pi is roughly 3.1412831412831412
2627
```
2728

2829
Run from source code.
2930

30-
```
31+
```bash
3132
$ swift run
3233
...
3334
Pi is roughly 3.1423711423711422

Examples/spark-sql/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ This is an example Swift application to show how to develop a Spark SQL REPL(Rea
66

77
Prepare `Spark Connect Server` via running Docker image.
88

9-
```
9+
```bash
1010
docker run -it --rm -p 15002:15002 apache/spark:4.0.0 bash -c "/opt/spark/sbin/start-connect-server.sh --wait"
1111
```
1212

1313
Build an application Docker image.
1414

15-
```
15+
```bash
1616
$ docker build -t apache/spark-connect-swift:spark-sql .
1717
$ docker images apache/spark-connect-swift:spark-sql
1818
REPOSITORY TAG IMAGE ID CREATED SIZE
@@ -21,7 +21,7 @@ apache/spark-connect-swift spark-sql 265ddfec650d 7 seconds ago 390MB
2121

2222
Run `spark-sql` docker image.
2323

24-
```
24+
```bash
2525
$ docker run -it --rm -e SPARK_REMOTE=sc://host.docker.internal:15002 apache/spark-connect-swift:spark-sql
2626
Connected to Apache Spark 4.0.0 Server
2727
spark-sql (default)> SHOW DATABASES;
@@ -87,7 +87,7 @@ spark-sql (default)> exit;
8787

8888
Apache Spark 4 supports [SQL Pipe Syntax](https://spark.apache.org/docs/4.0.0/sql-pipe-syntax.html).
8989

90-
```
90+
```bash
9191
$ swift run
9292
...
9393
Build of product 'SparkSQLRepl' complete! (2.33s)
@@ -110,7 +110,7 @@ Time taken: 159 ms
110110

111111
Run from source code.
112112

113-
```
113+
```bash
114114
$ swift run
115115
...
116116
Connected to Apache Spark 4.0.0 Server

Examples/stream/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ nc -lk 9999
2020

2121
Build an application Docker image.
2222

23-
```
23+
```bash
2424
$ docker build -t apache/spark-connect-swift:stream .
2525
$ docker images apache/spark-connect-swift:stream
2626
REPOSITORY TAG IMAGE ID CREATED SIZE
@@ -29,8 +29,8 @@ apache/spark-connect-swift stream a4daa10ad9c5 7 seconds ago 369MB
2929

3030
Run `stream` docker image.
3131

32-
```
33-
$ docker run --rm -e SPARK_REMOTE=sc://host.docker.internal:15002 -e TARGET_HOST=host.docker.internal apache/spark-connect-swift:stream
32+
```bash
33+
docker run --rm -e SPARK_REMOTE=sc://host.docker.internal:15002 -e TARGET_HOST=host.docker.internal apache/spark-connect-swift:stream
3434
```
3535

3636
## Send input and check output

Examples/web/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
This project is designed to illustrate a Swift-based HTTP WebServer with Apache Spark Connect.
44

5-
- https://swiftpackageindex.com/vapor/vapor
5+
- <https://swiftpackageindex.com/vapor/vapor>
66

77
## Create a Swift project
88

9-
```
9+
```bash
1010
brew install vapor
1111
vapor new spark-connect-swift-web -n
1212
```
1313

14-
## Use `Apache Spark Connect Swift Client` package.
14+
## Use `Apache Spark Connect Swift Client` package
1515

16-
```
16+
```bash
1717
$ git diff HEAD
1818
diff --git a/Package.swift b/Package.swift
1919
index 477bcbd..3e7bb06 100644
@@ -76,13 +76,13 @@ index 2edcc8f..22313c8 100644
7676
7777
Prepare `Spark Connect Server` via running Docker image.
7878
79-
```
79+
```bash
8080
docker run --rm -p 15002:15002 apache/spark:4.0.0 bash -c "/opt/spark/sbin/start-connect-server.sh --wait"
8181
```
8282
8383
Build an application Docker image.
8484
85-
```
85+
```bash
8686
$ docker build -t apache/spark-connect-swift:web .
8787
$ docker images apache/spark-connect-swift:web
8888
REPOSITORY TAG IMAGE ID CREATED SIZE
@@ -91,14 +91,14 @@ apache/spark-connect-swift web 3fd2422fdbee 27 seconds ago 417MB
9191
9292
Run `web` docker image
9393
94-
```
94+
```bash
9595
$ docker run -it --rm -p 8080:8080 -e SPARK_REMOTE=sc://host.docker.internal:15002 apache/spark-connect-swift:web
9696
[ NOTICE ] Server started on http://127.0.0.1:8080
9797
```
9898
9999
Connect to the Swift Web Server to talk with `Apache Spark`.
100100
101-
```
101+
```bash
102102
$ curl http://127.0.0.1:8080/
103103
Welcome to the Swift world. Say hello!%
104104

@@ -108,6 +108,6 @@ Hi, this is powered by the Apache Spark 4.0.0.%
108108
109109
Run from source code.
110110
111-
```
112-
$ swift run
111+
```bash
112+
swift run
113113
```

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,3 @@ SELECT * FROM t
117117
You can find more complete examples including `Spark SQL REPL`, `Web Server` and `Streaming` applications in the [Examples](https://github.com/apache/spark-connect-swift/tree/main/Examples) directory.
118118
119119
This library also supports `SPARK_REMOTE` environment variable to specify the [Spark Connect connection string](https://spark.apache.org/docs/latest/spark-connect-overview.html#set-sparkremote-environment-variable) in order to provide more options.
120-

Sources/SparkConnect/Documentation.docc/Examples.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ docker run -it --rm -p 15002:15002 apache/spark:4.0.0 bash -c "/opt/spark/sbin/s
1313
## Basic Application Example
1414

1515
The basic application example demonstrates fundamental operations with Apache Spark Connect, including:
16+
1617
- Connecting to a Spark server
1718
- Creating and manipulating tables with SQL
1819
- Using DataFrame operations
1920
- Reading and writing data in the ORC format
2021

2122
### Key Features
23+
2224
- SQL execution for table operations
2325
- DataFrame transformations with filter operations
2426
- Data persistence with ORC format
@@ -40,11 +42,13 @@ swift run
4042
## Spark SQL REPL(Read-Eval-Print Loop) Example
4143

4244
The Spark SQL REPL application example demonstrates interactive operations with ad-hoc Spark SQL queries with Apache Spark Connect, including:
45+
4346
- Connecting to a Spark server
4447
- Receiving ad-hoc Spark SQL queries from users
4548
- Show the SQL results interactively
4649

4750
### Key Features
51+
4852
- Spark SQL execution for table operations
4953
- User interactions
5054

@@ -66,6 +70,7 @@ swift run
6670
The Pi calculation example shows how to use Spark Connect Swift for computational tasks by calculating an approximation of π (pi) using the Monte Carlo method.
6771

6872
### Key Features
73+
6974
- Command-line argument handling
7075
- Mathematical computations with Spark
7176
- Random number generation
@@ -89,6 +94,7 @@ swift run
8994
The streaming example demonstrates how to process streaming data using Spark Connect Swift client, specifically for counting words from a network socket stream.
9095

9196
### Key Features
97+
9298
- Stream processing with Spark Connect
9399
- Network socket data source
94100
- Word counting with string operations
@@ -120,6 +126,7 @@ Type text into the Netcat terminal to see real-time word counting from `Spark Co
120126
The web application example showcases how to integrate Spark Connect Swift with a web server using the Vapor framework.
121127

122128
### Key Features
129+
123130
- HTTP server integration with Vapor
124131
- REST API endpoints
125132
- Spark session management within web requests
@@ -153,6 +160,7 @@ Hi, this is powered by the Apache Spark 4.0.0.%
153160
## Development Environment
154161

155162
All examples include:
163+
156164
- A Dockerfile for containerized execution
157165
- A Package.swift file for Swift Package Manager configuration
158166
- A README.md with detailed instructions

0 commit comments

Comments
 (0)