@@ -44,6 +44,9 @@ default void explainLogical(@Language("sql") String query, String expected, Map<
44
44
.map (entry -> "SET " + entry .getKey () + "=" + entry .getValue () + ";\n " )
45
45
.collect (Collectors .joining ());
46
46
JsonNode jsonNode = postQuery (extraOptions + "explain plan without implementation for " + query );
47
+ if (!jsonNode .get ("exceptions" ).isNull ()) {
48
+ Assert .fail ("Exception in response: " + jsonNode .get ("exceptions" ).toString ());
49
+ }
47
50
JsonNode plan = jsonNode .get ("resultTable" ).get ("rows" ).get (0 ).get (1 );
48
51
49
52
Assert .assertEquals (plan .asText (), expected );
@@ -62,6 +65,9 @@ default void explainSse(boolean verbose, @Language("sql") String query, Object..
62
65
actualQuery = "SET explainPlanVerbose=true; " + actualQuery ;
63
66
}
64
67
JsonNode jsonNode = postQuery (actualQuery );
68
+ if (!jsonNode .get ("exceptions" ).isNull ()) {
69
+ Assert .fail ("Exception in response: " + jsonNode .get ("exceptions" ).toString ());
70
+ }
65
71
JsonNode plan = jsonNode .get ("resultTable" ).get ("rows" );
66
72
List <String > planAsStrList = (List <String >) JsonUtils .jsonNodeToObject (plan , List .class ).stream ()
67
73
.map (Object ::toString )
@@ -100,6 +106,9 @@ default void explainSse(@Language("sql") String query, Object... expected) {
100
106
default void explain (@ Language ("sql" ) String query , String expected ) {
101
107
try {
102
108
JsonNode jsonNode = postQuery ("explain plan for " + query );
109
+ if (!jsonNode .get ("exceptions" ).isNull ()) {
110
+ Assert .fail ("Exception in response: " + jsonNode .get ("exceptions" ).toString ());
111
+ }
103
112
JsonNode plan = jsonNode .get ("resultTable" ).get ("rows" ).get (0 ).get (1 );
104
113
105
114
Assert .assertEquals (plan .asText (), expected );
0 commit comments