public ArrayNode fetchExplainOnlyResult()

in asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBProtocolBase.java [121:140]


    public ArrayNode fetchExplainOnlyResult(QueryServiceResponse response, Function<String, String> lineConverter)
            throws SQLException {
        if (response.results == null || response.results.isEmpty()) {
            throw getErrorReporter().errorInProtocol();
        }
        Object v = response.results.get(0);
        if (!(v instanceof String)) {
            throw getErrorReporter().errorInProtocol();
        }
        try (BufferedReader br = new BufferedReader(new StringReader(v.toString()))) {
            ArrayNode arrayNode = (ArrayNode) getDriverContext().getGenericObjectReader().createArrayNode();
            String line;
            while ((line = br.readLine()) != null) {
                arrayNode.addObject().put(EXPLAIN_ONLY_RESULT_COLUMN_NAME, lineConverter.apply(line));
            }
            return arrayNode;
        } catch (IOException e) {
            throw getErrorReporter().errorInResultHandling(e);
        }
    }