From 157027a388011e9bcfddcacaaf335fb831e985f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 13 Sep 2026 02:51:47 +0500 Subject: [PATCH] [Docs] Fix Markdown formatting, prompt artifacts, and outdated URLs in tutorial guide --- guides/tutorial.md | 47 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/guides/tutorial.md b/guides/tutorial.md index 52eaeb6c4..7eba6925c 100644 --- a/guides/tutorial.md +++ b/guides/tutorial.md @@ -20,23 +20,23 @@ This tutorial will show users how to run the WordCount example locally with Waya # Clone repository ```shell -git clone https://github.com/apache/incubator-wayang.git +git clone https://github.com/apache/wayang.git ``` # Create binaries Running following commands to build Wayang and generate the tar.gz ```shell -cd incubator-wayang +cd wayang ./mvnw clean package -pl :wayang-assembly -Pdistribution ``` -Then you can find the `wayang-assembly-1.1.1-SNAPSHOT-dist.tar.gz` under `wayang-assembly/target` directory. +Then you can find the `wayang-assembly-1.1.2-SNAPSHOT-dist.tar.gz` under `wayang-assembly/target` directory. # Prepare the environment ## Wayang ```shell -tar -xvf wayang-assembly-1.1.1-SNAPSHOT-dist.tar.gz -cd wayang-1.1.1-SNAPSHOT +tar -xvf wayang-assembly-1.1.2-SNAPSHOT-dist.tar.gz +cd wayang-1.1.2-SNAPSHOT ``` In linux @@ -60,11 +60,11 @@ source ~/.zshrc To execute the WordCount example with Apache Wayang, you need to execute your program with the 'wayang-submit' command: ```shell -cd wayang-1.1.1-SNAPSHOT +cd wayang-1.1.2-SNAPSHOT ./bin/wayang-submit org.apache.wayang.apps.wordcount.Main java file://$(pwd)/README.md ``` -## If you're using Java 17, add the following JVM flags: -Update your `wayang-submit` (wayang-assembly/target/wayang-1.0.1-SNAPSHOT/bin/wayang-submit) script (or command) with: +## If you're using Java 17, add the following JVM flags: +Update your `wayang-submit` (`wayang-assembly/target/wayang-1.1.2-SNAPSHOT/bin/wayang-submit`) script (or command) with: ```shell eval "$RUNNER \ @@ -83,46 +83,40 @@ eval "$RUNNER \ Then you should be able to see outputs like this: ![img.png](../images/wordcount_result.png) + ## Running SQL Queries in Wayang Wayang provides support for executing SQL queries using its SQL API. -### Example - -```sql -SELECT * FROM my_table; ### Steps to execute SQL queries -1. Configure the Wayang Calcite model using the property: - `wayang.calcite.model` - -2. Create a `SqlContext` instance: - -```java -SqlContext context = new SqlContext(configuration); -Example configuration: +1. Configure the Wayang Calcite model using the property `wayang.calcite.model`: ```java +Configuration configuration = new Configuration(); configuration.setProperty( "wayang.calcite.model", "{ \"version\": \"1.0\", \"defaultSchema\": \"MY_SCHEMA\", \"schemas\": [] }" ); +``` ---- - -## 👉 Step 2 — Improve SQL execution step +2. Create a `SqlContext` instance: -Below this: +```java +SqlContext context = new SqlContext(configuration); +``` -```md 3. Execute your SQL query: + ```java Collection result = context.executeSql("SELECT * FROM my_table"); for (Record record : result) { System.out.println(record); } -### Example: Running a simple SQL query +``` + +### Example: Running a SQL Query Wayang allows executing SQL queries using the `SqlContext` API. @@ -151,3 +145,4 @@ public class Example { } } } +```