...
An interactive command shell
Execute SQL queries and non-queries, show tables, functions, schema, etc.
Execute SQL files
Set environment variables interactively and/or via configuration file to configure behavior of shell
Command editing, history, highlight and auto-completion
Display SQL query in a streaming friendly way
List status of submitted non-query SQL statements and be able to stop them
Apart from Samza SQL, support other streaming SQLs and data sources by letting user implement their own plugins
Proposed Changes
We need to implement a Samza SQL shell.
Terminal: Choice of Programming Language and Libraries
...
terminal.puts(InfoCmp.Capability.enter_ca_mode); // tput smcup
terminal.puts(InfoCmp.Capability.exit_ca_mode); // tput rmcup
Commands
Use “HELP” to show all commands and their brief descriptions, or “help <command>” to get more detail about a specific command.
Use "SHOW TABLES" to Displays all tables. Use "SHOW FUNCTIONS" to display all functions. Use "DESCRIBE <table name>" to display the schema of a table. The result is displayed as a formatted table and the column width is automatically adjusted, where lines are automatically wrapped within the columns to make most efficient usage of the screen room. Lines are colored with alternative colors for better reading.
Use "SELECT" command to executes a select SQL statement. The shell uses a logging view to display the result for now (table view will be supported in the future and users will be allowed to choose among various views by the SET command).
// TODO: INSERT A SELECT VIEW HERE
Use "EXECUTE" command to executes a SQL file. All the SELECT statements in the file will be omitted as executing streaming SELECT statements in a batch doesn’t make sense.
Use "INSERT INTO" to execute an INSERT INTO statement. User gets an execution ID if this non-query statement is submitted successfully, and they can use the ID to control the execution later.
Use "LIST" command to list all the non-query executions that have been executed. It displays the ID, status and original statement of the execution. You can also use “LS [id1, id2...]” to list specific executions.
Use "STOP" command to stop the specified execution(s).
Use "RM" command to remove stopped executions(s) that from showing in the future.
Accessing Samza
Public Interfaces
...