hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Lucene-hadoop Wiki] Trivial Update of "Hbase/HbaseShell/PHP" by udanax
Date Thu, 15 Nov 2007 13:25:56 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lucene-hadoop Wiki" for change notification.

The following page has been changed by udanax:
http://wiki.apache.org/lucene-hadoop/Hbase/HbaseShell/PHP

------------------------------------------------------------------------------
  === How to connect to HShell/HQL Server database ===
  Below is the code for connecting to a HShell/HQL Server database. 
  
- {{{
+ {{{#!java
- include_once("HShellConnect.class.php");
+   include_once("HShellConnect.class.php");
  
    //create an instance of the  HShell connection object
    $hbase = new HShellConnect("Host_Address", Port_Number);
-   
    //execute the HQL statement and return records
    $result = $hbase-> executeQuery("queryString");
  
-    if($result) {
+   if($result) {
      print "Rows Count: ".$result->getRowCount());
  
      //carry on looping through while there are records
      while($tuple = $result->getNext()) {
- 
        foreach($tuple as $columnName => $cellValue) {
          print "Column Name: ".$columnName;
          print "Cell Value: ".$cellValue;
        }
- 
      }
    }
  }}}

Mime
View raw message