| 464 | } |
| 465 | |
| 466 | public LogicalPlan generateLogicalPlan(TransactionId tid, String s) |
| 467 | throws simpledb.ParsingException, IOException { |
| 468 | ByteArrayInputStream bis = new ByteArrayInputStream(s.getBytes()); |
| 469 | ZqlParser p = new ZqlParser(bis); |
| 470 | try { |
| 471 | ZStatement stmt = p.readStatement(); |
| 472 | if (stmt instanceof ZQuery) { |
| 473 | return parseQueryLogicalPlan(tid, (ZQuery) stmt); |
| 474 | } |
| 475 | } catch (Zql.ParseException e) { |
| 476 | throw new simpledb.ParsingException( |
| 477 | "Invalid SQL expression: \n \t " + e); |
| 478 | } |
| 479 | |
| 480 | throw new simpledb.ParsingException( |
| 481 | "Cannot generate logical plan for expression : " + s); |
| 482 | } |
| 483 | |
| 484 | public void setTransaction(Transaction t) { |
| 485 | curtrans = t; |