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

Sergio Peña commented on HIVE-6683:
-----------------------------------

It does not work. 
It does not throw an error though, but the results are not correct.

The example is run in a table 'persons' with two rows only.

{noformat}
0: jdbc:hive2://localhost:10000> select 1 from persons;
+------+--+
| _c0  |
+------+--+
| 1    |
| 1    |
+------+--+

0: jdbc:hive2://localhost:10000> select  
. . . . . . . . . . . . . . . .> 1 -- comment
. . . . . . . . . . . . . . . .> from persons;
+------+--+
| _c0  |
+------+--+
| 1    |
+------+--+
{noformat}

Although there are some different errors when using the column names or the *.

{noformat}
0: jdbc:hive2://localhost:10000> select
. . . . . . . . . . . . . . . .> * -- comment
. . . . . . . . . . . . . . . .> from persons;
Error: Error while compiling statement: FAILED: SemanticException Line 0:-1 
Invalid column reference 'TOK_ALLCOLREF' (state=42000,code=40000)

0: jdbc:hive2://localhost:10000> select
. . . . . . . . . . . . . . . .> id -- comment
. . . . . . . . . . . . . . . .> from persons;
Error: Error while compiling statement: FAILED: SemanticException [Error 
10004]: Line 1:7 Invalid table alias or column reference 'id': (possible column 
names are: ) (state=42000,code=10004)
{noformat}

> Beeline does not accept comments at end of line
> -----------------------------------------------
>
>                 Key: HIVE-6683
>                 URL: https://issues.apache.org/jira/browse/HIVE-6683
>             Project: Hive
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 0.10.0
>            Reporter: Jeremy Beard
>
> Beeline fails to read queries where lines have comments at the end. This 
> works in the embedded Hive CLI.
> Example:
> SELECT
> 1 -- this is a comment about this value
> FROM
> table;
> Error: Error while processing statement: FAILED: ParseException line 1:36 
> mismatched input '<EOF>' expecting FROM near '1' in from clause 
> (state=42000,code=40000)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to