Package org.apache.hadoop.hbase.hql.generated

Examples of org.apache.hadoop.hbase.hql.generated.HQLParser


  private ReturnMsg runCommand(final String cmdStr)
  throws ParseException, UnsupportedEncodingException {
    LOG.info("Running command: " + cmdStr);
    Writer out = new OutputStreamWriter(System.out, "UTF-8");
    TableFormatterFactory tff = new TableFormatterFactory(out, this.conf);
    HQLParser parser = new HQLParser(cmdStr, out, tff.get());
    Command cmd = parser.terminatedCommand();
    ReturnMsg rm = cmd.execute(this.conf);
    dumpStdout();
    return rm;
  }
View Full Code Here


  if (query.length() > 0) {
      out.write("\n <hr/>\n ");

    HQLParser parser = new HQLParser(query, out, new HtmlTableFormatter(out));
    Command cmd = parser.terminatedCommand();
    if (cmd.getCommandType() != Command.CommandType.SELECT) {
      out.write("\n  <p>");
      out.print( cmd.getCommandType() );
      out.write("-type commands are disabled in this interface.</p>\n ");
View Full Code Here

    tableFormater = formatter;
    MASTER_ADDRESS = master;
  }

  public ReturnMsg executeQuery(String query) {
    HQLParser parser = new HQLParser(query, out, tableFormater);
    ReturnMsg rs = null;

    try {
      Command cmd = parser.terminatedCommand();
      if (cmd != null) {
        rs = cmd.execute(conf);
      }
    } catch (ParseException pe) {
      String[] msg = pe.getMessage().split("[\n]");
View Full Code Here

  public static void main(String[] args) throws Exception {
    Writer out = new OutputStreamWriter(System.out, "UTF-8");
    HBaseConfiguration c = new HBaseConfiguration();
    // For debugging
    TableFormatterFactory tff = new TableFormatterFactory(out, c);
    HQLParser parser = new HQLParser("select * from 'x' where row='x';", out, tff.get());
    Command cmd = parser.terminatedCommand();

    ReturnMsg rm = cmd.execute(c);
    out.write(rm == null ? "" : rm.toString());
    out.flush();
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.hql.generated.HQLParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.