phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duane Lupinski (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-3530) Queries with 'like/wildcard %' in the predicate not returning all rows
Date Tue, 13 Dec 2016 14:26:58 GMT

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

Duane Lupinski commented on PHOENIX-3530:
-----------------------------------------

Hi Kevin, circled back with some developers re: your question.  Confirmed we had essentially
tested for that scenario, but found it wasn't a factor in this issue.

As an example, this query returns 0 rows that should return 6 rows:

0: jdbc:phoenix:lnx21131:2181:/hbase-secure> select rowkey_i from tep_own.raw_event where
rowkey_i like '2016113007%CSXT004539%TEPST%' limit 100;
+------------------------------------------+
|                 ROWKEY_I                 |
+------------------------------------------+
+------------------------------------------+
No rows selected (0.038 seconds)



> Queries with 'like/wildcard %' in the predicate not returning all rows
> ----------------------------------------------------------------------
>
>                 Key: PHOENIX-3530
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3530
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.4.0
>         Environment: Red Hat Enterprise Linux Server release 6.5
>            Reporter: Duane Lupinski
>            Assignee: Kevin Liew
>
> Here is the background: 
> This query returns back 18 rows:
> {code:sql}
> select rowkey_i, evt_d, rawevt_fk from tep_own.event_trace where rowkey_i like '2016102709%CSXT000102%_GPS_ATS';

> {code}
> If I look at the unique rawevt_fks it returns back 6 unique rows 
> {code:sql}
> select distinct rawevt_fk from tep_own.event_trace where rowkey_i like '2016102709%CSXT000102%_GPS_ATS';

> {code}
> If I query the table with a wildcard it returns back only 2 rows when it should be 5
(one of the 6 has a row key with the hour as 08 instead of 09)
>  
> {code:sql}
> select * from tep_own.raw_event where rowkey_i like '2016102709%_CSXT000102_GPS_ATS';

> {code}
> If I query one of those rows comparing the rowkey directly using the equals sign I get
the row back as I should. 
> {code:sql}
> select * from tep_own.raw_event where rowkey_i = '20161027095735327_CSXT000102_GPS_ATS';

> {code}
> However, if I do the same query with a wildcard nothing comes back: 
> {code:sql}
> select * from tep_own.raw_event where rowkey_i like '20161027095735327_CSXT000102_GPS_%';

> {code}
> If I use the in clause to list each of the rawevt fks all rows are returned:
>  
> {code:sql}
> select * from tep_own.raw_event where rowkey_i in 
> ( '20161027085735178_CSXT000102_GPS_ATS', 
> '20161027091035210_CSXT000102_GPS_ATS', 
> '20161027092736742_CSXT000102_GPS_ATS', 
> '20161027093835903_CSXT000102_GPS_ATS', 
> '20161027094724722_CSXT000102_GPS_ATS', 
> '20161027095735327_CSXT000102_GPS_ATS') ; 
> {code}
> So, it looks like the data is there as long as you query it directly without using a
wildcard. When using a wildcard we are getting mixed results in what is returned.



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

Mime
View raw message