private static void fastLastDataQueryForOneDevice()
      throws IoTDBConnectionException, StatementExecutionException {
    System.out.println("-------fastLastQuery------");
    List<String> paths = new ArrayList<>();
    paths.add("s1");
    paths.add("s2");
    paths.add("s3");
    try (SessionDataSet sessionDataSet =
        sessionEnableRedirect.executeLastDataQueryForOneDevice(
            ROOT_SG1, ROOT_SG1_D1, paths, true)) {
      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