From 4bb45881939b101fb11ded87e481400bd214a037 Mon Sep 17 00:00:00 2001 From: STWang Date: Tue, 28 Oct 2025 12:07:22 -0600 Subject: [PATCH 1/5] fix quickstart --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb8cffa..5a9e9b1 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,13 @@ Create a `pom.xml` file in your project root: 0.1 + + + dev.projectasap + flinksketch-bench + 0.1 + + org.apache.flink @@ -88,7 +95,9 @@ Create a `pom.xml` file in your project root: ### 4. Write Your Flink Job -Copy the code from [QuickStart.java](flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java) to `src/main/java/com/mycompany/app/App.java`. +Copy the code from [QuickStart.java](flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java) to `src/main/java/com/mycompany/app/App.java`, and make these changes: +- Change the package from `package dev.projectasap.flinksketch.examples.quickstart;` to `package com.mycompany.app;` +- Rename the class from `public class QuickStart` to `public class App` **Key operations:** From 134e5b1736af048b3490e11dad15668877f0b8bc Mon Sep 17 00:00:00 2001 From: STWang Date: Tue, 28 Oct 2025 12:22:17 -0600 Subject: [PATCH 2/5] run jobs --- README.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5a9e9b1..4e17f46 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,11 @@ cd my-flink-sketch-app mkdir -p src/main/java/com/mycompany/app ``` -### 3. Add Dependencies to pom.xml +### 3. Create pom.xml -Create a `pom.xml` file in your project root: +Create a `pom.xml` file in your project root with the following content. + +**Note:** This includes both dependencies (`flinksketch-core` and `flinksketch-bench`) and the `exec-maven-plugin` configuration needed to run locally. ```xml @@ -88,6 +90,20 @@ Create a `pom.xml` file in your project root: maven-compiler-plugin 3.8.1 + + org.codehaus.mojo + exec-maven-plugin + 3.6.2 + + java + test + + -classpath + + com.mycompany.app.App + + + @@ -127,8 +143,8 @@ JsonNode frequency = result.precompute.query(queryParams); # Compile your project mvn clean compile -# Run your application -mvn exec:java -Dexec.mainClass="com.mycompany.app.App" +# Run your application - use grep to avoid flink output +mvn exec:exec | grep apple ``` For more sketch types (quantiles, cardinality, top-K) and advanced usage, see the Usage Examples section below. From 3e4ca4c3ff16373068ba12fca2443c3c2ab386db Mon Sep 17 00:00:00 2001 From: STWang Date: Tue, 28 Oct 2025 12:37:23 -0600 Subject: [PATCH 3/5] fix comments --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4e17f46..810eb2e 100644 --- a/README.md +++ b/README.md @@ -111,9 +111,22 @@ Create a `pom.xml` file in your project root with the following content. ### 4. Write Your Flink Job -Copy the code from [QuickStart.java](flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java) to `src/main/java/com/mycompany/app/App.java`, and make these changes: +Copy the example code to your project. + +**Option 1: Using command line** + +```bash +# From the parent directory containing both FlinkSketch and my-flink-sketch-app +cp FlinkSketch/flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java \ + my-flink-sketch-app/src/main/java/com/mycompany/app/QuickStart.java +``` + +**Option 2: Manual copy** + +Copy the code from [QuickStart.java](flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java) to `src/main/java/com/mycompany/app/App.java`. + +**⚠️ Important: After copying, make this change:** - Change the package from `package dev.projectasap.flinksketch.examples.quickstart;` to `package com.mycompany.app;` -- Rename the class from `public class QuickStart` to `public class App` **Key operations:** From 2a722369824bd5f8e2902830a9cf7b10c9cc1868 Mon Sep 17 00:00:00 2001 From: Milind Srivastava Date: Tue, 28 Oct 2025 15:34:57 -0400 Subject: [PATCH 4/5] Updated README to be clearer --- README.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 810eb2e..7c8f28d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ cd FlinkSketch mvn clean install ``` -### 2. Create a New Flink Project +### 2. Create a New Java Project ```bash # Create a new directory for your project @@ -100,7 +100,7 @@ Create a `pom.xml` file in your project root with the following content. -classpath - com.mycompany.app.App + com.mycompany.app.QuickStart @@ -111,24 +111,18 @@ Create a `pom.xml` file in your project root with the following content. ### 4. Write Your Flink Job -Copy the example code to your project. - -**Option 1: Using command line** +Copy the example code from [QuickStart.java](flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java) to your project at `src/main/java/com/mycompany/app/QuickStart.java`. ```bash # From the parent directory containing both FlinkSketch and my-flink-sketch-app -cp FlinkSketch/flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java \ - my-flink-sketch-app/src/main/java/com/mycompany/app/QuickStart.java +cp ../FlinkSketch/flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java \ + ./src/main/java/com/mycompany/app/QuickStart.java ``` -**Option 2: Manual copy** - -Copy the code from [QuickStart.java](flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java) to `src/main/java/com/mycompany/app/App.java`. - -**⚠️ Important: After copying, make this change:** +**After copying, make this change:** - Change the package from `package dev.projectasap.flinksketch.examples.quickstart;` to `package com.mycompany.app;` -**Key operations:** +**Key operations in QuickStart.java:** Ingestion: ```java From d0406ea3125c39d9d9e7e58f399c74a74b6fc56b Mon Sep 17 00:00:00 2001 From: Milind Srivastava Date: Tue, 28 Oct 2025 15:48:27 -0400 Subject: [PATCH 5/5] Minor change to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c8f28d..ba0c28a 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ Create a `pom.xml` file in your project root with the following content. Copy the example code from [QuickStart.java](flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java) to your project at `src/main/java/com/mycompany/app/QuickStart.java`. ```bash -# From the parent directory containing both FlinkSketch and my-flink-sketch-app +# From your project directory (my-flink-sketch-app) cp ../FlinkSketch/flinksketch-examples/src/main/java/dev/projectasap/flinksketch/examples/quickstart/QuickStart.java \ ./src/main/java/com/mycompany/app/QuickStart.java ```