[ 
https://issues.apache.org/jira/browse/HIVE-1013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159723#comment-13159723
 ] 

tom hanlon commented on HIVE-1013:
----------------------------------

The way MySQL executes help should be easy to implement in hive. 

"help select" 

Queries a set of tables in the database mysql called help_.
help_category             | 
help_keyword              | 
help_relation             | 
help_topic 

So help select becomes..
Something generalized as....
select * from mysql.help where subject like %help% 

Hive has a database available already, all that would be needed would be to 
populate a set of tables called help_ with information. This would have the 
utility of being easily added to by community members. 

mysql> describe help_topic;
+------------------+----------------------+------+-----+---------+-------+
| Field            | Type                 | Null | Key | Default | Extra |
+------------------+----------------------+------+-----+---------+-------+
| help_topic_id    | int(10) unsigned     | NO   | PRI | NULL    |       | 
| name             | char(64)             | NO   | UNI | NULL    |       | 
| help_category_id | smallint(5) unsigned | NO   |     | NULL    |       | 
| description      | text                 | NO   |     | NULL    |       | 
| example          | text                 | NO   |     | NULL    |       | 
| url              | char(128)            | NO   |     | NULL    |       | 
+------------------+----------------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

mysql> describe help_category;
+--------------------+----------------------+------+-----+---------+-------+
| Field              | Type                 | Null | Key | Default | Extra |
+--------------------+----------------------+------+-----+---------+-------+
| help_category_id   | smallint(5) unsigned | NO   | PRI | NULL    |       | 
| name               | char(64)             | NO   | UNI | NULL    |       | 
| parent_category_id | smallint(5) unsigned | YES  |     | NULL    |       | 
| url                | char(128)            | NO   |     | NULL    |       | 
+--------------------+----------------------+------+-----+---------+-------+

mysql> describe help_keyword;
+-----------------+------------------+------+-----+---------+-------+
| Field           | Type             | Null | Key | Default | Extra |
+-----------------+------------------+------+-----+---------+-------+
| help_keyword_id | int(10) unsigned | NO   | PRI | NULL    |       | 
| name            | char(64)         | NO   | UNI | NULL    |       | 
+-----------------+------------------+------+-----+---------+-------+

mysql> describe help_relation;
+-----------------+------------------+------+-----+---------+-------+
| Field           | Type             | Null | Key | Default | Extra |
+-----------------+------------------+------+-----+---------+-------+
| help_topic_id   | int(10) unsigned | NO   | PRI | NULL    |       | 
| help_keyword_id | int(10) unsigned | NO   | PRI | NULL    |       | 
+-----------------+------------------+------+-----+---------+-------+

mysql> help select;
Name: 'SELECT'
Description:
Syntax:
SELECT
    [ALL | DISTINCT | DISTINCTROW ]
      [HIGH_PRIORITY]
      [STRAIGHT_JOIN]
      [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
      [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
    select_expr [, select_expr ...]
    [FROM table_references
    [WHERE where_condition]
    [GROUP BY {col_name | expr | position}
      [ASC | DESC], ... [WITH ROLLUP]]
    [HAVING where_condition]
    [ORDER BY {col_name | expr | position}
      [ASC | DESC], ...]
    [LIMIT {[offset,] row_count | row_count OFFSET offset}]
    [PROCEDURE procedure_name(argument_list)]
    [INTO OUTFILE 'file_name' export_options
      | INTO DUMPFILE 'file_name'
      | INTO var_name [, var_name]]
    [FOR UPDATE | LOCK IN SHARE MODE]]

SELECT is used to retrieve rows selected from one or more tables, and
can include UNION statements and subqueries. See [HELP UNION], and
http://dev.mysql.com/doc/refman/5.0/en/subqueries.html.

The most commonly used clauses of SELECT statements are these:

o Each select_expr indicates a column that you want to retrieve. There
  must be at least one select_expr.

o table_references indicates the table or tables from which to retrieve
  rows. Its syntax is described in [HELP JOIN].

o The WHERE clause, if given, indicates the condition or conditions
  that rows must satisfy to be selected. where_condition is an
  expression that evaluates to true for each row to be selected. The
  statement selects all rows if there is no WHERE clause.

  In the WHERE clause, you can use any of the functions and operators
  that MySQL supports, except for aggregate (summary) functions. See
  http://dev.mysql.com/doc/refman/5.0/en/functions.html.

SELECT can also be used to retrieve rows computed without reference to
any table.

URL: http://dev.mysql.com/doc/refman/5.0/en/select.html


--
Tom



                
> Interactive 'help' command for HiveCLI
> --------------------------------------
>
>                 Key: HIVE-1013
>                 URL: https://issues.apache.org/jira/browse/HIVE-1013
>             Project: Hive
>          Issue Type: New Feature
>          Components: Clients
>            Reporter: Carl Steinbach
>
> 'help' should return a list of HiveCLI commands. For example:
> {noformat}
> hive> help;
> Commands:
> !
> add
> dfs
> list
> set
> quit
> hive> help !;
> Command: !<command>
> Execute shell command <command> from within Hive CLI.
> hive>
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to