<%@ page contentType="text/html;charset=UTF-8" import="java.util.*" import="org.apache.hadoop.hbase.HBaseConfiguration" import="org.apache.hadoop.hbase.hql.TableFormatter" import="org.apache.hadoop.hbase.hql.ReturnMsg" import="org.apache.hadoop.hbase.hql.generated.HQLParser" import="org.apache.hadoop.hbase.hql.Command" import="org.apache.hadoop.hbase.hql.formatter.HtmlTableFormatter" %> HQL

HQL


<% String query = request.getParameter("q"); if (query == null) { query = ""; } %>

Enter 'help;' -- thats 'help' plus a semi-colon -- for the list of HQL commands. Data Definition, SHELL, INSERTS, DELETES, and UPDATE commands are disabled in this interface

<% if (query.length() > 0) { %>
<% HQLParser parser = new HQLParser(query, out, new HtmlTableFormatter(out)); Command cmd = parser.terminatedCommand(); if (cmd.getCommandType() != Command.CommandType.SELECT) { %>

<%= cmd.getCommandType() %>-type commands are disabled in this interface.

<% } else { ReturnMsg rm = cmd.execute(new HBaseConfiguration()); String summary = rm == null? "": rm.toString(); %>

<%= summary %>

<% } } %>