TajoInterpreter extends Interpreter { public TajoInterpreter(Properties property) { super(property); } TajoInterpreter(Properties property); Connection getJdbcConnection(); @Override void open(); @Override void close(); @Override InterpreterResult interpret(String cmd, InterpreterContext contextInterpreter); @Override void cancel(InterpreterContext context); @Override FormType getFormType(); @Override int getProgress(InterpreterContext context); @Override Scheduler getScheduler(); @Override List<String> completion(String buf, int cursor); static final String TAJO_JDBC_URI; static final String TAJO_DRIVER_NAME; }
@Test public void testTajoInterpreter() throws Exception { TajoInterpreter t = new TesterTajoInterpreter(new Properties()); t.open(); Class clazz = Class.forName(t.TAJO_DRIVER_NAME); assertNotNull(clazz); Constructor cons = clazz.getConstructor(new Class[]{}); TajoDriver driver = (TajoDriver) cons.newInstance(); assertTrue(driver.acceptsURL("jdbc:tajo:")); assertFalse(driver.acceptsURL("jdbc:taju:")); InterpreterResult result = t.interpret("select * from t", null); assertEquals(result.type(), InterpreterResult.Type.TABLE); result = t.interpret("explain select * from t", null); assertEquals(result.type(), InterpreterResult.Type.TEXT); t.close(); }