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);
}
}
}}}
|