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] Update of "Hbase/HbaseShell/PHP" by udanax
Date Thu, 15 Nov 2007 11:01:02 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

------------------------------------------------------------------------------
+ == HQL Basic Usage Guide In PHP ==
+ 
+ You can run the following query of Hbase
+ 
  {{{
- 
  include_once("HShellConnect.class.php");
  
-   $hbase = new HShellConnect("host_address", port);
+   $hbase = new HShellConnect("Host_Address", Port_Number);
-   $result = $hbase-> executeQuery($query);
+   $result = $hbase-> executeQuery("queryString");
  
     if($result) {
-     printf("<hr /><b>Result : %s</b><hr />", $result->getRowCount());
+     print "Tuple count: ".$result->getRowCount());
+ 
      while($tuple = $result->getNext()) {
-       $tr = $td = null;
-       foreach($tuple as $key => $val) {
+       foreach($tuple as $columnName => $cellValue) {
-         $tr .= "<th>".$key."</td>";
-         $td .= "<td>".$val."</td>";
+         print "Column Name: ".$columnName;
+         print "Cell Value: ".$cellValue;
        }
-       printf('<table cellspacing="1" class="result"><tr>%s</tr><tr>%s</tr></table>',
$tr, $td);
      }
    }
  }}}

Mime
View raw message