TsFile Sketch Tool

TsFile sketch tool is used to print the content of a TsFile in sketch mode. The location is tools/tsfile/print-tsfile.

Usage

  • For Windows:
  1. .\print-tsfile-sketch.bat <TsFile path> (<storage path of the output sketch file>)
  • For Linux or MacOs:
  1. ./print-tsfile-sketch.sh <TsFile path> (<storage path of the output sketch file>)

Note: if the storage path of the output sketch file is not set, the default relative path “TsFile_sketch_view.txt” will be used.

Example

Use Windows in this example:

  1. .\print-tsfile.bat D:\github\master\1669359533965-1-0-0.tsfile D:\github\master\sketch.txt
  2. ````````````````````````
  3. Starting Printing the TsFile Sketch
  4. ````````````````````````
  5. TsFile path:D:\github\master\1669359533965-1-0-0.tsfile
  6. Sketch save path:D:\github\master\sketch.txt
  7. 148 [main] WARN o.a.i.t.c.conf.TSFileDescriptor - not found iotdb-common.properties, use the default configs.
  8. -------------------------------- TsFile Sketch --------------------------------
  9. file path: D:\github\master\1669359533965-1-0-0.tsfile
  10. file length: 2974
  11. POSITION| CONTENT
  12. -------- -------
  13. 0| [magic head] TsFile
  14. 6| [version number] 3
  15. ||||||||||||||||||||| [Chunk Group] of root.sg1.d1, num of Chunks:3
  16. 7| [Chunk Group Header]
  17. | [marker] 0
  18. | [deviceID] root.sg1.d1
  19. 20| [Chunk] of root.sg1.d1.s1, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-9032452783138882770,maxValue:9117677033041335123,firstValue:7068645577795875906,lastValue:-5833792328174747265,sumValue:5.795959009889246E19]
  20. | [chunk header] marker=5, measurementID=s1, dataSize=864, dataType=INT64, compressionType=SNAPPY, encodingType=RLE
  21. | [page] UncompressedSize:862, CompressedSize:860
  22. 893| [Chunk] of root.sg1.d1.s2, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-8806861312244965718,maxValue:9192550740609853234,firstValue:1150295375739457693,lastValue:-2839553973758938646,sumValue:8.2822564314572677E18]
  23. | [chunk header] marker=5, measurementID=s2, dataSize=864, dataType=INT64, compressionType=SNAPPY, encodingType=RLE
  24. | [page] UncompressedSize:862, CompressedSize:860
  25. 1766| [Chunk] of root.sg1.d1.s3, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-9076669333460323191,maxValue:9175278522960949594,firstValue:2537897870994797700,lastValue:7194625271253769397,sumValue:-2.126008424849926E19]
  26. | [chunk header] marker=5, measurementID=s3, dataSize=864, dataType=INT64, compressionType=SNAPPY, encodingType=RLE
  27. | [page] UncompressedSize:862, CompressedSize:860
  28. ||||||||||||||||||||| [Chunk Group] of root.sg1.d1 ends
  29. 2656| [marker] 2
  30. 2657| [TimeseriesIndex] of root.sg1.d1.s1, tsDataType:INT64, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-9032452783138882770,maxValue:9117677033041335123,firstValue:7068645577795875906,lastValue:-5833792328174747265,sumValue:5.795959009889246E19]
  31. | [ChunkIndex] offset=20
  32. 2728| [TimeseriesIndex] of root.sg1.d1.s2, tsDataType:INT64, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-8806861312244965718,maxValue:9192550740609853234,firstValue:1150295375739457693,lastValue:-2839553973758938646,sumValue:8.2822564314572677E18]
  33. | [ChunkIndex] offset=893
  34. 2799| [TimeseriesIndex] of root.sg1.d1.s3, tsDataType:INT64, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-9076669333460323191,maxValue:9175278522960949594,firstValue:2537897870994797700,lastValue:7194625271253769397,sumValue:-2.126008424849926E19]
  35. | [ChunkIndex] offset=1766
  36. 2870| [IndexOfTimerseriesIndex Node] type=LEAF_MEASUREMENT
  37. | <s1, 2657>
  38. | <endOffset, 2870>
  39. ||||||||||||||||||||| [TsFileMetadata] begins
  40. 2891| [IndexOfTimerseriesIndex Node] type=LEAF_DEVICE
  41. | <root.sg1.d1, 2870>
  42. | <endOffset, 2891>
  43. | [meta offset] 2656
  44. | [bloom filter] bit vector byte array length=31, filterSize=256, hashFunctionSize=5
  45. ||||||||||||||||||||| [TsFileMetadata] ends
  46. 2964| [TsFileMetadataSize] 73
  47. 2968| [magic tail] TsFile
  48. 2974| END of TsFile
  49. ---------------------------- IndexOfTimerseriesIndex Tree -----------------------------
  50. [MetadataIndex:LEAF_DEVICE]
  51. └──────[root.sg1.d1,2870]
  52. [MetadataIndex:LEAF_MEASUREMENT]
  53. └──────[s1,2657]
  54. ---------------------------------- TsFile Sketch End ----------------------------------

Explanations:

  • Separated by “|”, the left is the actual position in the TsFile, and the right is the summary content.
  • “||||||||||||||||||||” is the guide information added to enhance readability, not the actual data stored in TsFile.
  • The last printed “IndexOfTimerseriesIndex Tree” is a reorganization of the metadata index tree at the end of the TsFile, which is convenient for intuitive understanding, and again not the actual data stored in TsFile.