shivusondur commented on a change in pull request #25561: [SPARK-28810][DOC][SQL] Document SHOW TABLES in SQL Reference. URL: https://github.com/apache/spark/pull/25561#discussion_r326856785
########## File path: docs/sql-ref-syntax-aux-show-tables.md ########## @@ -18,5 +18,73 @@ license: | See the License for the specific language governing permissions and limitations under the License. --- +### Description -**This page is under construction** +List all the `tables` from the database with `database-name` and `is temporary table`. + +### Syntax +{% highlight sql %} +SHOW TABLES [{FROM|IN} database_name] [LIKE 'regex_pattern'] +{% endhighlight %} + +### Parameter +<dl> + <dt><code><em>{FROM|IN} database_name</em></code></dt> + <dd> + Listing the tables from this `database`. + </dd> + <dt><code><em>LIKE 'regex_pattern'</em></code></dt> + <dd> + A regex pattern that is used to filter out unwanted functions. + <br> - Only `*` and `|` are allowed as wildcard pattern. + <br> - Excluding `*` and `|` the remaining pattern follows the regex semantics. + <br> - The leading and trailing blanks are trimmed in the input pattern before processing. + </dd> +</dl> + +### Example +{% highlight sql %} +-- List all tables in default database +SHOW TABLES; ++-----------+------------+--------------+--+ +| database | tableName | isTemporary | ++-----------+------------+--------------+--+ +| default | sam | false | +| default | sam1 | false | +| default | suj | false | ++-----------+------------+--------------+--+ + +-- List all tables from userdb database +SHOW TABLES FROM userdb; ++-----------+------------+--------------+--+ +| database | tableName | isTemporary | ++-----------+------------+--------------+--+ +| userdb | user1 | false | +| userdb | user2 | false | ++-----------+------------+--------------+--+ + +-- List all tables in userdb database +SHOW TABLES IN userdb; ++-----------+------------+--------------+--+ +| database | tableName | isTemporary | ++-----------+------------+--------------+--+ +| userdb | user1 | false | +| userdb | user2 | false | ++-----------+------------+--------------+--+ + +-- List all tables from default database matching the pattern `sam*` +SHOW TABLES FROM default LIKE 'sam*'; ++-----------+------------+--------------+--+ +| database | tableName | isTemporary | ++-----------+------------+--------------+--+ +| default | sam | false | +| default | sam1 | false | ++-----------+------------+--------------+--+ + +{% endhighlight %} + +### Related statements. Review comment: Done ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org