Description
We don't have a brilliant way to distribute or launch using just downloaded jars, but it is useful anyhow to be able to quickly build a self-contained SQL shell. The Gradle application plugin does this really well.
Attachments
Issue Links
- links to
Activity
ASF GitHub Bot
logged work - 27/Jun/18 18:33
-
- Time Spent:
- 10m
-
kennknowles closed pull request #5786: [
BEAM-4651] Add bundle-ready SQL shell using application plugin
URL: https://github.com/apache/beam/pull/5786
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/sdks/java/extensions/sql/shell/build.gradle b/sdks/java/extensions/sql/shell/build.gradle
new file mode 100644
index 00000000000..74fc9734e44
--- /dev/null
+++ b/sdks/java/extensions/sql/shell/build.gradle
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 specific language governing permissions and
+ * limitations under the License.
+ */
+
+apply plugin: org.apache.beam.gradle.BeamModulePlugin
+
+apply plugin: "application"
+
+dependencies {
+ compile project(path: ":beam-sdks-java-extensions-sql-jdbc", configuration: "shadow")
+
+ if (project.hasProperty("beam.sql.shell.bundled")) {
+ project.getProperty("beam.sql.shell.bundled").tokenize(",").each {
+ subproject -> compile project(path: subproject, configuration: "shadow")
+ }
+ }
+}
+
+processResources {
+ filter org.apache.tools.ant.filters.ReplaceTokens, tokens: [
+ 'beam.version': version,
+ ]
+}
+
+mainClassName = "org.apache.beam.sdk.extensions.sql.jdbc.BeamSqlLine"
diff --git a/settings.gradle b/settings.gradle
index 969400951ff..07ae1adead7 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -94,6 +94,8 @@ include "beam-sdks-java-extensions-sql"
project(":beam-sdks-java-extensions-sql").dir = file("sdks/java/extensions/sql")
include "beam-sdks-java-extensions-sql-jdbc"
project(":beam-sdks-java-extensions-sql-jdbc").dir = file("sdks/java/extensions/sql/jdbc")
+include "beam-sdks-java-extensions-sql-shell"
+project(":beam-sdks-java-extensions-sql-shell").dir = file("sdks/java/extensions/sql/shell")
include "beam-sdks-java-fn-execution"
project(":beam-sdks-java-fn-execution").dir = file("sdks/java/fn-execution")
include "beam-sdks-java-harness"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
ASF GitHub Bot
logged work - 27/Jun/18 17:19
-
- Time Spent:
- 10m
-
apilloud commented on issue #5786: [
BEAM-4651] Add bundle-ready SQL shell using application plugin
URL: https://github.com/apache/beam/pull/5786#issuecomment-400762925
LGTM.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
ASF GitHub Bot
logged work - 27/Jun/18 16:48
-
- Time Spent:
- 10m
-
kennknowles opened a new pull request #5786: [
BEAM-4651] Add bundle-ready SQL shell using application plugin
URL: https://github.com/apache/beam/pull/5786
This is a self-contained custom build for the SQL shell. Example build and use:
```
$ ./gradlew -p sdks/java/extensions/sql/shell -Pbeam.sql.shell.bundled=':beam-runners-google-cloud-dataflow-java,:beam-runners-flink_2.11,:beam-sdks-java-io-kafka,:beam-sdks-java-io-google-cloud-platform' installDist
$ ./sdks/java/extensions/sql/shell/build/install/beam-sdks-java-extensions-sql-shell/bin/beam-sdks-java-extensions-sql-shell
Welcome to Beam SQL 2.6.0-SNAPSHOT (based on sqlline version 1.3.0)
0: BeamSQL>
```
You can also use `distZip` and `distTar` to just build the bundle for whatever uses you desire. I inspected the zip to confirm the expected stuff was in it. I also tried it out with Pubsub and got to a bug that I am currently diagnosing (and this will help me do it faster).
------------------------
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
- [x] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
R: @apilloud
Post-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
Lang | SDK | Apex | Dataflow | Flink | Gearpump | Spark
--- | --- | --- | --- | --- | --- | ---
Go | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/) | --- | --- | --- | --- | ---
Java | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/)
Python | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/) | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/) </br> [![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/) | --- | --- | ---
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org