talatuyarer opened a new pull request, #36305:
URL: https://github.com/apache/beam/pull/36305

   Currently, using the Beam SQL shell requires cloning the entire Beam 
repository and running a complex Gradle command with specific project 
properties just to bundle I/O connectors (e.g., `./gradlew ... 
-Pbeam.sql.shell.bundled=... installDist`). This process is slow on the first 
run, non-intuitive, and makes it difficult to quickly experiment with different 
connectors.
   
   This PR introduces `beam-sql.sh`, a new standalone Bash script that 
completely automates this process. It provides a simple, powerful, and 
user-friendly command-line experience for launching the SQL Shell with any 
required I/O connectors and runners.
   
   ## Key Features
   
   The ``beam-sql.sh` script is a self-contained utility with the following 
features:
   
   * **Dynamic Dependencies**: Users can specify the Beam version, I/O 
connectors (`--io`), and runners (`--runner`) directly via command-line flags.
   
   * **Robust JAR Building**: The script dynamically generates a `pom.xml` and 
builds a self-contained "uber JAR" using the `maven-shade-plugin`. It correctly 
uses the `ServicesResourceTransformer` to merge `META-INF/services` files, 
ensuring all specified connectors are discoverable by the Java `ServiceLoader`.
   
   * **Intelligent Caching**: Successfully built JARs are cached locally in 
`~/.beamshell/cache`. Subsequent launches with the same configuration are 
instantaneous, as the script finds and uses the cached JAR, skipping the build 
step entirely.
   
   * **No Maven Required**: The script makes no assumption about a user's 
environment. It will use the system-installed `mvn` if present for speed, but 
will automatically download and use the Maven Wrapper (`mvnw`) if `mvn` is not 
found, making it highly portable.
   
   * **Standalone & Easy to Use**: It is a single Bash script with minimal, 
common dependencies (`java`, `curl`), making it easy to distribute and use.
   
   ## How to Use
   
   The script provides a simple and flexible command-line interface.
   
   **1. Basic launch with Iceberg support:**
   ```sh
   ./beam-sql.sh --io iceberg
   ```
   
   ```sh
   ./beamshell --version 2.56.0 --io kafka --io jdbc
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to