You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Andrew Kyle Purtell (Jira)" <ji...@apache.org> on 2022/06/16 17:23:00 UTC

[jira] [Resolved] (HBASE-8866) Implement RegEx support for Column Qualifiers etc. in Thrift

     [ https://issues.apache.org/jira/browse/HBASE-8866?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Kyle Purtell resolved HBASE-8866.
----------------------------------------
    Resolution: Won't Fix

> Implement RegEx support for Column Qualifiers etc. in Thrift
> ------------------------------------------------------------
>
>                 Key: HBASE-8866
>                 URL: https://issues.apache.org/jira/browse/HBASE-8866
>             Project: HBase
>          Issue Type: New Feature
>          Components: Thrift
>            Reporter: Lars George
>            Priority: Major
>              Labels: thrift, thrift2
>
> In the Thrift 1 definition file it says:
> {noformat}
>   /** 
>    * Get a scanner on the current table starting at the specified row and
>    * ending at the last row in the table.  Return the specified columns.
>    *
>    * @return scanner id to be used with other scanner procedures
>    */
>   ScannerID scannerOpen(
>     /** name of table */
>     1:Text tableName,
>     /**
>      * Starting row in table to scan.
>      * Send "" (empty string) to start at the first row.
>      */
>     2:Text startRow,
>     /**
>      * columns to scan. If column name is a column family, all
>      * columns of the specified column family are returned. It's also possible
>      * to pass a regex in the column qualifier.
>      */
>     3:list<Text> columns,
>     /** Scan attributes */
>     4:map<Text, Text> attributes
>   ) throws (1:IOError io)
> {noformat}
> Especially that "columns" can contain a regex for the qualifier. The code though does *not* support that currently:
> {code}
>     @Override
>     public int scannerOpen(ByteBuffer tableName, ByteBuffer startRow,
>         List<ByteBuffer> columns,
>         Map<ByteBuffer, ByteBuffer> attributes) throws IOError {
>       try {
>         HTable table = getTable(tableName);
>         Scan scan = new Scan(getBytes(startRow));
>         addAttributes(scan, attributes);
>         if(columns != null && columns.size() != 0) {
>           for(ByteBuffer column : columns) {
>             byte [][] famQf = KeyValue.parseColumn(getBytes(column));
>             if(famQf.length == 1) {
>               scan.addFamily(famQf[0]);
>             } else {
>               scan.addColumn(famQf[0], famQf[1]);
>             }
>           }
>         }
>         return addScanner(table.getScanner(scan));
>       } catch (IOException e) {
>         LOG.warn(e.getMessage(), e);
>         throw new IOError(e.getMessage());
>       }
>     }
> {code}
> It parses the columns as literals, and sets up the Scan without supporting the appropriate QualifierFilter (or others) with RegexStringComparator. 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)