Skip to content

Commit 55df185

Browse files
committed
Add documentation to run native worker with sidecar
1 parent dbc36d3 commit 55df185

File tree

9 files changed

+43
-8
lines changed

9 files changed

+43
-8
lines changed

presto-native-execution/README.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,23 @@ Run IcebergExternalWorkerQueryRunner,
214214
`$DATA_DIR/iceberg_data/<file_format>/<catalog_type>`. Here `file_format` could be `PARQUET | ORC | AVRO` and `catalog_type` could be `HIVE | HADOOP | NESSIE | REST`.
215215
* Use classpath of module: choose `presto-native-execution` module.
216216

217+
Run NativeSidecarPluginQueryRunner:
218+
* Edit/Create `NativeSidecarPluginQueryRunner` Application Run/Debug Configuration (alter paths accordingly).
219+
* Main class: `com.facebook.presto.sidecar.NativeSidecarPluginQueryRunner`.
220+
* VM options : `-ea -Xmx5G -XX:+ExitOnOutOfMemoryError -Duser.timezone=America/Bahia_Banderas -Dhive.security=legacy`.
221+
* Working directory: `$MODULE_DIR$`
222+
* Environment variables: `PRESTO_SERVER=/Users/<user>/git/presto/presto-native-execution/cmake-build-debug/presto_cpp/main/presto_server;DATA_DIR=/Users/<user>/Desktop/data;WORKER_COUNT=0`
223+
* Use classpath of module: choose `presto-native-execution` module.
224+
217225
Run CLion:
218226
* File->Close Project if any is open.
219227
* Open `presto/presto-native-execution` directory as CMake project and wait till CLion loads/generates cmake files, symbols, etc.
220228
* Edit configuration for `presto_server` module (alter paths accordingly).
221229
* Program arguments: `--logtostderr=1 --v=1 --etc_dir=/Users/<user>/git/presto/presto-native-execution/etc`
222230
* Working directory: `/Users/<user>/git/presto/presto-native-execution`
231+
* For sidecar, Edit configuration for `presto_server` module (alter paths accordingly).
232+
* Program arguments: `--logtostderr=1 --v=1 --etc_dir=/Users/<user>/git/presto/presto-native-execution/etc_sidecar`
233+
* Working directory: `/Users/<user>/git/presto/presto-native-execution`
223234
* Edit menu CLion->Preferences->Build, Execution, Deployment->CMake
224235
* CMake options: `-DVELOX_BUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug`
225236
* Build options: `-- -j 12`
@@ -237,12 +248,24 @@ Run CLion:
237248
* For Hive, Run `HiveExternalWorkerQueryRunner` from IntelliJ and wait until it starts (`======== SERVER STARTED ========` is displayed in the log output).
238249
* For Iceberg, Run `IcebergExternalWorkerQueryRunner` from IntelliJ and wait until it starts (`======== SERVER STARTED ========` is displayed in the log output).
239250
* Scroll up the log output and find `Discovery URL http://127.0.0.1:50555`. The port is 'random' with every start.
240-
* Copy that port (or the whole URL) to the `discovery.uri` field in `presto/presto-native-execution/etc/config.properties` for the worker to discover the Coordinator.
251+
* Copy that port (or the whole URL) to the `discovery.uri` field in `presto/presto-native-execution/etc/config.properties` for the worker to announce itself to the Coordinator.
241252
* In CLion run "presto_server" module. Connection success will be indicated by `Announcement succeeded: 202` line in the log output.
242-
* Two ways to run Presto client to start executing queries on the running local setup:
243-
1. In command line from presto root directory run the presto client:
244-
* `java -jar presto-cli/target/presto-cli-*-executable.jar --catalog hive --schema tpch`
245-
2. Run `Presto Client` Application (see above on how to create and setup the configuration) inside IntelliJ
253+
* See **Run Presto Client** to start executing queries on the running local setup.
254+
255+
### Run Presto Coordinator + Sidecar
256+
* Note that everything below can be done without using IDEs by running command line commands (not in this readme).
257+
* Add a property `presto.default-namespace=native.default` to `presto-native-execution/etc/config.properties`.
258+
* Run `NativeSidecarPluginQueryRunner` from IntelliJ and wait until it starts (`======== SERVER STARTED ========` is displayed in the log output).
259+
* Scroll up the log output and find `Discovery URL http://127.0.0.1:50555`. The port is 'random' with every startup.
260+
* Copy that port (or the whole URL) to the `discovery.uri` field in`presto/presto-native-execution/etc_sidecar/config.properties` for the sidecar to announce itself to the Coordinator.
261+
* In CLion run "presto_server" module. Connection success will be indicated by `Announcement succeeded: 202` line in the log output.
262+
* See **Run Presto Client** to start executing queries on the running local setup.
263+
264+
### Run Presto Client
265+
* Run the following command from the presto root directory to start the Presto client:
266+
```
267+
java -jar presto-cli/target/presto-cli-*-executable.jar --catalog hive --schema tpch
268+
```
246269
* You can start from `show tables;` and `describe table;` queries and execute more queries as needed.
247270
248271
### Run Integration (End to End or E2E) Tests
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
connector.name=tpch
1+
connector.name=tpch

presto-native-execution/etc/config.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
discovery.uri=http://127.0.0.1:58215
1+
discovery.uri=http://127.0.0.1:<replace_port>
22
presto.version=testversion
33
http-server.http.port=7777
44
shutdown-onset-sec=1

presto-native-execution/etc/velox.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
connector.name=hive
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
connector.name=iceberg
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
connector.name=tpch
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
discovery.uri=http://127.0.0.1:<replace_port>
2+
presto.version=testversion
3+
http-server.http.port=7778
4+
shutdown-onset-sec=1
5+
runtime-metrics-collection-enabled=true
6+
native-sidecar=true
7+
presto.default-namespace=native.default
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node.environment=testing
2+
node.internal-address=127.0.0.1
3+
node.location=testing-location

0 commit comments

Comments
 (0)