Note, that in the Streaming case, the print operation does not trigger execution directly.
Note, that in the Streaming case, the print operation does not trigger execution directly.
The Flink Shell comes with command history and autocompletion.
The Flink Shell comes with command history and auto-completion.
## Adding external dependencies
## Scala Shell with Flink on YARN
It is possible to add external classpaths to the Scala-shell. These will be sent to the Jobmanager automatically alongside your shell program, when calling execute.
The Scala shell can connect Flink cluster on YARN. To connect deployed Flink cluster on YARN, use following command:
Use the parameter `-a <path/to/jar.jar>` or `--addclasspath <path/to/jar.jar>` to load additional classes.
The shell reads the connection information of the deployed Flink cluster from the `.yarn-properties` file, which is created in the configured `yarn.properties-file.location` directory or the temporary directory. If there is no deployed Flink cluster on YARN, the shell prints an error message.
The shell can deploy a Flink cluster to YARN, which is used exclusively by the shell. The number of YARN containers can be controlled by the parameter `-n <arg>`. The shell deploys a new Flink cluster on YARN and connects the cluster. You can also specify options for YARN cluster such as memory for JobManager, name of YARN application, etc..
## Setup
## Adding external dependencies
To get an overview of what options the Scala Shell provides, please use
It is possible to add external classpaths to the Scala-shell. These will be sent to the Jobmanager automatically alongside your shell program, when calling execute.
~~~bash
bin/start-scala-shell.sh --help
~~~
Use the parameter `-a <path/to/jar.jar>` or `--addclasspath <path/to/jar.jar>` to load additional classes.
### Local
To use the shell with an integrated Flink cluster just execute: