diff --git a/java/examples/src/main/java/org/apache/tsfile/v4/ITsFileReaderAndITsFileWriter.java b/java/examples/src/main/java/org/apache/tsfile/v4/ITsFileReaderAndITsFileWriter.java index 22cd280bd..5f9e330e6 100644 --- a/java/examples/src/main/java/org/apache/tsfile/v4/ITsFileReaderAndITsFileWriter.java +++ b/java/examples/src/main/java/org/apache/tsfile/v4/ITsFileReaderAndITsFileWriter.java @@ -126,13 +126,12 @@ public static void main(String[] args) throws IOException { // first column is Time ResultSetMetadata metadata = resultSet.getMetadata(); System.out.println(metadata); + StringJoiner sj = new StringJoiner(" "); + for (int column = 1; column <= 5; column++) { + sj.add(metadata.getColumnName(column) + "(" + metadata.getColumnType(column) + ") "); + } + System.out.println(sj.toString()); while (resultSet.next()) { - StringJoiner sj = new StringJoiner(" "); - for (int column = 1; column <= 5; column++) { - sj.add(metadata.getColumnName(column) + "(" + metadata.getColumnType(column) + ") "); - } - System.out.println(sj.toString()); - // columnIndex starts from 1 // Time id1 id2 s1 s2 Long timeField = resultSet.getLong("Time");