Skip to content

Latest commit

 

History

History
42 lines (36 loc) · 831 Bytes

README.md

File metadata and controls

42 lines (36 loc) · 831 Bytes

A Swift Application with Apache Spark Connect Swift Client

This is an example Swift application to show how to use Apache Spark Connect Swift Client Library.

How to run

Prepare Apache Spark 4.0.0 (RC4) Connect Server.

$ curl -LO https://dist.apache.org/repos/dist/dev/spark/v4.0.0-rc4-bin/spark-4.0.0-bin-hadoop3.tgz
$ tar xvfz spark-4.0.0-bin-hadoop3.tgz
$ cd spark-4.0.0-bin-hadoop3
$ sbin/start-connect-server.sh

Run this Swift application.

$ swift run
...
Connected to Apache Spark 4.0.0 Server
EXECUTE: DROP TABLE IF EXISTS t
EXECUTE: CREATE TABLE IF NOT EXISTS t(a INT) USING ORC
EXECUTE: INSERT INTO t VALUES (1), (2), (3)
SELECT * FROM t
+---+
| a |
+---+
| 2 |
| 1 |
| 3 |
+---+
+----+
| id |
+----+
| 2  |
| 6  |
| 0  |
| 8  |
| 4  |
+----+