From 4ba72e126204790538eafa9418cf40ac786ec547 Mon Sep 17 00:00:00 2001 From: Sawant Bandita Date: Fri, 13 Mar 2026 15:44:51 +0000 Subject: [PATCH 1/3] Improve Windows build documentation for Hadoop prerequisite --- guides/windows-setup.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/guides/windows-setup.md b/guides/windows-setup.md index fcdb084d0..1ac79310f 100644 --- a/guides/windows-setup.md +++ b/guides/windows-setup.md @@ -9,7 +9,7 @@ http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, +nano windows-setup.mdnano windows-setup.md Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the @@ -132,3 +132,25 @@ Run terminal as Administrator. You are now ready to run Apache Wayang on Windows. +### Hadoop prerequisite issue on Windows + +While building Wayang on Windows, Maven may fail due to a missing Hadoop dependency. + +Error example: +Execution prerequisite-check failed: could not access constructor... + +This happens because Wayang expects the file: + +C:\hadoop\bin\winutils.exe + +Fix: + +1. Create folder C:\hadoop +2. Inside create folder bin +3. Inside bin create an empty file called winutils.exe + +After this run: + +mvn clean install -DskipTests + +The build should work correctly. From 52e296994c0f645fcb831f5779c9be6d5e9933df Mon Sep 17 00:00:00 2001 From: Sawant Bandita Date: Tue, 24 Mar 2026 13:47:45 +0000 Subject: [PATCH 2/3] Improve SQL execution documentation with proper configuration example --- guides/tutorial.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/guides/tutorial.md b/guides/tutorial.md index a9b8a92da..51372631a 100644 --- a/guides/tutorial.md +++ b/guides/tutorial.md @@ -83,3 +83,42 @@ 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: + +```java +configuration.setProperty( + "wayang.calcite.model", + "{ \"version\": \"1.0\", \"defaultSchema\": \"MY_SCHEMA\", \"schemas\": [] }" +); + +--- + +## 👉 Step 2 — Improve SQL execution step + +Below this: + +```md +3. Execute your SQL query: +```java +Collection result = context.executeSql("SELECT * FROM my_table"); + +for (Record record : result) { + System.out.println(record); +} From 2a78555c92da860e0e5a8cc0d11207342e9f76ce Mon Sep 17 00:00:00 2001 From: Sawant Bandita Date: Wed, 25 Mar 2026 15:27:28 +0000 Subject: [PATCH 3/3] Add complete SQL example for better usability --- guides/tutorial.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/guides/tutorial.md b/guides/tutorial.md index 51372631a..52eaeb6c4 100644 --- a/guides/tutorial.md +++ b/guides/tutorial.md @@ -122,3 +122,32 @@ Collection result = context.executeSql("SELECT * FROM my_table"); for (Record record : result) { System.out.println(record); } +### Example: Running a simple SQL query + +Wayang allows executing SQL queries using the `SqlContext` API. + +```java +import org.apache.wayang.api.sql.context.SqlContext; +import org.apache.wayang.core.api.Configuration; +import org.apache.wayang.basic.data.Record; + +import java.util.Collection; + +public class Example { + public static void main(String[] args) throws Exception { + Configuration configuration = new Configuration(); + + configuration.setProperty( + "wayang.calcite.model", + "{ \"version\": \"1.0\", \"defaultSchema\": \"MY_SCHEMA\", \"schemas\": [] }" + ); + + SqlContext context = new SqlContext(configuration); + + Collection result = context.executeSql("SELECT * FROM my_table"); + + for (Record record : result) { + System.out.println(record); + } + } +}