From a56474b47965f65561a90c10befd47b3c6d5f096 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Fri, 22 Nov 2024 15:01:39 +0800 Subject: [PATCH] modify example --- .../tsfile/v4/ITsFileReaderAndITsFileWriter.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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");