TECH SOLUTIONS

Click here to edit subtitle

Forums

Post Reply
Forum Home > Bigdata Learnings( Hadoop, HBase,Hive and other bigdata technologies) > HBase: Scanner Example( Scanning selective rows from table)

Sourav Gulati
Site Owner
Posts: 83

public class ScanExample {

    public static void main(String[] args) throws IOException

    {

        Configuration conf = HBaseConfiguration.create();

        HTable table = new HTable(conf, "employee");

        Scan scan = new Scan();

        scan.setStartRow(Bytes.toBytes("2")).setStopRow(Bytes.toBytes("4"));

        

        ResultScanner scanner = table.getScanner(scan);

        for (Result res: scanner)

        {

            System.out.println(res);

        }

        

        scanner.close();

        

        

    }

       

}

 

 

Click here for Other topics of BigData Technologies

February 8, 2013 at 5:33 AM Flag Quote & Reply

You must login to post.