• [待解决]ColumnPrefixFilter 不能过滤出全部满足条件的,


            Scan scan = new Scan();
            ColumnPrefixFilter columnPrefixFilter = new
    hbase(main):016:0> scan 't4'
    ROW                                                          COLUMN+CELL                                                                                                                                                                     
     1223434                                                     column=info:age, timestamp=1498891615751, value=25                                                                                                                              
     1223434                                                     column=info:gender, timestamp=1498891615751, value=1                                                                                                                            
     1223434                                                     column=info:name, timestamp=1498892027083, value=lisi1234                                                                                                                       
     1223434                                                     column=info:password, timestamp=1498892027083, value=x00x12xD5.                                                                                                              
     1234                                                        column=info:name, timestamp=1498892427671, value=lisi1234                                                                                                                       
     1234                                                        column=info:password, timestamp=1498892427671, value=x00x12xD5.                                                                                                              
     12341                                                       column=info:name, timestamp=1498894169373, value=sudan                                                                                                                          
     12341                                                       column=info:password, timestamp=1498894169373, value=x00x00x00x17                                                                                                           
     12342                                                       column=info:name, timestamp=1498894341082, value=hanmei                                                                                                                         
     12342                                                       column=info:password, timestamp=1498894341082, value=x00x00x04xD2                                                                                                           
     123422                                                      column=info:name, timestamp=1498894389540, value=xE9x83xADxE5xBExB7xE7xBAxB2                                                                                           
     123422                                                      column=info:password, timestamp=1498894389540, value=x00x00x04xD2                                                                                                           
     12343                                                       column=info:name, timestamp=1498894341091, value=sunwukong                                                                                                                      
     12343                                                       column=info:password, timestamp=1498894341091, value=x00x00x04xD2                                                                                                           
     123432                                                      column=info:name, timestamp=1498894389549, value=xE6xB2x99xE6xB2xB3xE4xB8x8A                                                                                           
     123432                                                      column=info:password, timestamp=1498894389549, value=x00x00x04xD2                                                                                                           
     12344                                                       column=info:name, timestamp=1498894341093, value=xE7x8CxAAxE5x85xABxE6x88x92                                                                                           
     12344                                                       column=info:password, timestamp=1498894341093, value=x00x00x04xD2                                                                                                           
     123442                                                      column=info:name, timestamp=1498894389551, value=xE7x8CxAAxE5x85xABxE6x88x92                                                                                           
     123442                                                      column=info:password, timestamp=1498894389551, value=x00x00x04xD2                                                                                                           
     223422                                                      column=info:name, timestamp=1498894677209, value=xE9x83xADxE5xBExB7xE7xBAxB2                                                                                           
     223422                                                      column=info:password, timestamp=1498894677209, value=x00x00x04xD2                                                                                                           
     223432                                                      column=info:name, timestamp=1498894677222, value=xE6xB2x99xE6xB2xB3xE4xB8x8A                                                                                           
     223432                                                      column=info:password, timestamp=1498894677222, value=x00x00x04xD2                                                                                                           
     223442                                                      column=info:name, timestamp=1498894677225, value=xE7x8CxAAxE5x85xABxE6x88x92                                                                                           
     223442                                                      column=info:password, timestamp=1498894677225, value=x00x00x04xD2                                                                                                           
     323422                                                      column=info:name, timestamp=1498894726797, value=xE9x83xADxE5xBExB7xE7xBAxB2                                                                                           
     323422                                                      column=info:name_A, timestamp=1498896667538, value=xE9x83xADxE5xBExB7xE7xBAxB2                                                                                         
     323422                                                      column=info:name_B, timestamp=1498896689859, value=xE9x83xADxE5xBExB7xE7xBAxB2                                                                                         
     323422                                                      column=info:password, timestamp=1498894726797, value=x00x00x04xD2                                                                                                           
     323422                                                      column=info:password_A, timestamp=1498896689859, value=x00x00x04xD2                                                                                                         
     323432                                                      column=info:name, timestamp=1498894726809, value=xE6xB2x99xE6xB2xB3xE4xB8x8A                                                                                           
     323432                                                      column=info:name_A, timestamp=1498896667547, value=xE6xB2x99xE6xB2xB3xE4xB8x8A                                                                                         
     323432                                                      column=info:name_B, timestamp=1498896689870, value=xE6xB2x99xE6xB2xB3xE4xB8x8A                                                                                         
     323432                                                      column=info:password, timestamp=1498894726809, value=x00x00x04xD2                                                                                                           
     323432                                                      column=info:password_A, timestamp=1498896667547, value=x00x00x04xD2                                                                                                         
     323432                                                      column=info:password_B, timestamp=1498896689870, value=x00x00x04xD2                                                                                                         
     323442                                                      column=info:name, timestamp=1498894726811, value=xE7x8CxAAxE5x85xABxE6x88x92                                                                                           
     323442                                                      column=info:name_A, timestamp=1498896667549, value=xE7x8CxAAxE5x85xABxE6x88x92                                                                                         
     323442                                                      column=info:name_B, timestamp=1498896689872, value=xE7x8CxAAxE5x85xABxE6x88x92                                                                                         
     323442                                                      column=info:password, timestamp=1498894726811, value=x00x00x04xD2                                                                                                           
     323442                                                      column=info:password_A, timestamp=1498896667549, value=x00x00x04xD2                                                                                                         
     323442                                                      column=info:password_B, timestamp=1498896689872, value=x00x00x04xD2                                                                                                         
    15 row(s) in 0.0790 seconds
    
    hbase(main):017:0> 
    
    
    
    (Bytes.toBytes("n"));
            //scan.addFamily(Bytes.toBytes("info"));
            scan.setFilter(columnPrefixFilter);
            ResultScanner scanner = table.getScanner(scan);
            printScanner(scanner);    
    private void printScanner(ResultScanner scanner ){
            for(Result result : scanner){
                System.out.print(Bytes.toString(result.getRow())+";");//rowkey
                System.out.print(Bytes.toString(result.getValue(Bytes.toBytes("info"), Bytes.toBytes("name")))+";");
                System.out.print(Bytes.toInt(result.getValue(Bytes.toBytes("info"), Bytes.toBytes("password")))+";");
                System.out.println();
            }        
        }

    有很多条却只能查出来一条

    1223434;lisi1234;

  • 相关阅读:
    视频、图形图像处理之Opencv技术记录(六)、均衡直方图
    视频、图形图像处理之Opencv技术记录(四)、OpenCV教程概述
    视频、图形图像处理之Opencv技术记录(五)、Opencv教程之图像处理(imgproc模块)之平滑图像
    Windows与Linux之间海量文件的传输与Linux下大小写敏感问题
    RedHat7.4 yum配置
    虚拟机网络设置(NAT模式)
    Linux虚拟机安装(rhel 7.4)
    maven安装与基本配置
    安装JDK(Windows)
    VMware虚拟机开机自启动
  • 原文地址:https://www.cnblogs.com/rocky-AGE-24/p/7102796.html
Copyright © 2020-2023  润新知