Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBase API: Fix partial row scan #3285

Closed
wants to merge 4 commits into from

Conversation

THISisZOLI
Copy link

@THISisZOLI THISisZOLI commented Apr 20, 2023

What changes were proposed in this pull request?

Scrolling to the end of a row in the HBase view calls the getRowPartial() function to load in the other cells of the respective row, however currently the API uses a bad filter expression which results in corrupted data (cells of other rows) appearing in the row.

  • Fix partial row scan filter expression in the HBase API

How was this patch tested?

  • Tested changes in local HBase and Hue deployment
  • Showcase of the old and new filter expression:
    1. Created a test table in HBase:
    hbase:059:0> scan 'test'
    ROW                                      COLUMN+CELL                                                                                                        
     row1                                    column=f:c1, timestamp=2023-04-20T17:18:32.685, value=data                                                         
     row1                                    column=f:c2, timestamp=2023-04-20T17:18:38.630, value=data                                                         
     row2                                    column=f:c1, timestamp=2023-04-20T17:24:20.988, value=row2_data                                                    
     row2                                    column=f:c2, timestamp=2023-04-20T17:29:34.150, value=row2_data                                                    
     row2                                    column=f:c3, timestamp=2023-04-20T17:29:37.666, value=row2_data                                                    
    2 row(s)
    
    1. Using the old filter we get a result from row2 while we want results only from row1:
    hbase:062:0> scan 'test',{FILTER =>"ColumnPaginationFilter(100, 1)", STARTROW =>"row1"}
    ROW                                      COLUMN+CELL                                                                                                        
     row1                                    column=f:c2, timestamp=2023-04-20T17:18:38.630, value=data                                                         
     row2                                    column=f:c2, timestamp=2023-04-20T17:29:34.150, value=row2_data                                                    
     row2                                    column=f:c3, timestamp=2023-04-20T17:29:37.666, value=row2_data
    2 row(s)
    
    1. Using the new filter we only get results from row1:
    hbase:067:0> scan 'test',{FILTER =>"PrefixFilter('row1') AND ColumnPaginationFilter(100, 1)", STARTROW =>"row1"}
    ROW                                      COLUMN+CELL                                                                                                        
     row1                                    column=f:c2, timestamp=2023-04-20T17:18:38.630, value=data
    1 row(s)
    

@bjornalm
Copy link
Collaborator

Hi @THISisZOLI and thanks a lot for contributing. It is really appreciated. We will have a look at this soon as possible.

@Harshg999
Copy link
Collaborator

Harshg999 commented May 3, 2023

@ranade1 @amitsrivastava @wing2fly @quadoss Can someone please take a look at this change?

@github-actions
Copy link

This PR is stale because it has been open 45 days with no activity and is not labeled "Prevent stale". Remove "stale" label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Jun 25, 2023
@bjornalm bjornalm removed the Stale label Jun 25, 2023
@bjornalm
Copy link
Collaborator

Hi guys, this PR have been waiting too long now. Can someone please have a look? @ranade1 @amitsrivastava @wing2fly @quadoss

@ranade1 ranade1 assigned ranade1 and quadoss and unassigned ranade1 Jun 26, 2023
Copy link
Collaborator

@quadoss quadoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@quadoss quadoss enabled auto-merge (squash) June 26, 2023 16:53
@quadoss quadoss mentioned this pull request Jun 26, 2023
Copy link
Contributor

@ranade1 ranade1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Hope you have tested it on your env.

@Harshg999
Copy link
Collaborator

Hey @THISisZOLI, can you please fix the linting for the change?
For e.g like this PR: #3368

@github-actions
Copy link

github-actions bot commented Sep 8, 2023

This PR is stale because it has been open 45 days with no activity and is not labeled "Prevent stale". Remove "stale" label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Sep 8, 2023
@github-actions github-actions bot closed this Sep 19, 2023
auto-merge was automatically disabled September 19, 2023 01:48

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants