Skip to content

Comments

Add section for SQL shell#527

Closed
akedin wants to merge 1 commit intoapache:asf-sitefrom
akedin:sql-shell-section
Closed

Add section for SQL shell#527
akedin wants to merge 1 commit intoapache:asf-sitefrom
akedin:sql-shell-section

Conversation

@akedin
Copy link

@akedin akedin commented Aug 7, 2018

@akedin
Copy link
Author

akedin commented Aug 7, 2018

R: @apilloud @melap
FYI: @xumingmin @xumingming

Copy link
Member

@apilloud apilloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor comments, but LGTM.


## Overview

Starting with version 2.6.0, Beam SQL includes an interactive shell, called the Beam SQL shell. The shell allows you to write pipelines as SQL queries without needing the Java SDK. By default, Beam uses the `DirectRunner` to execute the queries as Beam pipelines.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should we make this 2.7.0? These instructions won't work in 2.6.0.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These instructions should work as of late June. 2.6.0 RC was only cut last week.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the instructions for :run, replaced with installDist. Works locally


The `CREATE TABLE` statement registers the CSV file as a table in Beam SQL and specifies the table's schema. This statement does not directly create a persistent physical table; it only describes the source/sink to Beam SQL so that you can use the table in the queries that read data and write data.

_For more information about `CREATE TABLE` syntax and supported table types, see the [CREATE TABLE reference page](https://beam.apache.org/documentation/dsls/sql/create-table/)._
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use {{ site.baseurl }}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

```


_For more information about `SELECT` syntax, see the [SELECT reference page](https://beam.apache.org/documentation/dsls/sql/select/)._
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use {{ site.baseurl }}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


## Quickstart

To use Beam SQL shell, you must first clone the [Beam SDK repository](https://github.com/apache/beam). Then, from the root of the repository clone, execute the Gradle task to run the shell ([source code](https://github.com/apache/beam/blob/master/sdks/java/extensions/sql/shell/build.gradle#L39)) by running the following command:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linking to line numbers in master is a bad idea. Can you use a release tag or commit?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will become stale quick as well. Do you think linking just to the file is better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just linking to the file would probably be good. The target audience of the SQL shell probably doesn't care about the code, so just dropping the links might be a good option too.


By default, Beam uses the `DirectRunner` to run the pipeline on the machine where you're executing the commands. If you want to run the pipeline with a different runner, you must perform two steps:

1. Make sure the SQL shell includes the desired runner. Add the corresponding project id to the `-Pbeam.sql.shell.bundled` parameter of the Gradle invocation ([source code](https://github.com/apache/beam/blob/master/sdks/java/extensions/sql/shell/build.gradle#L26), [project ids](https://github.com/apache/beam/blob/master/settings.gradle)). For example, use the following command to include Flink runner:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about line numbers in master.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped the line number

@akedin akedin force-pushed the sql-shell-section branch from 238c7f1 to c42c415 Compare August 7, 2018 22:46
Copy link

@melap melap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akedin
Copy link
Author

akedin commented Aug 8, 2018

@melap , 2.6.0 is out, can we merge this? Thank you

@melap
Copy link

melap commented Aug 8, 2018

@asfgit merge

@asfgit asfgit closed this in f079eb1 Aug 8, 2018
swegner pushed a commit to swegner/beam that referenced this pull request Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants