You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Zheng Wang (JIRA)" <ji...@apache.org> on 2019/08/06 03:32:00 UTC

[jira] [Comment Edited] (HBASE-22781) Not suitable params of StoreScanner in the test case TestStoreScanner.testScanSameTimestamp

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

Zheng Wang edited comment on HBASE-22781 at 8/6/19 3:31 AM:
------------------------------------------------------------

If specfiy a col,the matcher will return INCLUDE_AND_SEEK_NEXT_ROW in first loop,due to enough columns(and versions),it will never peek next cell,no matter its timestamp.

But if set to null,the matcher will return INCLUDE in first loop, and return SKIP in second loop,due to the below logic(there is some wrong in my comment before):
{code:java}
ScanWildcardColumnTracker.java
checkVersions()
{
...
// If column matches, check if it is a duplicate timestamp
if (sameAsPreviousTSAndType(timestamp, type)) {
return ScanQueryMatcher.MatchCode.SKIP;
}
...
}
{code}
Another angle,if we remove the code above,the test can still pass with a col specified,but can not pass if set null. 


was (Author: filtertip):
If specfiy a col,the matcher will return INCLUDE_AND_SEEK_NEXT_ROW in first loop,due to enough columns(and versions),it will never peek next cell,no matter its timestamp.

But if set to null,the matcher will return INCLUDE in first loop, and return SKIP in second loop,due to the below logic

(there is some wrong in my comment before):
{code:java}
ScanWildcardColumnTracker.java
checkVersions()
{
...
// If column matches, check if it is a duplicate timestamp
if (sameAsPreviousTSAndType(timestamp, type)) {
return ScanQueryMatcher.MatchCode.SKIP;
}
...
}
{code}
Another angle,if we remove the code above,the test can still pass with a col specified,but can not pass if set null. 

> Not suitable params of StoreScanner in the test case TestStoreScanner.testScanSameTimestamp
> -------------------------------------------------------------------------------------------
>
>                 Key: HBASE-22781
>                 URL: https://issues.apache.org/jira/browse/HBASE-22781
>             Project: HBase
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 2.0.0
>            Reporter: Zheng Wang
>            Assignee: Zheng Wang
>            Priority: Minor
>
> {code:java}
> public void testScanSameTimestamp() throws IOException {
>   // returns only 1 of these 2 even though same timestamp
>   KeyValue [] kvs = new KeyValue[] {
>       create("R1", "cf", "a", 1, KeyValue.Type.Put, "dont-care"),
>       create("R1", "cf", "a", 1, KeyValue.Type.Put, "dont-care"),
>   };
>   List<KeyValueScanner> scanners = Arrays.asList(
>       new KeyValueScanner[] {
>           new KeyValueScanFixture(CellComparator.getInstance(), kvs)
>       });
>   Scan scanSpec = new Scan().withStartRow(Bytes.toBytes("R1"));
>   // this only uses maxVersions (default=1) and TimeRange (default=all)
>   try (StoreScanner scan = new StoreScanner(scanSpec, scanInfo, getCols("a"), scanners)) {
>     List<Cell> results = new ArrayList<>();
>     assertEquals(true, scan.next(results));
>     assertEquals(1, results.size());
>     assertEquals(kvs[0], results.get(0));
>   }
> }
> {code}
>  
>  It will not to compare the timestamp of the two cells,because of the 'getCols("a")' limit only one column and one version(default).
> For example,modify the timestamp of the first cell to 2 can also pass.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)