[ 
https://issues.apache.org/jira/browse/IOTDB-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

EJTTianyu closed IOTDB-156.
---------------------------
    Fix Version/s: 0.9.0
       Resolution: Fixed

function has been merged into master

> add -e option for iotdb client
> ------------------------------
>
>                 Key: IOTDB-156
>                 URL: https://issues.apache.org/jira/browse/IOTDB-156
>             Project: Apache IoTDB
>          Issue Type: Improvement
>            Reporter: EJTTianyu
>            Priority: Major
>             Fix For: 0.9.0
>
>         Attachments: image-2019-07-27-15-47-12-045.png
>
>
> We added the -e parameter to the start-client.sh script. By using the -e 
> parameter, we can operate IoTDB in the shell without entering the client's 
> input mode. Take following as an example:
> Suppose we want to create a storage group root.demo to a newly launched 
> IoTDB, create a timeseries root.demo.s1 and insert three data points into it. 
> With -e parameter, we could write a shell like this:
> {code:java}
> # !/bin/bash
> host=127.0.0.1
> port=6667
> user=root
> pass=root
> ./start-client.sh -h ${host} -p ${port} -u ${user} -pw ${pass} -e "set 
> storage group to root.demo"
> ./start-client.sh -h ${host} -p ${port} -u ${user} -pw ${pass} -e "create 
> timeseries root.demo.s1 WITH DATATYPE=INT32, ENCODING=RLE"
> ./start-client.sh -h ${host} -p ${port} -u ${user} -pw ${pass} -e "insert 
> into root.demo(timestamp,s1) values(1,10)"
> ./start-client.sh -h ${host} -p ${port} -u ${user} -pw ${pass} -e "insert 
> into root.demo(timestamp,s1) values(2,11)"
> ./start-client.sh -h ${host} -p ${port} -u ${user} -pw ${pass} -e "insert 
> into root.demo(timestamp,s1) values(3,12)"
> ./start-client.sh -h ${host} -p ${port} -u ${user} -pw ${pass} -e "select s1 
> from root.demo"
> {code}
> The print results are shown in the figure, which are consistent with the 
> client and jdbc operations.
> !image-2019-07-27-15-47-12-045.png!
> It should be noted that the use of the -e parameter in shell scripts requires 
> attention to the escaping of special characters. In order to avoid confusion 
> between statements and other parameters, the current situation only supports 
> the -e parameter as the last parameter.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to