[
https://issues.apache.org/jira/browse/HIVE-994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792308#action_12792308
]
Nhan Nguyen commented on HIVE-994:
----------------------------------
Hi Shao,
Here's the output of your query. It shows correct length of each entry.
{code}
hive> select name, length(name) from staff;
Total MapReduce jobs = 1
Launching Job 1 out of 1
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_200912170925_0023, Tracking URL =
http://localhost:50030/jobdetails.jsp?jobid=job_200912170925_0023
Kill Command = /usr/local/hadoop/bin/../bin/hadoop job
-Dmapred.job.tracker=localhost:54311 -kill job_200912170925_0023
2009-12-18 09:21:49,217 Stage-1 map = 0%, reduce = 0%
2009-12-18 09:21:58,284 Stage-1 map = 40%, reduce = 0%
2009-12-18 09:22:01,337 Stage-1 map = 80%, reduce = 0%
2009-12-18 09:22:04,357 Stage-1 map = 100%, reduce = 0%
2009-12-18 09:22:07,373 Stage-1 map = 100%, reduce = 100%
Ended Job = job_200912170925_0023
OK
Peter 5
Mary 4
John 4
Time taken: 20.641 seconds
{code}
Here's the interesting output of the explain query on revision r889672
{code}
hive> explain select * from staff where name="Peter";
OK
ABSTRACT SYNTAX TREE:
(TOK_QUERY (TOK_FROM (TOK_TABREF staff)) (TOK_INSERT (TOK_DESTINATION
(TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (=
(TOK_TABLE_OR_COL name) "Peter"))))
STAGE DEPENDENCIES:
Stage-1 is a root stage
Stage-0 is a root stage
STAGE PLANS:
Stage: Stage-1
Map Reduce
Alias -> Map Operator Tree:
staff
TableScan
alias: staff
Filter Operator
predicate:
expr: (name = '"Peter"')
type: boolean
Filter Operator
predicate:
expr: (name = '"Peter"')
type: boolean
Select Operator
expressions:
expr: id
type: bigint
expr: name
type: string
outputColumnNames: _col0, _col1
File Output Operator
compressed: false
GlobalTableId: 0
table:
input format: org.apache.hadoop.mapred.TextInputFormat
output format:
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
Stage: Stage-0
Fetch Operator
limit: -1
Time taken: 0.123 seconds
{code}
and here's the output of r889506
{code}
hive> explain select * from staff where name="Peter";
OK
ABSTRACT SYNTAX TREE:
(TOK_QUERY (TOK_FROM (TOK_TABREF staff)) (TOK_INSERT (TOK_DESTINATION
(TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (=
(TOK_TABLE_OR_COL name) "Peter"))))
STAGE DEPENDENCIES:
Stage-1 is a root stage
Stage-0 is a root stage
STAGE PLANS:
Stage: Stage-1
Map Reduce
Alias -> Map Operator Tree:
staff
TableScan
alias: staff
Filter Operator
predicate:
expr: (name = 'Peter')
type: boolean
Filter Operator
predicate:
expr: (name = 'Peter')
type: boolean
Select Operator
expressions:
expr: id
type: bigint
expr: name
type: string
outputColumnNames: _col0, _col1
File Output Operator
compressed: false
GlobalTableId: 0
table:
input format: org.apache.hadoop.mapred.TextInputFormat
output format:
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
Stage: Stage-0
Fetch Operator
limit: -1
Time taken: 4.306 seconds
{code}
So, you could see that in r889672 we have
{code}
expr: (name = '"Peter"')
{code}
while in r889506 we have
{code}
expr: (name = 'Peter')
{code}
Do I miss something? Am I the only one that have this problem ?
Thanks
> String comparison stopped working on trunk code
> -----------------------------------------------
>
> Key: HIVE-994
> URL: https://issues.apache.org/jira/browse/HIVE-994
> Project: Hadoop Hive
> Issue Type: Bug
> Environment: Hadoop v0.20.1 and latest Hive from trunk
> Reporter: Nhan Nguyen
> Priority: Critical
> Fix For: 0.5.0
>
>
> Comparing string field with specified value always yield no match.
> E.g,
> Table staff
> ||id||name||
> |1|Peter|
> |2|Mary|
> |3|John|
> query:
> {code}
> select * from staff where name="Peter";
> {code}
> yield no match.
> Hive stable version with the same configuration works correctly.
> Please help troubleshooting it.
> Thanks,
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.