@Test
public void testMaxResults() throws InterpreterException {

  sparkInterpreter.interpret("case class P(age:Int)");
  sparkInterpreter.interpret(
          "val gr = sc.parallelize(Seq(P(1),P(2),P(3),P(4),P(5),P(6),P(7),P(8),P(9),P(10),P(11)))");
  sparkInterpreter.interpret("gr.toDF.registerTempTable(\"gr\")");
  InterpreterResult ret = sqlInterpreter.interpret("select * from gr");
  assertEquals(InterpreterResult.Code.SUCCESS, ret.code());
  // the number of rows is 10+1, 1 is the head of table
  assertEquals(11, ret.message().get(0).getData().split("\n").length);
  assertTrue(ret.message().get(1).getData().contains("alert-warning"));
  // test limit local property
  sqlInterpreter.setResultLimits(5);
  ret = sqlInterpreter.interpret("select * from gr");
  assertEquals(InterpreterResult.Code.SUCCESS, ret.code());
  // the number of rows is 5+1, 1 is the head of table
  assertEquals(6, ret.message().get(0).getData().split("\n").length);
}