private static void fastLastDataQueryForOnePrefix()
      throws IoTDBConnectionException, StatementExecutionException, RedirectException {
    System.out.println("-------fastLastQueryForOnePrefix------");
    try (SessionDataSet sessionDataSet =
        sessionEnableRedirect.executeFastLastDataQueryForOnePrefixPath(
            Arrays.asList("root", "sg1"))) {
      System.out.println(sessionDataSet.getColumnNames());
      sessionDataSet.setFetchSize(1024);
      while (sessionDataSet.hasNext()) {
        System.out.println(sessionDataSet.next());
      }
    }
  }
This example shows how to insert data of TSDataType.TEXT. You can use the session interface to
write data of String type or Binary type.
example/session/src/main/java/org/apache/iotdb/SessionExample.java