文章目录
单机版(试用)
下载地址
https://iotdb.apache.org/Download/
安装环境
安装JDK
安装前需要保证设备上配有 JDK>=1.8 的运行环境,并配置好 JAVA_HOME 环境变量。
设置最大文件打开数为 65535
-
编辑 /etc/security/limits.conf 文件:
打开终端,使用文本编辑器编辑
/etc/security/limits.conf
文件。你可以使用vim
、nano
或其他你喜欢的编辑器。sudo nano /etc/security/limits.conf
-
添加以下行到文件末尾:
在文件的末尾添加以下行:
* soft nofile 65535 * hard nofile 65535
这将设置所有用户的软限制和硬限制都为65535。
-
编辑 /etc/security/limits.d/20-nproc.conf 文件(如果存在):
sudo nano /etc/security/limits.d/20-nproc.conf
如果该文件存在,请注释掉或删除以下行:
* soft nproc 4096
注释的方式是在行首添加
#
。 -
编辑 /etc/sysctl.conf 文件:
sudo nano /etc/sysctl.conf
在文件末尾添加以下行:
fs.file-max = 65535
保存并关闭文件。
-
执行 sysctl 命令使更改生效:
sudo sysctl -p
这会重新加载 sysctl.conf 文件以应用更改。
安装服务
解压
unzip apache-iotdb-1.2.2-all-bin.zip
进入目录
cd apache-iotdb-1.2.2-all-bin
目录结构如下
- sbin 启动和停止脚本目录
- conf 配置文件目录
- tools 系统工具目录
- lib 依赖包目录
启动 IoTDB
IoTDB 是一个基于分布式系统的数据库。要启动 IoTDB ,你可以先启动单机版(一个 ConfigNode 和一个 DataNode)来检查安装。
用户可以使用 sbin 文件夹下的 start-standalone 脚本启动 IoTDB。
bash sbin/start-standalone.sh
注意:目前,要使用单机模式,你需要保证所有的地址设置为 127.0.0.1,如果需要从非 IoTDB 所在的机器访问此IoTDB,请将配置项 dn_rpc_address
修改为 IoTDB 所在的机器 IP。副本数设置为1。并且,推荐使用 SimpleConsensus,因为这会带来额外的效率。这些现在都是默认配置。
使用 Cli 工具
IoTDB 为用户提供多种与服务器交互的方式,在此我们介绍使用 Cli 工具进行写入、查询数据的基本步骤。
初始安装后的 IoTDB 中有一个默认用户:root,默认密码为 root。用户可以使用该用户运行 Cli 工具操作 IoTDB。Cli 工具启动脚本为 sbin 文件夹下的 start-cli 脚本。启动脚本时需要指定运行 ip、port、username 和 password。若脚本未给定对应参数,则默认参数为-h 127.0.0.1 -p 6667 -u root -pw -root
以下启动语句为服务器在本机运行,且用户未更改运行端口号的示例。
bash sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
启动后出现如图提示即为启动成功。
---------------------
Starting IoTDB Cli
---------------------
_____ _________ ______ ______
|_ _| | _ _ ||_ _ `.|_ _ \
| | .--.|_/ | | \_| | | `. \ | |_) |
| | / .'`\ \ | | | | | | | __'.
_| |_| \__. | _| |_ _| |_.' /_| |__) |
|_____|'.__.' |_____| |______.'|_______/ version 1.2.2 (Build: 5d0bfb0)
Successfully login at 127.0.0.1:6667
IoTDB>
IoTDB 的基本操作
在这里,我们首先介绍一下使用 Cli 工具创建时间序列、插入数据并查看数据的方法。
数据在 IoTDB 中的组织形式是以时间序列为单位,每一个时间序列中有若干个数据-时间点对,每一个时间序列属于一个 database。在定义时间序列之前,要首先使用 CREATE DATABASE 语句创建数据库。SQL 语句如下:
创建数据库
CREATE DATABASE root.ln
查看所有数据库
SHOW DATABASES
创建时间序列
Database 设定后,使用 CREATE TIMESERIES 语句可以创建新的时间序列,创建时间序列时需要定义数据的类型和编码方式。此处我们创建两个时间序列,SQL 语句如下:
IoTDB> CREATE TIMESERIES root.ln.wf01.wt01.status WITH DATATYPE=BOOLEAN, ENCODING=PLAIN
IoTDB> CREATE TIMESERIES root.ln.wf01.wt01.temperature WITH DATATYPE=FLOAT, ENCODING=RLE
为了查看指定的时间序列,我们可以使用 SHOW TIMESERIES
使用 SHOW TIMESERIES 语句查看系统中存在的所有时间序列,SQL 语句如下:
IoTDB> SHOW TIMESERIES
+-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
| Timeseries|Alias|Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType|
+-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
|root.ln.wf01.wt01.temperature| null| root.ln| FLOAT| RLE| LZ4|null| null| null| null| BASE|
| root.ln.wf01.wt01.status| null| root.ln| BOOLEAN| PLAIN| LZ4|null| null| null| null| BASE|
+-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
Total line number = 2
It costs 0.569s
查看具体的时间序列 root.ln.wf01.wt01.status 的 SQL 语句如下:
IoTDB> SHOW TIMESERIES root.ln.wf01.wt01.status
+------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
| Timeseries|Alias|Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType|
+------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
|root.ln.wf01.wt01.status| null| root.ln| BOOLEAN| PLAIN| LZ4|null| null| null| null| BASE|
+------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
Total line number = 1
It costs 0.093s
插入时间序列数据
接下来,我们使用 INSERT 语句向 root.ln.wf01.wt01.status 时间序列中插入数据,在插入数据时需要首先指定时间戳和路径后缀名称:
INSERT INTO root.ln.wf01.wt01(timestamp,status) values(100,true);
我们也可以向多个时间序列中同时插入数据,这些时间序列同属于一个时间戳:
INSERT INTO root.ln.wf01.wt01(timestamp,status,temperature) values(200,false,20.71)
查询数据
最后,我们查询之前插入的数据。使用 SELECT 语句我们可以查询指定的时间序列的数据结果,SQL 语句如下:
SELECT status FROM root.ln.wf01.wt01
查询结果如下:
IoTDB> SELECT status FROM root.ln.wf01.wt01
+-----------------------------+------------------------+
| Time|root.ln.wf01.wt01.status|
+-----------------------------+------------------------+
|1970-01-01T08:00:00.100+08:00| true|
|1970-01-01T08:00:00.200+08:00| false|
+-----------------------------+------------------------+
Total line number = 2
It costs 0.378s
我们也可以查询多个时间序列的数据结果,SQL 语句如下:
SELECT * FROM root.ln.wf01.wt01
查询结果如下:
IoTDB> SELECT * FROM root.ln.wf01.wt01
+-----------------------------+-----------------------------+------------------------+
| Time|root.ln.wf01.wt01.temperature|root.ln.wf01.wt01.status|
+-----------------------------+-----------------------------+------------------------+
|1970-01-01T08:00:00.100+08:00| null| true|
|1970-01-01T08:00:00.200+08:00| 20.71| false|
+-----------------------------+-----------------------------+------------------------+
Total line number = 2
It costs 0.213s
退出会话
输入 quit 或 exit 可退出 Cli 结束本次会话。
IoTDB> quit
或者
IoTDB> exit
停止 IoTDB
用户可以使用$IOTDB_HOME/sbin 文件夹下的 stop-standalone 脚本停止 IoTDB。
Linux 系统与 MacOS 系统停止命令如下:
> sudo bash sbin/stop-standalone.sh
创建元数据模板
create schema template test1127 (a FLOAT encoding=RLE, b BOOLEAN encoding=PLAIN compression=SNAPPY,c INT32 encoding=PLAIN compression=SNAPPY,d TEXT encoding=PLAIN compression=SNAPPY)
create schema template test1128 (msgSequence TEXT enconding=PLAIN compression=SNAPPY,vehicleModel TEXT enconding=PLAIN compression=SNAPPY,dt TEXT enconding=PLAIN compression=SNAPPY,terminalTime INT64 enconding=PLAIN compression=SNAPPY,vin TEXT enconding=PLAIN compression=SNAPPY,gpsSts INT32 enconding=PLAIN compression=SNAPPY,gpsLongitude DOUBLE enconding=PLAIN compression=SNAPPY,gpsLatitude DOUBLE enconding=PLAIN compression=SNAPPY,gpsDirection DOUBLE enconding=PLAIN compression=SNAPPY,gpsSpeed DOUBLE enconding=PLAIN compression=SNAPPY,gpsAltitude DOUBLE enconding=PLAIN compression=SNAPPY,effectiveSatelliteCount INT32 enconding=PLAIN compression=SNAPPY,totalOdometerKm DOUBLE enconding=PLAIN compression=SNAPPY,averageFuelConsumption DOUBLE enconding=PLAIN compression=SNAPPY,vehicleSpeed DOUBLE enconding=PLAIN compression=SNAPPY,actualGear INT32 enconding=PLAIN compression=SNAPPY,lhfTirePressureBar DOUBLE enconding=PLAIN compression=SNAPPY,rhfTirePressureBar DOUBLE enconding=PLAIN compression=SNAPPY,lhrTirePressureBar DOUBLE enconding=PLAIN compression=SNAPPY,rhrTirePressureBar DOUBLE enconding=PLAIN compression=SNAPPY,tirePositionWarnLhfTire INT32 enconding=PLAIN compression=SNAPPY,tirePositionWarnRhfTire INT32 enconding=PLAIN compression=SNAPPY,tirePositionWarnLhrTire INT32 enconding=PLAIN compression=SNAPPY,tirePositionWarnRhrTire INT32 enconding=PLAIN compression=SNAPPY,tirePressureWarnLampSts INT32 enconding=PLAIN compression=SNAPPY,tirePressureSysFailSts INT32 enconding=PLAIN compression=SNAPPY,driverDoorSts INT32 enconding=PLAIN compression=SNAPPY,psngrDoorSts INT32 enconding=PLAIN compression=SNAPPY,lhrDoorSts INT32 enconding=PLAIN compression=SNAPPY,rhrDoorSts INT32 enconding=PLAIN compression=SNAPPY,trunkDoorSts INT32 enconding=PLAIN compression=SNAPPY,trunkLockSts INT32 enconding=PLAIN compression=SNAPPY,driverDoorLockSts INT32 enconding=PLAIN compression=SNAPPY,hoodSts INT32 enconding=PLAIN compression=SNAPPY,fuelLevel DOUBLE enconding=PLAIN compression=SNAPPY,iemSts INT32 enconding=PLAIN compression=SNAPPY,airConditionWorkingSts INT32 enconding=PLAIN compression=SNAPPY,engineSts INT32 enconding=PLAIN compression=SNAPPY,fireTime DATETIME-INPUT enconding=PLAIN compression=SNAPPY,crashOutputSts INT32 enconding=PLAIN compression=SNAPPY,epcSts INT32 enconding=PLAIN compression=SNAPPY,milSts INT32 enconding=PLAIN compression=SNAPPY,epbErrSts INT32 enconding=PLAIN compression=SNAPPY,ebdFailSts INT32 enconding=PLAIN compression=SNAPPY,absFailSts INT32 enconding=PLAIN compression=SNAPPY,vdcFailSts INT32 enconding=PLAIN compression=SNAPPY,airBagFailSts INT32 enconding=PLAIN compression=SNAPPY,tirePressureSysFaultTip INT32 enconding=PLAIN compression=SNAPPY,tcuGGbFaultSts INT32 enconding=PLAIN compression=SNAPPY,epsFailSts INT32 enconding=PLAIN compression=SNAPPY,engineCoolantTempHighWarn INT32 enconding=PLAIN compression=SNAPPY,engineOilPressureLowWarn INT32 enconding=PLAIN compression=SNAPPY,hdcFailSts INT32 enconding=PLAIN compression=SNAPPY,tirePressureSysLowTip INT32 enconding=PLAIN compression=SNAPPY,dcdcSysFault INT32 enconding=PLAIN compression=SNAPPY,brakeFluidWarn INT32 enconding=PLAIN compression=SNAPPY,brakeSysFailSts INT32 enconding=PLAIN compression=SNAPPY,isgfSysFault INT32 enconding=PLAIN compression=SNAPPY,bmshPackThermal INT32 enconding=PLAIN compression=SNAPPY,bmshBattFault INT32 enconding=PLAIN compression=SNAPPY,hcuChargeFault INT32 enconding=PLAIN compression=SNAPPY,bmshInsulationSts INT32 enconding=PLAIN compression=SNAPPY,vehicleReadyTime INT64 enconding=PLAIN compression=SNAPPY,hcuPsReady INT32 enconding=PLAIN compression=SNAPPY,icm9HevTotOdo DOUBLE enconding=PLAIN compression=SNAPPY,icm9EvTotOdo DOUBLE enconding=PLAIN compression=SNAPPY,parkingSpeed DOUBLE enconding=PLAIN compression=SNAPPY,steeringWheelAngle DOUBLE enconding=PLAIN compression=SNAPPY,steeringWheelSpeed1 DOUBLE enconding=PLAIN compression=SNAPPY,longitudinalAccelerationG DOUBLE enconding=PLAIN compression=SNAPPY,lateralAccelerationG DOUBLE enconding=PLAIN compression=SNAPPY,ldwSensitivityFeedback INT32 enconding=PLAIN compression=SNAPPY,ldwLaneDetectionSts INT32 enconding=PLAIN compression=SNAPPY,ldwElkTjaLdpVisuali INT32 enconding=PLAIN compression=SNAPPY,ldwWorkingSts INT32 enconding=PLAIN compression=SNAPPY,engineSpeed DOUBLE enconding=PLAIN compression=SNAPPY,engineCoolantTemp INT32 enconding=PLAIN compression=SNAPPY,oilTemp INT32 enconding=PLAIN compression=SNAPPY,cruiseControlStsForDisplay INT32 enconding=PLAIN compression=SNAPPY,stsSsms INT32 enconding=PLAIN compression=SNAPPY,stsAtws INT32 enconding=PLAIN compression=SNAPPY,stsTransportMode INT32 enconding=PLAIN compression=SNAPPY,stsBackgroundLight INT32 enconding=PLAIN compression=SNAPPY,parkLightSts INT32 enconding=PLAIN compression=SNAPPY,frontFogLightSts INT32 enconding=PLAIN compression=SNAPPY,rearFogLightSts INT32 enconding=PLAIN compression=SNAPPY,lowBeamSts INT32 enconding=PLAIN compression=SNAPPY,highBeamSts INT32 enconding=PLAIN compression=SNAPPY,drlSts INT32 enconding=PLAIN compression=SNAPPY,lhTurnLightSts INT32 enconding=PLAIN compression=SNAPPY,rhTurnLightSts INT32 enconding=PLAIN compression=SNAPPY,stsAutoMirrorHeating INT32 enconding=PLAIN compression=SNAPPY,rearDeforestMaxDisplaySts INT32 enconding=PLAIN compression=SNAPPY,frontDeforestMaxDisplaySts INT32 enconding=PLAIN compression=SNAPPY,stsInteriorAirInletMode INT32 enconding=PLAIN compression=SNAPPY,stsPm251 INT32 enconding=PLAIN compression=SNAPPY,pm25Sts INT32 enconding=PLAIN compression=SNAPPY,ambientTempSensed DOUBLE enconding=PLAIN compression=SNAPPY,ibsBatttemp DOUBLE enconding=PLAIN compression=SNAPPY,battVolt DOUBLE enconding=PLAIN compression=SNAPPY,battSoc DOUBLE enconding=PLAIN compression=SNAPPY,battSoh INT32 enconding=PLAIN compression=SNAPPY,battCriticalSts INT32 enconding=PLAIN compression=SNAPPY,loadShedLevel INT32 enconding=PLAIN compression=SNAPPY,tireTempFl DOUBLE enconding=PLAIN compression=SNAPPY,tireTempFr DOUBLE enconding=PLAIN compression=SNAPPY,tireTempRl DOUBLE enconding=PLAIN compression=SNAPPY,tireTempRr DOUBLE enconding=PLAIN compression=SNAPPY,stsRkeDoorNumber INT32 enconding=PLAIN compression=SNAPPY,driveMode INT32 enconding=PLAIN compression=SNAPPY,elecParkingSysSts INT32 enconding=PLAIN compression=SNAPPY,brakePressure INT32 enconding=PLAIN compression=SNAPPY,whlSpeedFl DOUBLE enconding=PLAIN compression=SNAPPY,whlSpeedFr DOUBLE enconding=PLAIN compression=SNAPPY,whlSpeedRl DOUBLE enconding=PLAIN compression=SNAPPY,whlSpeedRr DOUBLE enconding=PLAIN compression=SNAPPY,steeringWheelSpeed2 DOUBLE enconding=PLAIN compression=SNAPPY,stsSasCalibration INT32 enconding=PLAIN compression=SNAPPY,stsSasFailure INT32 enconding=PLAIN compression=SNAPPY,stsVehicleCrashed INT32 enconding=PLAIN compression=SNAPPY,stsCrashPos INT32 enconding=PLAIN compression=SNAPPY,driverSeatBeltSts DOUBLE enconding=PLAIN compression=SNAPPY,psngrSeatBeltSts INT32 enconding=PLAIN compression=SNAPPY,seatBeltRlSts INT32 enconding=PLAIN compression=SNAPPY,seatBeltRmSts INT32 enconding=PLAIN compression=SNAPPY,seatBeltRrSts INT32 enconding=PLAIN compression=SNAPPY,stsSeatOccPassenger INT32 enconding=PLAIN compression=SNAPPY,longitudinalAccelerationMs2 DOUBLE enconding=PLAIN compression=SNAPPY,lateralAccelerationMs2 DOUBLE enconding=PLAIN compression=SNAPPY,yawrate DOUBLE enconding=PLAIN compression=SNAPPY,fcwLatentwarn INT32 enconding=PLAIN compression=SNAPPY,fcwPrewarn INT32 enconding=PLAIN compression=SNAPPY,aebDecCtrlReq INT32 enconding=PLAIN compression=SNAPPY,ebaDecCtrlReq INT32 enconding=PLAIN compression=SNAPPY,awbReq INT32 enconding=PLAIN compression=SNAPPY,stsIhuTelematicCtrl INT32 enconding=PLAIN compression=SNAPPY,respTelematicAudioCtrl INT32 enconding=PLAIN compression=SNAPPY,averageSpeed DOUBLE enconding=PLAIN compression=SNAPPY,tripaOdometer DOUBLE enconding=PLAIN compression=SNAPPY,tripbOdometer DOUBLE enconding=PLAIN compression=SNAPPY,averageFuleConsumption DOUBLE enconding=PLAIN compression=SNAPPY,bitRefreshRateIpc INT64 enconding=PLAIN compression=SNAPPY,speedLimiterActivate INT32 enconding=PLAIN compression=SNAPPY,speedLimitValue DOUBLE enconding=PLAIN compression=SNAPPY,stsSia INT32 enconding=PLAIN compression=SNAPPY,siaLastTime INT64 enconding=PLAIN compression=SNAPPY,siaLastOdo DOUBLE enconding=PLAIN compression=SNAPPY,siaIntervalTime INT32 enconding=PLAIN compression=SNAPPY,siaIntervalDistance DOUBLE enconding=PLAIN compression=SNAPPY,pepsClutchSwitch INT32 enconding=PLAIN compression=SNAPPY,vehicleVolt DOUBLE enconding=PLAIN compression=SNAPPY,fobId INT32 enconding=PLAIN compression=SNAPPY,reqVehicleWakeup INT32 enconding=PLAIN compression=SNAPPY,stsObdRequest INT32 enconding=PLAIN compression=SNAPPY,digitalSpeed DOUBLE enconding=PLAIN compression=SNAPPY,stsFrontBlowerSpeed INT32 enconding=PLAIN compression=SNAPPY,stsSeatheatDriver INT32 enconding=PLAIN compression=SNAPPY,stsSeatheatPassenger INT32 enconding=PLAIN compression=SNAPPY,stsSeatheatL INT32 enconding=PLAIN compression=SNAPPY,stsSeatheatM INT32 enconding=PLAIN compression=SNAPPY,stsSeatheatR INT32 enconding=PLAIN compression=SNAPPY,stsSeatheatDriver2 INT32 enconding=PLAIN compression=SNAPPY,stsSeatheatPassenger2 INT32 enconding=PLAIN compression=SNAPPY,stsSeatheatDriver3 INT32 enconding=PLAIN compression=SNAPPY,stsSeatheatPassenger3 INT32 enconding=PLAIN compression=SNAPPY,stsWindowMovementFl INT32 enconding=PLAIN compression=SNAPPY,stsWindowMovementFr INT32 enconding=PLAIN compression=SNAPPY,stsWindowMovementRl INT32 enconding=PLAIN compression=SNAPPY,stsWindowMovementRr INT32 enconding=PLAIN compression=SNAPPY,stsSteeringHeat INT32 enconding=PLAIN compression=SNAPPY,acPressure DOUBLE enconding=PLAIN compression=SNAPPY,clmEacu DOUBLE enconding=PLAIN compression=SNAPPY,clmEaci DOUBLE enconding=PLAIN compression=SNAPPY,clmHvhu DOUBLE enconding=PLAIN compression=SNAPPY,clmHvhi DOUBLE enconding=PLAIN compression=SNAPPY,eacSecuCprElecFltSts INT32 enconding=PLAIN compression=SNAPPY,eacDefaultCprElecFltSts INT32 enconding=PLAIN compression=SNAPPY,eacAlimbtFltSts INT32 enconding=PLAIN compression=SNAPPY,eacTensionbtFltSts INT32 enconding=PLAIN compression=SNAPPY,eacProtectionFltSts INT32 enconding=PLAIN compression=SNAPPY,eacNonfonctPermFltSts INT32 enconding=PLAIN compression=SNAPPY,eacFonctIntemPestifFltSts INT32 enconding=PLAIN compression=SNAPPY,clmHvh2u DOUBLE enconding=PLAIN compression=SNAPPY,clmHvh2i DOUBLE enconding=PLAIN compression=SNAPPY,clmEacSpeed DOUBLE enconding=PLAIN compression=SNAPPY,clmEacIgbtTemp DOUBLE enconding=PLAIN compression=SNAPPY,clmChillerPressure DOUBLE enconding=PLAIN compression=SNAPPY,clmChillerTemp DOUBLE enconding=PLAIN compression=SNAPPY,clmHvh2Sts INT32 enconding=PLAIN compression=SNAPPY,clmSovSts INT32 enconding=PLAIN compression=SNAPPY,clmWv1Sts DOUBLE enconding=PLAIN compression=SNAPPY,clmWv2Sts DOUBLE enconding=PLAIN compression=SNAPPY,clmPump1Speed DOUBLE enconding=PLAIN compression=SNAPPY,clmPump2Speed DOUBLE enconding=PLAIN compression=SNAPPY,clmExvSts DOUBLE enconding=PLAIN compression=SNAPPY,clmHvh1LevelSts DOUBLE enconding=PLAIN compression=SNAPPY,clmHvh2LevelSts DOUBLE enconding=PLAIN compression=SNAPPY,clmHvh1OutTemp DOUBLE enconding=PLAIN compression=SNAPPY,clmHvh2OutTemp DOUBLE enconding=PLAIN compression=SNAPPY,clmEvpTemp DOUBLE enconding=PLAIN compression=SNAPPY,hcu4GAvgFuCns DOUBLE enconding=PLAIN compression=SNAPPY,hcu4GAvgElecCns DOUBLE enconding=PLAIN compression=SNAPPY,hcu4GAvgEnergyCns DOUBLE enconding=PLAIN compression=SNAPPY,hcu4GSumEgyCns DOUBLE enconding=PLAIN compression=SNAPPY,hcu4GEngRunFuCns DOUBLE enconding=PLAIN compression=SNAPPY,hcu3GSumFuCns DOUBLE enconding=PLAIN compression=SNAPPY,hcu3GSumElecCns DOUBLE enconding=PLAIN compression=SNAPPY,icm6SumTrip DOUBLE enconding=PLAIN compression=SNAPPY,tboxChargeAllow INT32 enconding=PLAIN compression=SNAPPY,lhfTirePressureKpa DOUBLE enconding=PLAIN compression=SNAPPY,rhfTirePressureKpa DOUBLE enconding=PLAIN compression=SNAPPY,lhrTirePressureKpa DOUBLE enconding=PLAIN compression=SNAPPY,rhrTirePressureKpa DOUBLE enconding=PLAIN compression=SNAPPY,vehicleSts INT32 enconding=PLAIN compression=SNAPPY,hcuChargeSts INT32 enconding=PLAIN compression=SNAPPY,hcuRunMode INT32 enconding=PLAIN compression=SNAPPY,bmshBattVolt DOUBLE enconding=PLAIN compression=SNAPPY,bmshBattCurr DOUBLE enconding=PLAIN compression=SNAPPY,bmshSocDisp DOUBLE enconding=PLAIN compression=SNAPPY,dcdcWorkingSts INT32 enconding=PLAIN compression=SNAPPY,brakePedalSts INT32 enconding=PLAIN compression=SNAPPY,driveValid INT32 enconding=PLAIN compression=SNAPPY,bmsInsulationResis DOUBLE enconding=PLAIN compression=SNAPPY,hcuGasPedalPosition DOUBLE enconding=PLAIN compression=SNAPPY,hcuBrakePedalsts DOUBLE enconding=PLAIN compression=SNAPPY,startTime DATETIME-INPUT enconding=PLAIN compression=SNAPPY,flameoutTime DATETIME-INPUT enconding=PLAIN compression=SNAPPY,dynamicSysReady INT32 enconding=PLAIN compression=SNAPPY,urgentPowerOffReq INT32 enconding=PLAIN compression=SNAPPY,soh DOUBLE enconding=PLAIN compression=SNAPPY,battEqActive INT32 enconding=PLAIN compression=SNAPPY,ems4GEngineSpeedActual DOUBLE enconding=PLAIN compression=SNAPPY,fuelConsumptionRate DOUBLE enconding=PLAIN compression=SNAPPY,stsPosLatitude INT32 enconding=PLAIN compression=SNAPPY,stsPosLongitude INT32 enconding=PLAIN compression=SNAPPY,bmsSysVoltMaxnum DOUBLE enconding=PLAIN compression=SNAPPY,bmsCellVoltMaxnum DOUBLE enconding=PLAIN compression=SNAPPY,bmsCellVoltMax DOUBLE enconding=PLAIN compression=SNAPPY,bmsSysVoltMinnum DOUBLE enconding=PLAIN compression=SNAPPY,bmsCellVoltMinnum DOUBLE enconding=PLAIN compression=SNAPPY,bmsCellVoltMin DOUBLE enconding=PLAIN compression=SNAPPY,bmsSysTempMaxnum DOUBLE enconding=PLAIN compression=SNAPPY,bmsSensorTempMaxnum DOUBLE enconding=PLAIN compression=SNAPPY,bmsSensorMaxtemp DOUBLE enconding=PLAIN compression=SNAPPY,bmsSysTempMinnum DOUBLE enconding=PLAIN compression=SNAPPY,bmsSensorTempMinnum DOUBLE enconding=PLAIN compression=SNAPPY,bmsSensorMintemp DOUBLE enconding=PLAIN compression=SNAPPY,bmshFaultLevel INT32 enconding=PLAIN compression=SNAPPY,bmshTempUniformity INT32 enconding=PLAIN compression=SNAPPY,bmshOverTemp INT32 enconding=PLAIN compression=SNAPPY,bmshBattOverVolt INT32 enconding=PLAIN compression=SNAPPY,bmshBattUnderVolt INT32 enconding=PLAIN compression=SNAPPY,bmshLowSoc INT32 enconding=PLAIN compression=SNAPPY,bmshCellOverVol INT32 enconding=PLAIN compression=SNAPPY,bmshCellUnderVol INT32 enconding=PLAIN compression=SNAPPY,bmshOverSoc INT32 enconding=PLAIN compression=SNAPPY,bmshSocJump INT32 enconding=PLAIN compression=SNAPPY,bmshBattMismatching INT32 enconding=PLAIN compression=SNAPPY,bmshBattUniformity INT32 enconding=PLAIN compression=SNAPPY,bmshIsocircuitFailure INT32 enconding=PLAIN compression=SNAPPY,dcdcOverTemp INT32 enconding=PLAIN compression=SNAPPY,brakeSysWarn INT32 enconding=PLAIN compression=SNAPPY,dcdcFaultLevelSts INT32 enconding=PLAIN compression=SNAPPY,isgfInvTempOvrErr INT32 enconding=PLAIN compression=SNAPPY,bmshHviLcuitFailure INT32 enconding=PLAIN compression=SNAPPY,isgfMotTempOvrerr INT32 enconding=PLAIN compression=SNAPPY,bmshChargeOver INT32 enconding=PLAIN compression=SNAPPY,motorDriveSysFault INT32 enconding=PLAIN compression=SNAPPY,battVoltWarn INT32 enconding=PLAIN compression=SNAPPY,battCellMaxTempWarn INT32 enconding=PLAIN compression=SNAPPY,battCellMinTempWarn INT32 enconding=PLAIN compression=SNAPPY,collisionSignalWarn INT32 enconding=PLAIN compression=SNAPPY,energyStorageSysFault INT32 enconding=PLAIN compression=SNAPPY,rechargeableDeviceFaultCodes TEXT enconding=PLAIN compression=SNAPPY,driveMotorFaultCodes TEXT enconding=PLAIN compression=SNAPPY,engineFaultCodes TEXT enconding=PLAIN compression=SNAPPY,otherFaultCodes TEXT enconding=PLAIN compression=SNAPPY,rechargeableDeviceVoltDatas TEXT enconding=PLAIN compression=SNAPPY,rechargeableDeviceTempDatas TEXT enconding=PLAIN compression=SNAPPY,retroactiveDatas INT32 enconding=PLAIN compression=SNAPPY,fuelCellVolt DOUBLE enconding=PLAIN compression=SNAPPY,fuelCellCurr DOUBLE enconding=PLAIN compression=SNAPPY,allProbeTempArr TEXT enconding=PLAIN compression=SNAPPY,hydrogenSysMaxTemp DOUBLE enconding=PLAIN compression=SNAPPY,hydrogenSysMaxTempProbe INT32 enconding=PLAIN compression=SNAPPY,hydrogenMaxPotency DOUBLE enconding=PLAIN compression=SNAPPY,hydrogenMaxPotencySensor INT32 enconding=PLAIN compression=SNAPPY,hydrogenMaxPressure DOUBLE enconding=PLAIN compression=SNAPPY,hydrogenMaxPressureSensor INT32 enconding=PLAIN compression=SNAPPY,stsHighPressureDc INT32 enconding=PLAIN compression=SNAPPY,instantPowerConsumption DOUBLE enconding=PLAIN compression=SNAPPY,powerConsumption100km DOUBLE enconding=PLAIN compression=SNAPPY,battCapacity DOUBLE enconding=PLAIN compression=SNAPPY,bmshLeftChargeTime DOUBLE enconding=PLAIN compression=SNAPPY,bmshPackChargThermalSt INT32 enconding=PLAIN compression=SNAPPY,hcuIntelligentPowerSupply INT32 enconding=PLAIN compression=SNAPPY,lowFuleWarn INT32 enconding=PLAIN compression=SNAPPY,maintainWarn INT32 enconding=PLAIN compression=SNAPPY,gaspedalPositionInvalidData INT32 enconding=PLAIN compression=SNAPPY,hcuBrakePedalSts INT32 enconding=PLAIN compression=SNAPPY,brakePedalStsValid INT32 enconding=PLAIN compression=SNAPPY,bcm4KeySts INT32 enconding=PLAIN compression=SNAPPY,autoDisplaySts INT32 enconding=PLAIN compression=SNAPPY,blowSpeedLevelDisplaySts INT32 enconding=PLAIN compression=SNAPPY,acRequestDisplaySts INT32 enconding=PLAIN compression=SNAPPY,modeAdjustDisplaySts INT32 enconding=PLAIN compression=SNAPPY,setTempLC DOUBLE enconding=PLAIN compression=SNAPPY,setTempRC DOUBLE enconding=PLAIN compression=SNAPPY,circulationModeDisplaySts INT32 enconding=PLAIN compression=SNAPPY,coolHeatDamper INT32 enconding=PLAIN compression=SNAPPY,plgPositionSts DOUBLE enconding=PLAIN compression=SNAPPY,plgOperateSts INT32 enconding=PLAIN compression=SNAPPY,residualOdometer DOUBLE enconding=PLAIN compression=SNAPPY,srfOperateSts INT32 enconding=PLAIN compression=SNAPPY,srfPositionSts INT32 enconding=PLAIN compression=SNAPPY,windowOperateSts INT32 enconding=PLAIN compression=SNAPPY,fdwindowStsFl INT32 enconding=PLAIN compression=SNAPPY,fpwindowStsFr INT32 enconding=PLAIN compression=SNAPPY,rlwindowStsRl INT32 enconding=PLAIN compression=SNAPPY,rrwindowStsRr INT32 enconding=PLAIN compression=SNAPPY,gasPedalposition DOUBLE enconding=PLAIN compression=SNAPPY,tboxRvsReq INT32 enconding=PLAIN compression=SNAPPY,obdDiagnosisReqInd INT32 enconding=PLAIN compression=SNAPPY,stsEngineWaterTempFailure INT32 enconding=PLAIN compression=SNAPPY,steeringWheelPositionValid INT32 enconding=PLAIN compression=SNAPPY,steeringWheelSpeedValid INT32 enconding=PLAIN compression=SNAPPY,longitudinalAccelerationSigValid INT32 enconding=PLAIN compression=SNAPPY,lateralAccelerationSigValidData INT32 enconding=PLAIN compression=SNAPPY,psngrSeatBeltWarn INT32 enconding=PLAIN compression=SNAPPY,remoteStartFailureCode INT32 enconding=PLAIN compression=SNAPPY,obcCcConnectSts INT32 enconding=PLAIN compression=SNAPPY,speedAlarm INT32 enconding=PLAIN compression=SNAPPY,bcm4ArmingSts INT32 enconding=PLAIN compression=SNAPPY,bcm4AntiTheftAlarmSts INT32 enconding=PLAIN compression=SNAPPY,pm25stsFeedback INT32 enconding=PLAIN compression=SNAPPY,plgPinchEvent INT32 enconding=PLAIN compression=SNAPPY,plgEcuFailSts INT32 enconding=PLAIN compression=SNAPPY,pm25Ext DOUBLE enconding=PLAIN compression=SNAPPY,pm25ExtSts INT32 enconding=PLAIN compression=SNAPPY,pm25IncarSts INT32 enconding=PLAIN compression=SNAPPY,pm25OutcarLevel INT32 enconding=PLAIN compression=SNAPPY,pm25IncarLevel INT32 enconding=PLAIN compression=SNAPPY,aqsLevel INT32 enconding=PLAIN compression=SNAPPY,srfInitSts INT32 enconding=PLAIN compression=SNAPPY,engineCoolantTempFailSts INT32 enconding=PLAIN compression=SNAPPY,steeringAngleValid INT32 enconding=PLAIN compression=SNAPPY,steeringAngleSpeedValid INT32 enconding=PLAIN compression=SNAPPY,speedValidSingal INT32 enconding=PLAIN compression=SNAPPY,stsControllerNetWakeup TEXT enconding=PLAIN compression=SNAPPY,stsControllerNetKeep TEXT enconding=PLAIN compression=SNAPPY,hcuRangeAval DOUBLE enconding=PLAIN compression=SNAPPY,storageBattVolt DOUBLE enconding=PLAIN compression=SNAPPY,ibsCurr DOUBLE enconding=PLAIN compression=SNAPPY,battTemp DOUBLE enconding=PLAIN compression=SNAPPY,ibsStartVolt DOUBLE enconding=PLAIN compression=SNAPPY,storageBattSoc DOUBLE enconding=PLAIN compression=SNAPPY,ibsBattTemp DOUBLE enconding=PLAIN compression=SNAPPY,storageBattStsSoh DOUBLE enconding=PLAIN compression=SNAPPY,stsSeatVentDriver INT32 enconding=PLAIN compression=SNAPPY,stsSeatVentPassenger INT32 enconding=PLAIN compression=SNAPPY,stsSeatVentL INT32 enconding=PLAIN compression=SNAPPY,stsSeatVentM INT32 enconding=PLAIN compression=SNAPPY,stsSeatVentR INT32 enconding=PLAIN compression=SNAPPY,stsSeatVentDriver2 INT32 enconding=PLAIN compression=SNAPPY,stsSeatVentPassenger2 INT32 enconding=PLAIN compression=SNAPPY,lbaTip INT32 enconding=PLAIN compression=SNAPPY,lbaLimits INT32 enconding=PLAIN compression=SNAPPY,ibsCurrRange INT32 enconding=PLAIN compression=SNAPPY,ibsStsSoc INT32 enconding=PLAIN compression=SNAPPY,storageBattHealthSoh DOUBLE enconding=PLAIN compression=SNAPPY,ibsSofV1 DOUBLE enconding=PLAIN compression=SNAPPY,engineTorqueLoss DOUBLE enconding=PLAIN compression=SNAPPY,meanEffectiveTorque DOUBLE enconding=PLAIN compression=SNAPPY,icm1HandBrakeSysSts INT32 enconding=PLAIN compression=SNAPPY,externalTempC DOUBLE enconding=PLAIN compression=SNAPPY,externalTempF DOUBLE enconding=PLAIN compression=SNAPPY,externalTempFailSts INT32 enconding=PLAIN compression=SNAPPY,fatigureDrivingWaring INT32 enconding=PLAIN compression=SNAPPY,absActive INT32 enconding=PLAIN compression=SNAPPY,rlcr1BsdWarn INT32 enconding=PLAIN compression=SNAPPY,rrcr1BsdWarn INT32 enconding=PLAIN compression=SNAPPY,apaActive INT32 enconding=PLAIN compression=SNAPPY,fcmFrm6AccMode INT32 enconding=PLAIN compression=SNAPPY,fcmFrm6AebMode INT32 enconding=PLAIN compression=SNAPPY,maintainTip INT32 enconding=PLAIN compression=SNAPPY,hcuHvReady INT32 enconding=PLAIN compression=SNAPPY,controllerSts TEXT enconding=PLAIN compression=SNAPPY,ipbPlungerPressureValidData INT32 enconding=PLAIN compression=SNAPPY,ipbInputRodStrokeSts DOUBLE enconding=PLAIN compression=SNAPPY,bmshObcChargeReq INT32 enconding=PLAIN compression=SNAPPY,obcCpDutyCycleValue INT32 enconding=PLAIN compression=SNAPPY,obcWorkingMode INT32 enconding=PLAIN compression=SNAPPY,dcdcLvSideVolt DOUBLE enconding=PLAIN compression=SNAPPY,dcdcLvSideCurr DOUBLE enconding=PLAIN compression=SNAPPY,transErrLvl INT32 enconding=PLAIN compression=SNAPPY,phevShiftInProgress INT32 enconding=PLAIN compression=SNAPPY,em2IntvMode INT32 enconding=PLAIN compression=SNAPPY,em2SpdReq DOUBLE enconding=PLAIN compression=SNAPPY,transInpIntvMode INT32 enconding=PLAIN compression=SNAPPY,c1ActStse INT32 enconding=PLAIN compression=SNAPPY,c3ActStse INT32 enconding=PLAIN compression=SNAPPY,transInpActualGear INT32 enconding=PLAIN compression=SNAPPY,em2ActualGear INT32 enconding=PLAIN compression=SNAPPY,em2TrqReq DOUBLE enconding=PLAIN compression=SNAPPY,em2AvlGearEdrv INT32 enconding=PLAIN compression=SNAPPY,tcuGGbWarmUpReq INT32 enconding=PLAIN compression=SNAPPY,transInpAvlGearHyb INT32 enconding=PLAIN compression=SNAPPY,traParkLockSts INT32 enconding=PLAIN compression=SNAPPY,tcu17SynPosn DOUBLE enconding=PLAIN compression=SNAPPY,tcu18Fault1 DOUBLE enconding=PLAIN compression=SNAPPY,tcu18Fault2 DOUBLE enconding=PLAIN compression=SNAPPY,tcu18Fault3 DOUBLE enconding=PLAIN compression=SNAPPY,tcu18C2Curr DOUBLE enconding=PLAIN compression=SNAPPY,tcu18C3Curr DOUBLE enconding=PLAIN compression=SNAPPY,tcu18G1Curr DOUBLE enconding=PLAIN compression=SNAPPY,tcu18G3Curr DOUBLE enconding=PLAIN compression=SNAPPY,tcu18PlPrs DOUBLE enconding=PLAIN compression=SNAPPY,tcu18C1Prs DOUBLE enconding=PLAIN compression=SNAPPY,bms8PackDcChargeSt INT32 enconding=PLAIN compression=SNAPPY,bms8Cc2Sts INT32 enconding=PLAIN compression=SNAPPY,bms8DcChgFault INT32 enconding=PLAIN compression=SNAPPY,bms24DcChargeType INT32 enconding=PLAIN compression=SNAPPY,bms24HcuDcChargeReq INT32 enconding=PLAIN compression=SNAPPY,icm2LoWshLqdWarn INT32 enconding=PLAIN compression=SNAPPY,driveMotorDataArr TEXT enconding=PLAIN compression=SNAPPY,odsInsertTime DATETIME-INPUT enconding=PLAIN compression=SNAPPY,stsControllerNetKeep1 TEXT enconding=PLAIN compression=SNAPPY)
创建数据库
create database root.test
将元数据模板添加到数据库
set schema template test1127 to root.test
插入数据
INSERT INTO root.test.chexing2.chexi4(timestamp,a,b,d) values(1700000000000,1.2,false,‘你费老金了’)
INSERT INTO root.test.chexing1.chexi4(timestamp,a,b,d) values(1700000000000,1.2,false,‘你费老金了’)
…
此时添加的数据,都会使用元数据模板设置的元数据类型
查询数据
SELECT * FROM root.test.chexing1.chexi1