@Override
  public InterpreterResult interpret(String st, InterpreterContext context)
      throws InterpreterException {
    LOGGER.info("Running SQL query: '{}' over Pandas DataFrame", st);
    return pythonInterpreter.interpret(
        "z.show(pysqldf('" + st.trim() + "'))", context);
  }
@Test
  public void sqlOverTestDataPrintsTable() throws IOException, InterpreterException {
    InterpreterResult ret =
        pythonInterpreter.interpret("import pandas as pd\nimport numpy as np", context);
    assertEquals(InterpreterResult.Code.SUCCESS, ret.code(), ret.message().toString());

    // DataFrame df2 \w test data
    ret = pythonInterpreter.interpret("df2 = pd.DataFrame({ 'age'  : np.array([33, 51, 51, 34]), " +
        "'name' : pd.Categorical(['moon','jobs','gates','park'])})", context);
    assertEquals(InterpreterResult.Code.SUCCESS, ret.code(), ret.message().toString());

    // when
    context = getInterpreterContext();
    ret = pandasSqlInterpreter.interpret("select name, age from df2 where age < 40", context);

    // then
    assertEquals(InterpreterResult.Code.SUCCESS, ret.code(), context.out.toString());
    assertEquals(Type.TABLE,
        context.out.toInterpreterResultMessage().get(0).getType(), context.out.toString());
    assertTrue(context.out.toString().indexOf("moon\t33") > 0);
    assertTrue(context.out.toString().indexOf("park\t34") > 0);

    assertEquals(InterpreterResult.Code.SUCCESS,
        pandasSqlInterpreter.interpret(
            "select case when name==\"aa\" then name else name end from df2",
            context).code());
  }