/** * Converts tuples into json representation taking into account row type. * Example: [['A']] -> [{"EXPR$0":"A"}], [[1]] -> [{"EXPR$0":{"$numberLong":1}}] * * @param rowType row type * @param tuples list of constant values in a row-expression * @return json representation of tuples */ private static JSONOptions convertToJsonOptions(RelDataType rowType, List<? extends List<RexLiteral>> tuples) { try { return new JSONOptions(convertToJsonNode(rowType, tuples), JsonLocation.NA); } catch (IOException e) { throw new DrillRuntimeException("Failure while attempting to encode Values in JSON.", e); } }