TsFile can help you export the result set in the format of TsFile file to the specified path by executing the sql, command line sql, and sql file.
# Unix/OS X > tools/export-tsfile.sh -h <ip> -p <port> -u <username> -pw <password> -td <directory> [-f <export filename> -q <query command> -s <sql file>] # Windows > tools\export-tsfile.bat -h <ip> -p <port> -u <username> -pw <password> -td <directory> [-f <export filename> -q <query command> -s <sql file>]
-h <host>:-p <port>:-u <username>:-pw <password>:-td <directory>:-f <tsfile name>:-q <query command>:select * from root.** limit 100-s <sql file>:In addition, if you do not use the -s and -q parameters, after the export script is started, you need to enter the query statement as prompted by the program, and different query results will be saved to different TsFile files.
# Unix/OS X > tools/export-tsfile.sh -h 127.0.0.1 -p 6667 -u root -pw root -td ./ # or > tools/export-tsfile.sh -h 127.0.0.1 -p 6667 -u root -pw root -td ./ -q "select * from root.**" # Or > tools/export-tsfile.sh -h 127.0.0.1 -p 6667 -u root -pw root -td ./ -s ./sql.txt # Or > tools/export-tsfile.sh -h 127.0.0.1 -p 6667 -u root -pw root -td ./ -s ./sql.txt -f myTsFile # Windows > tools/export-tsfile.bat -h 127.0.0.1 -p 6667 -u root -pw root -td ./ # Or > tools/export-tsfile.bat -h 127.0.0.1 -p 6667 -u root -pw root -td ./ -q "select * from root.**" # Or > tools/export-tsfile.bat -h 127.0.0.1 -p 6667 -u root -pw root -td ./ -s ./sql.txt # Or > tools/export-tsfile.bat -h 127.0.0.1 -p 6667 -u root -pw root -td ./ -s ./sql.txt -f myTsFile