diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c446b19a548e2f2f84d147d59327bee66d56caa..40022a539025f4fd05e90fa8a2c81b8160fab51e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,13 @@ SET(CMAKE_VERBOSE_MAKEFILE ON) # open the file named TDengine.sln # +SET(TD_GODLL FALSE) +IF (${DLLTYPE} MATCHES "go") + ADD_DEFINITIONS(-D_TD_GO_DLL_) + MESSAGE(STATUS "input dll type: " ${DLLTYPE}) + SET(TD_GODLL TRUE) +ENDIF () + IF (NOT DEFINED TD_CLUSTER) MESSAGE(STATUS "Build the Lite Version") SET(TD_CLUSTER FALSE) @@ -41,34 +48,43 @@ IF (NOT DEFINED TD_CLUSTER) SET(TD_ARM FALSE) SET(TD_ARM_64 FALSE) SET(TD_ARM_32 FALSE) + SET(TD_MIPS FALSE) SET(TD_MIPS_64 FALSE) + SET(TD_MIPS_32 FALSE) SET(TD_DARWIN_64 FALSE) SET(TD_WINDOWS_64 FALSE) # if generate ARM version: - # cmake -DARMVER=arm32 .. or cmake -DARMVER=arm64 - IF (${ARMVER} MATCHES "arm32") + # cmake -DCPUTYPE=aarch32 .. or cmake -DCPUTYPE=aarch64 + IF (${CPUTYPE} MATCHES "aarch32") SET(TD_ARM TRUE) SET(TD_ARM_32 TRUE) ADD_DEFINITIONS(-D_TD_ARM_) ADD_DEFINITIONS(-D_TD_ARM_32_) - ELSEIF (${ARMVER} MATCHES "arm64") + ELSEIF (${CPUTYPE} MATCHES "aarch64") SET(TD_ARM TRUE) SET(TD_ARM_64 TRUE) ADD_DEFINITIONS(-D_TD_ARM_) ADD_DEFINITIONS(-D_TD_ARM_64_) + ELSEIF (${CPUTYPE} MATCHES "mips64") + SET(TD_MIPS TRUE) + SET(TD_MIPS_64 TRUE) + ADD_DEFINITIONS(-D_TD_MIPS_) + ADD_DEFINITIONS(-D_TD_MIPS_64_) + ELSEIF (${CPUTYPE} MATCHES "x64") + MESSAGE(STATUS "input cpuType: " ${CPUTYPE}) + ELSEIF (${CPUTYPE} MATCHES "x86") + MESSAGE(STATUS "input cpuType: " ${CPUTYPE}) + ELSE () + MESSAGE(STATUS "input cpuType: " ${CPUTYPE}) ENDIF () - IF (TD_ARM) - ADD_DEFINITIONS(-D_TD_ARM_) - IF (TD_ARM_32) - ADD_DEFINITIONS(-D_TD_ARM_32_) - ELSEIF (TD_ARM_64) - ADD_DEFINITIONS(-D_TD_ARM_64_) - ELSE () - EXIT () - ENDIF () - ENDIF () + # + # Get OS information and store in variable TD_OS_INFO. + # + execute_process(COMMAND chmod 777 ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh) + execute_process(COMMAND ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh "" OUTPUT_VARIABLE TD_OS_INFO) + MESSAGE(STATUS "The current os is " ${TD_OS_INFO}) IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") IF (${CMAKE_SIZEOF_VOID_P} MATCHES 8) @@ -76,17 +92,17 @@ IF (NOT DEFINED TD_CLUSTER) SET(TD_OS_DIR ${TD_COMMUNITY_DIR}/src/os/linux) ADD_DEFINITIONS(-D_M_X64) MESSAGE(STATUS "The current platform is Linux 64-bit") - ELSEIF (${CMAKE_SIZEOF_VOID_P} MATCHES 4) - IF (TD_ARM) - SET(TD_LINUX_32 TRUE) - SET(TD_OS_DIR ${TD_COMMUNITY_DIR}/src/os/linux) - #ADD_DEFINITIONS(-D_M_IX86) - MESSAGE(STATUS "The current platform is Linux 32-bit") + ELSEIF (${CMAKE_SIZEOF_VOID_P} MATCHES 4) + IF (TD_ARM) + SET(TD_LINUX_32 TRUE) + SET(TD_OS_DIR ${TD_COMMUNITY_DIR}/src/os/linux) + #ADD_DEFINITIONS(-D_M_IX86) + MESSAGE(STATUS "The current platform is Linux 32-bit") + ELSE () + MESSAGE(FATAL_ERROR "The current platform is Linux 32-bit, but no ARM not supported yet") + EXIT () + ENDIF () ELSE () - MESSAGE(FATAL_ERROR "The current platform is Linux 32-bit, but no ARM not supported yet") - EXIT () - ENDIF () - ELSE () MESSAGE(FATAL_ERROR "The current platform is Linux neither 32-bit nor 64-bit, not supported yet") EXIT () ENDIF () @@ -150,6 +166,12 @@ IF (NOT DEFINED TD_CLUSTER) ENDIF () ADD_DEFINITIONS(-DLINUX) ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT) + IF (${TD_OS_INFO} MATCHES "Alpine") + MESSAGE(STATUS "The current OS is Alpine, append extra flags") + SET(COMMON_FLAGS "${COMMON_FLAGS} -largp") + link_libraries(/usr/lib/libargp.a) + ADD_DEFINITIONS(-D_ALPINE) + ENDIF () ELSEIF (TD_LINUX_32) IF (NOT TD_ARM) EXIT () @@ -160,11 +182,19 @@ IF (NOT DEFINED TD_CLUSTER) ADD_DEFINITIONS(-DLINUX) ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT) ADD_DEFINITIONS(-DUSE_LIBICONV) + IF (${TD_OS_INFO} MATCHES "Alpine") + MESSAGE(STATUS "The current OS is Alpine, add extra flags") + SET(COMMON_FLAGS "${COMMON_FLAGS} -largp") + link_library(/usr/lib/libargp.a) + ADD_DEFINITIONS(-D_ALPINE) + ENDIF () ELSEIF (TD_WINDOWS_64) SET(CMAKE_GENERATOR "NMake Makefiles" CACHE INTERNAL "" FORCE) - SET(COMMON_FLAGS "/nologo /WX- /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-") - SET(DEBUG_FLAGS "/Zi /W3 /GL") - SET(RELEASE_FLAGS "/W0 /GL") + IF (NOT TD_GODLL) + SET(COMMON_FLAGS "/nologo /WX- /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-") + SET(DEBUG_FLAGS "/Zi /W3 /GL") + SET(RELEASE_FLAGS "/W0 /GL") + ENDIF () ADD_DEFINITIONS(-DWINDOWS) ADD_DEFINITIONS(-D__CLEANUP_C) ADD_DEFINITIONS(-DPTW32_STATIC_LIB) @@ -230,20 +260,25 @@ IF (NOT DEFINED TD_CLUSTER) INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR})") ELSEIF (TD_WINDOWS_64) SET(CMAKE_INSTALL_PREFIX C:/TDengine) - INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/go DESTINATION connector) - INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/grafana DESTINATION connector) - INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/python DESTINATION connector) - INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/tests/examples DESTINATION .) - INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/packaging/cfg DESTINATION .) - INSTALL(FILES ${TD_COMMUNITY_DIR}/src/inc/taos.h DESTINATION include) - INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.lib DESTINATION driver) - INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.exp DESTINATION driver) - INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.dll DESTINATION driver) - INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/taos.exe DESTINATION .) - #INSTALL(TARGETS taos RUNTIME DESTINATION driver) - #INSTALL(TARGETS shell RUNTIME DESTINATION .) - IF (TD_MVN_INSTALLED) - INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-1.0.2-dist.jar DESTINATION connector/jdbc) + IF (NOT TD_GODLL) + INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/go DESTINATION connector) + INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/grafana DESTINATION connector) + INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/python DESTINATION connector) + INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/tests/examples DESTINATION .) + INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/packaging/cfg DESTINATION .) + INSTALL(FILES ${TD_COMMUNITY_DIR}/src/inc/taos.h DESTINATION include) + INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.lib DESTINATION driver) + INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.exp DESTINATION driver) + INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.dll DESTINATION driver) + INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/taos.exe DESTINATION .) + #INSTALL(TARGETS taos RUNTIME DESTINATION driver) + #INSTALL(TARGETS shell RUNTIME DESTINATION .) + IF (TD_MVN_INSTALLED) + INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-1.0.2-dist.jar DESTINATION connector/jdbc) + ENDIF () + ELSE () + INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libtaos.dll DESTINATION driver) + INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libtaos.dll.a DESTINATION driver) ENDIF () ENDIF () ENDIF () diff --git a/README.md b/README.md index fddd7d31322911947815ba8589374666b88e5d69..010a807f7a421b24d6f3c7833fafc62cd122d336 100644 --- a/README.md +++ b/README.md @@ -45,10 +45,10 @@ mkdir build && cd build cmake .. && cmake --build . ``` -if compiling on an arm64 processor, you need add one parameter: +if compiling on an aarch64 processor, you need add one parameter: ```cmd -cmake .. -DARMVER=arm64 && cmake --build . +cmake .. -DCPUTYPE=aarch64 && cmake --build . ``` # Quick Run diff --git a/deps/iconv/iconv.c b/deps/iconv/iconv.c index b84a09fd0ae9d0920152fcd2c08ac4fa7c2ad268..391e35d4e78efda0cb881b247cbccf22ab66c67b 100644 --- a/deps/iconv/iconv.c +++ b/deps/iconv/iconv.c @@ -175,7 +175,10 @@ static const struct alias sysdep_aliases[] = { #ifdef __GNUC__ __inline #endif -const struct alias * +// gcc -o0 bug fix +// see http://git.savannah.gnu.org/gitweb/?p=libiconv.git;a=blobdiff;f=lib/iconv.c;h=31853a7f1c47871221189dbf597473a16d8a8da7;hp=5a1a32597fa3efc5f69624d37a2eb96f308cd241;hb=b29089d8b43abc8fba073da7e6dccaeba56b2b70;hpb=0a04404c90d6a725b8b6bbcd65e10c5fcf5993e9 + +static const struct alias * aliases2_lookup (register const char *str) { const struct alias * ptr; diff --git a/documentation/webdocs/markdowndocs/Connections with other Tools-ch.md b/documentation/webdocs/markdowndocs/Connections with other Tools-ch.md index de15bcc77ac1e6153c85402f91e852b537307349..f7da0c654d493bb932b2b0edceccd16fbac2091b 100644 --- a/documentation/webdocs/markdowndocs/Connections with other Tools-ch.md +++ b/documentation/webdocs/markdowndocs/Connections with other Tools-ch.md @@ -46,11 +46,11 @@ TDengine的Grafana插件在安装包的/usr/local/taos/connector/grafana目录 #### 配置数据源 -用户可以直接通过localhost:3000的网址,登录Grafana服务器(用户名/密码:admin/admin),通过左侧`Configuration -> Data Sources`可以添加数据源,如下图所示: +用户可以直接通过 localhost:3000 的网址,登录 Grafana 服务器(用户名/密码:admin/admin),通过左侧 `Configuration -> Data Sources` 可以添加数据源,如下图所示: ![img](../assets/add_datasource1.jpg) -点击 `Add data source` 可进入新增数据源页面,在查询框中输入TDengine 可选择添加,如下图所示: +点击 `Add data source` 可进入新增数据源页面,在查询框中输入 TDengine 可选择添加,如下图所示: ![img](../assets/add_datasource2.jpg) @@ -58,7 +58,7 @@ TDengine的Grafana插件在安装包的/usr/local/taos/connector/grafana目录 ![img](../assets/add_datasource3.jpg) -* HostTDengine:集群的中任意一台服务器的IP地址与TDengine RESTful接口的端口号(6020),默认http://localhost:6020。 +* Host: TDengine 集群的中任意一台服务器的 IP 地址与 TDengine RESTful 接口的端口号(6020),默认 http://localhost:6020。 * User:TDengine 用户名。 * Password:TDengine 用户密码。 @@ -83,7 +83,7 @@ TDengine的Grafana插件在安装包的/usr/local/taos/connector/grafana目录 ![img](../assets/create_dashboard2.jpg) > 关于如何使用Grafana创建相应的监测界面以及更多有关使用Grafana的信息,请参考Grafana官方的[文档](https://grafana.com/docs/)。 -> + #### 导入 Dashboard 在 Grafana 插件目录 /usr/local/taos/connector/grafana/tdengine/dashboard/ 下提供了一个 `tdengine-grafana.json` 可导入的 dashboard。 diff --git a/documentation/webdocs/markdowndocs/TAOS SQL-ch.md b/documentation/webdocs/markdowndocs/TAOS SQL-ch.md index 347ac4f21f00202a3848cf4a48694dcbd64cb274..e9f47bd03e6f81ec416c247701f14ace6e75582b 100644 --- a/documentation/webdocs/markdowndocs/TAOS SQL-ch.md +++ b/documentation/webdocs/markdowndocs/TAOS SQL-ch.md @@ -1,6 +1,8 @@ # TAOS SQL -TDengine提供类似SQL语法,用户可以在TDengine Shell中使用SQL语句操纵数据库,也可以通过C/C++, Java(JDBC), Python, Go等各种程序来执行SQL语句。 +本文档说明TAOS SQL支持的语法规则、主要查询功能、支持的SQL查询函数,以及常用技巧等内容。阅读本文档需要读者具有基本的SQL语言的基础。 + +TAOS SQL是用户对TDengine进行数据写入和查询的主要工具。TAOS SQL为了便于用户快速上手,在一定程度上提供类似于标准SQL类似的风格和模式。严格意义上,TAOS SQL并不是也不试图提供SQL标准的语法。此外,由于TDengine针对的时序性结构化数据不提供修改和更新功能,因此在TAO SQL中不提供数据更新和数据删除的相关功能。 本章节SQL语法遵循如下约定: @@ -9,11 +11,41 @@ TDengine提供类似SQL语法,用户可以在TDengine Shell中使用SQL语句 - | 表示多选一,选择其中一个即可,但不能输入|本身 - … 表示前面的项可重复多个 +为更好地说明SQL语法的规则及其特点,本文假设存在一个数据集。该数据集是针对两种类型的设备温度(湿度)传感器、气压(海拔)传感器建立的数据模型。 +针对温度传感器,具有超级表(super table) temp_stable。其数据模型如下: +``` +taos> describe temp_stable; +Field | Type | Length | Note | +======================================================================================================= +ts |TIMESTAMP | 8 | | +temperature |FLOAT | 4 | | +humidity |TINYINT | 1 | | +status |TINYINT | 1 | | +deviceid |BIGINT | 12 |tag | +location |BINARY | 20 |tag | +``` +数据集包含2个温度传感器的数据,按照TDengine的建模规则,对应2个子表,其名称分别是 temp_tb_1,temp_tb_2 。 +针对压力(海拔)传感器,具有超级表(super table) pressure_stable。其数据模型如下: +数据集包含2个压力传感器数据,对应2个子表,分别是 press_tb_1,press_tb_2。 + +```text +taos> describe pressure_stable; +Field | Type | Length | Note | +======================================================================================================= +ts |TIMESTAMP | 8 | | +height |FLOAT | 4 | | +pressure |FLOAT | 4 | | +devstat |TINYINT | 1 | | +id |BIGINT | 8 |tag | +city |NCHAR | 20 |tag | +longitude |FLOAT | 4 |tag | +latitude |FLOAT | 4 |tag | +``` ## 支持的数据类型 使用TDengine,最重要的是时间戳。创建并插入记录、查询历史记录的时候,均需要指定时间戳。时间戳有如下规则: -- 时间格式为YYYY-MM-DD HH:mm:ss.MS, 默认时间分辨率为毫秒。比如:2017-08-12 18:25:58.128 +- 时间格式为```YYYY-MM-DD HH:mm:ss.MS```, 默认时间分辨率为毫秒。比如:```2017-08-12 18:25:58.128``` - 内部函数now是服务器的当前时间 - 插入记录时,如果时间戳为0,插入数据时使用服务器当前时间 - Epoch Time: 时间戳也可以是一个长整数,表示从1970-01-01 08:00:00.000开始的毫秒数 @@ -27,13 +59,13 @@ TDengine缺省的时间戳是毫秒精度,但通过修改配置参数enableMic | | 类型 | Bytes | 说明 | | ---- | :-------: | ------ | ------------------------------------------------------------ | | 1 | TIMESTAMP | 8 | 时间戳。最小精度毫秒。从格林威治时间 1970-01-01 00:00:00.000 (UTC/GMT) 开始,计时不能早于该时间。 | -| 2 | INT | 4 | 整型,范围 [-2^31+1, 2^31-1], -2^31被用作Null值 | -| 3 | BIGINT | 8 | 长整型,范围 [-2^59, 2^59] | +| 2 | INT | 4 | 整型,范围 [-2^31+1, 2^31-1], -2^31用作Null | +| 3 | BIGINT | 8 | 长整型,范围 [-2^63+1, 2^63-1], -2^63用于NULL | | 4 | FLOAT | 4 | 浮点型,有效位数6-7,范围 [-3.4E38, 3.4E38] | | 5 | DOUBLE | 8 | 双精度浮点型,有效位数15-16,范围 [-1.7E308, 1.7E308] | | 6 | BINARY | 自定义 | 用于记录字符串,最长不能超过504 bytes。binary仅支持字符串输入,字符串两端使用单引号引用,否则英文全部自动转化为小写。使用时须指定大小,如binary(20)定义了最长为20个字符的字符串,每个字符占1byte的存储空间。如果用户字符串超出20字节,将被自动截断。对于字符串内的单引号,可以用转义字符反斜线加单引号来表示, 即 **\’**。 | -| 7 | SMALLINT | 2 | 短整型, 范围 [-32767, 32767] | -| 8 | TINYINT | 1 | 单字节整型,范围 [-127, 127] | +| 7 | SMALLINT | 2 | 短整型, 范围 [-32767, 32767], -32768用于NULL | +| 8 | TINYINT | 1 | 单字节整型,范围 [-127, 127], -128用于NULL | | 9 | BOOL | 1 | 布尔型,{true, false} | | 10 | NCHAR | 自定义 | 用于记录非ASCII字符串,如中文字符。每个nchar字符占用4bytes的存储空间。字符串两端使用单引号引用,字符串内的单引号需用转义字符 **\’**。nchar使用时须指定字符串大小,类型为nchar(10)的列表示此列的字符串最多存储10个nchar字符,会固定占用40bytes的空间。如用户字符串长度超出声明长度,则将被自动截断。 | @@ -165,19 +197,172 @@ TDengine缺省的时间戳是毫秒精度,但通过修改配置参数enableMic ## 数据查询 -###查询语法是: +### 查询语法: ```mysql -SELECT {* | expr_list} FROM tb_name - [WHERE where_condition] - [ORDER BY _c0 { DESC | ASC }] - [LIMIT limit [, OFFSET offset]] - [>> export_file] - -SELECT function_list FROM tb_name - [WHERE where_condition] - [LIMIT limit [, OFFSET offset]] - [>> export_file] +SELECT [DISTINCT] select_expr [, select_expr ...] +FROM {tb_name_list} +[WHERE where_condition] +[INTERVAL [interval_offset,] interval_val] +[FILL fill_val] +[SLIDING fill_val] +[GROUP BY col_list] +[ORDER BY col_list { DESC | ASC }] +[HAVING expr_list] +[SLIMIT limit_val [, SOFFSET offset_val]] +[LIMIT limit_val [, OFFSET offset_val]] +[>> export_file] +``` +#### SELECT子句 +一个选择子句可以是联合查询(UNION)和另一个查询的子查询(SUBQUERY)。 + +##### 通配符 +通配符 * 可以用于代指全部列。对于普通表,结果中只有普通列。 +``` +taos> select * from temp_tb_1; +ts | temperature |humidity|status| +============================================================ +19-04-28 14:22:07.000| 20.00000 | 34 | 1 | +19-04-28 14:22:08.000| 21.50000 | 38 | 1 | +19-04-28 14:22:09.000| 21.30000 | 38 | 1 | +19-04-28 14:22:10.000| 21.20000 | 38 | 1 | +19-04-28 14:22:11.000| 21.30000 | 35 | 0 | +19-04-28 14:22:12.000| 22.00000 | 34 | 0 | +``` +在针对超级表,通配符包含 _标签列_ 。 +``` +taos> select * from temp_stable; +ts | temperature |humidity|status| deviceid | location | +============================================================================================== +19-04-28 14:22:07.000| 21.00000 | 37 | 1 |54197 |beijing | +19-04-28 14:22:07.000| 20.00000 | 34 | 1 |91234 |beijing | +19-04-28 14:22:08.000| 21.50000 | 38 | 1 |91234 |beijing | +19-04-28 14:22:09.000| 21.30000 | 38 | 1 |91234 |beijing | +19-04-28 14:22:10.000| 21.20000 | 38 | 1 |91234 |beijing | +19-04-28 14:22:11.000| 21.30000 | 35 | 0 |91234 |beijing | +19-04-28 14:22:12.000| 22.00000 | 34 | 0 |91234 |beijing | +``` +通配符支持表名前缀,以下两个SQL语句均为返回全部的列: +``` +select * from temp_tb_1; +select temp_tb_1.* from temp_tb_1; +``` +在Join查询中,带前缀的\*和不带前缀\*返回的结果有差别, \*返回全部表的所有列数据(不包含标签),带前缀的通配符,则只返回该表的列数据。 +``` +taos> select * from temp_tb_1,temp_tb_2 where temp_tb_1.ts=temp_tb_2.ts; +ts | temperature |humidity|status| ts | temperature |humidity|status| +======================================================================================================================== +19-04-28 14:22:07.000| 20.00000 | 34 | 1 | 19-04-28 14:22:07.000| 21.00000 | 37 | 1 | +``` + +``` +taos> select temp_tb_1.* from temp_tb_1,temp_tb_2 where temp_tb_1.ts=temp_tb_2.ts; +ts | temperature |humidity|status| +============================================================ +19-04-28 14:22:07.000| 20.00000 | 34 | 1 | +``` + +在使用SQL函数来进行查询过程中,部分SQL函数支持通配符操作。其中的区别在于: +```count(\*)```函数只返回一列。```first```、```last```、```last_row```函数则是返回全部列。 + +``` +taos> select count(*) from temp_tb_1; +count(*) | +====================== +1 | +``` + +``` +taos> select first(*) from temp_tb_1; +first(ts) | first(temperature) |first(humidity)|first(status)| +========================================================================== +19-04-28 14:22:07.000| 20.00000 | 34 | 1 | +``` + +#### 结果集列名 + +```SELECT```子句中,如果不指定返回结果集合的列名,结果集列名称默认使用```SELECT```子句中的表达式名称作为列名称。此外,用户可使用```AS```来重命名返回结果集合中列的名称。例如: +``` +taos> select ts, ts as primary_key_ts from temp_tb_1; +ts | primary_key_ts | +============================================== +19-04-28 14:22:07.000| 19-04-28 14:22:07.000| +``` +但是针对```first(*)```、```last(*)```、```last_row(*)```不支持针对单列的重命名。 + +#### DISTINCT修饰符* +只能用于修饰标签列(TAGS)的结果,不能用于修饰普通列来获得去重后的结果。并且应用```DISTINCT```以后,只能进行单列的标签输出。 +```count(distinct column_name)```用以返回近似的不重复结果的数量,该结果是近似值。 + +#### 隐式结果列 +```Select_exprs```可以是表所属列的列名,也可以是基于列的函数表达式或计算式,数量的上限256个。当用户使用了```interval```或```group by tags```的子句以后,在最后返回结果中会强制返回时间戳列(第一列)和group by子句中的标签列。后续的版本中可以支持关闭group by子句中隐式列的输出,列输出完全由select子句控制。 + +#### 表(超级表)列表 + +FROM关键字后面可以是若干个表(超级表)列表,也可以是子查询的结果。 +如果没有指定用户的当前数据库,可以在表名称之前使用数据库的名称来指定表所属的数据库。例如:```sample.temp_tb_1``` 方式来跨库使用表。 +``` +SELECT * FROM sample.temp_tb_1; +------------------------------ +use sample; +SELECT * FROM temp_tb_1; +``` +From子句中列表可以使用别名来让SQL整体更加简单。 +``` +SELECT t.ts FROM temp_tb_1 t ; +``` +> 暂不支持FROM子句的表别名 + +#### 特殊功能 +部分特殊的查询功能可以不使用FROM子句执行。获取当前所在的数据库 database() +``` +taos> SELECT database(); +database() | +================================= +sample | +``` +如果登录的时候没有指定默认数据库,且没有使用```use``命令切换数据,则返回NULL。 +``` +taos> select database(); +database() | +================================= +NULL | +``` +获取服务器和客户端版本号: +``` +SELECT client_version() +SELECT server_version() +``` +服务器状态检测语句。如果服务器正常,返回一个数字(例如 1)。如果服务器异常,返回error code。该SQL语法能兼容连接池对于TDengine状态的检查及第三方工具对于数据库服务器状态的检查。并可以避免出现使用了错误的心跳检测SQL语句导致的连接池连接丢失的问题。 +``` +SELECT server_status() +SELECT server_status() AS result +``` +#### TAOS SQL中特殊关键词 + + > TBNAME: 在超级表查询中可视为一个特殊的标签,代表查询涉及的子表名
+ \_c0: 表示表(超级表)的第一列 + +#### 小技巧 +获取一个超级表所有的子表名及相关的标签信息: +``` +SELECT TBNAME, location FROM temp_stable +``` +统计超级表下辖子表数量: +``` +SELECT COUNT(TBNAME) FROM temp_stable +``` +以上两个查询均只支持在Where条件子句中添加针对标签(TAGS)的过滤条件。例如: +``` +taos> select count(tbname) from temp_stable; +count(tbname) | +====================== +2 | + +taos> select count(tbname) from temp_stable where deviceid > 60000; +count(tbname) | +====================== +1 | ``` - 可以使用* 返回所有列,或指定列名。可以对数字列进行四则运算,可以给输出的列取列名 diff --git a/documentation/webdocs/markdowndocs/administrator-ch.md b/documentation/webdocs/markdowndocs/administrator-ch.md index b59c0435a880dfd34bbe7903b5c3f3c81197c1fa..2a250a916c13ff2957f1e0bdb21096ed947b4b01 100644 --- a/documentation/webdocs/markdowndocs/administrator-ch.md +++ b/documentation/webdocs/markdowndocs/administrator-ch.md @@ -33,11 +33,26 @@ taosd -c /home/user 下面仅仅列出一些重要的配置参数,更多的参数请看配置文件里的说明。各个参数的详细介绍及作用请看前述章节。**注意:配置修改后,需要重启*taosd*服务才能生效。** -**internalIp** -- 默认值:操作配置的IP地址列表中的第一个IP地址 +**privateIp** +- 默认值:物理节点IP地址列表中的第一个IP地址 对外提供服务的IP地址。 +**publicIp** +- 默认值:与privateIp相同 + +对于阿里等云平台,此为公网IP地址,publicIp在内部映射为对应的privateIP地址,仅对企业版有效。 + +**masterIp** +- 默认值:与privateIp相同 + +集群内第一个物理节点的privateIp地址,仅对企业版有效。 + +**secondIp** +- 默认值:与privateIp相同 + +集群内第二个物理节点的privateIp地址,仅对企业版有效。 + **mgmtShellPort** - 默认值: _6030_ @@ -50,6 +65,28 @@ taosd -c /home/user 数据节点与客户端通信使用的TCP/UDP端口号。 > 端口范围 _6035_ - _6039_ 的5个端口用于UDP通信。此外,还使用端口 _6035_ 用于TCP通讯。 +**mgmtVnodePort** +- 默认值: _6040_ + +管理节点与数据节点通信使用的TCP/UDP端口号,仅对企业版有效。 +> 端口范围 _6040_ - _6044_ 的5个端口用于UDP通信。此外,还使用端口 _6040_ 用于TCP通讯。 + +**vnodeVnodePort** +- 默认值: _6045_ + +数据节点与数据节点通信使用的TCP/UDP端口号,仅对企业版有效。 +> 端口范围 _6045_ - _6049_ 的5个端口用于UDP通信。此外,还使用端口 _6045_ 用于TCP通讯。 + +**mgmtMgmtPort** +- 默认值: _6050_ + +管理节点与管理节点通信使用的UDP端口号,仅对企业版有效。 + +**mgmtSyncPort** +- 默认值: _6050_ + +管理节点与管理节点同步使用的TCP端口号,仅对企业版有效。 + **httpPort** - 默认值: _6020_ diff --git a/documentation/webdocs/markdowndocs/connector-ch.md b/documentation/webdocs/markdowndocs/connector-ch.md index e91c9d667a95563c28f57c130b5cb9ecaaffe8ae..23bc6a9f6c8f26fbea2c883e6625e7544f76a2bc 100644 --- a/documentation/webdocs/markdowndocs/connector-ch.md +++ b/documentation/webdocs/markdowndocs/connector-ch.md @@ -880,7 +880,7 @@ npm install td-connector ``` 我们建议用户使用npm 安装node.js连接器。如果您没有安装npm, 可以将*src/connector/nodejs/*拷贝到您的nodejs 项目目录下 -To interact with TDengine, we make use of the [node-gyp](https://github.com/nodejs/node-gyp) library. To install, you will need to install the following depending on platform (the following instructions are quoted from node-gyp)我们使用[node-gyp](https://github.com/nodejs/node-gyp)和TDengine服务端进行交互。安装node.js 连接器之前,还需安装以下软件: +我们使用[node-gyp](https://github.com/nodejs/node-gyp)和TDengine服务端进行交互。安装node.js 连接器之前,还需安装以下软件: ### Unix @@ -939,7 +939,7 @@ To interact with TDengine, we make use of the [node-gyp](https://github.com/node #### 连接 -使用node.js连接器时,必须先require```td-connector```,然后使用 ```taos.connect``` 函数。```taos.connect``` 函数必须提供的参数是```host```,其它参数在没有提供的情况下会使用如下的默认值。最后需要初始化```cursor``` 来和TDengine服务端通信 +使用node.js连接器时,必须先require ```td-connector```,然后使用 ```taos.connect``` 函数。```taos.connect``` 函数必须提供的参数是```host```,其它参数在没有提供的情况下会使用如下的默认值。最后需要初始化```cursor``` 来和TDengine服务端通信 ```javascript const taos = require('td-connector'); @@ -1043,7 +1043,7 @@ https://gitee.com/maikebing/Maikebing.EntityFrameworkCore.Taos ### 客户端安装 -在Windows操作系统下,TDengine提供64位的Windows客户端,客户端安装程序为.exe文件,运行该文件即可安装,安装路径为C:\TDengine。Windows的客户端可运行在主流的64位Windows平台之上,客户端目录结构如下: +在Windows操作系统下,TDengine提供64位的Windows客户端([点击下载](https://www.taosdata.com/cn/all-downloads/#tdengine_win-list)),客户端安装程序为.exe文件,运行该文件即可安装,安装路径为C:\TDengine。Windows的客户端可运行在主流的64位Windows平台之上,客户端目录结构如下: ``` ├── cfg diff --git a/importSampleData/.gitignore b/importSampleData/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..2283b63c52940e30b104289ce0c6c05cac75f197 --- /dev/null +++ b/importSampleData/.gitignore @@ -0,0 +1,17 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ +.idea/ +.vscode/ \ No newline at end of file diff --git a/importSampleData/LICENSE b/importSampleData/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0ad25db4bd1d86c452db3f9602ccdbe172438f52 --- /dev/null +++ b/importSampleData/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/importSampleData/README.md b/importSampleData/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0678676d4e85d568068dfa138904baf7a8ef03e5 --- /dev/null +++ b/importSampleData/README.md @@ -0,0 +1,241 @@ +## 样例数据导入 + +该工具可以根据用户提供的 `json` 或 `csv` 格式样例数据文件快速导入 `TDengine`,目前仅能在 Linux 上运行。 + +为了体验写入和查询性能,可以对样例数据进行横向、纵向扩展。横向扩展是指将一个表(监测点)的数据克隆到多张表,纵向扩展是指将样例数据中的一段时间范围内的数据在时间轴上复制。该工具还支持历史数据导入至当前时间后持续导入,这样可以测试插入和查询并行进行的场景,以模拟真实环境。 + +## 下载安装 + +### 下载可执行文件 + +由于该工具使用 go 语言开发,为了方便使用,项目中已经提供了编译好的可执行文件 `bin/taosimport`。通过 `git clone https://github.com/taosdata/TDengine.git` 命令或者直接下载 `ZIP` 文件解压进入样例导入程序目录 `cd importSampleData`,执行 `bin/taosimport`。 + +### go 源码编译 + +由于该工具使用 go 语言开发,编译之前需要先安装 go,具体请参考 [Getting Started][2],而且需要安装 TDengine 的 Go Connector, 具体请参考[TDengine 连接器文档][3]。安装完成之后,执行以下命令即可编译成可执行文件 `bin/taosimport`。 +```shell +go get https://github.com/taosdata/TDengine/importSampleData +cd $GOPATH/src/github.com/taosdata/TDengine/importSampleData +go build -o bin/taosimport app/main.go +``` + +> 注:由于目前 TDengine 的 go connector 只支持 linux 环境,所以该工具暂时只能在 linux 系统中运行。 +> 如果 go get 失败可以下载之后复制 `github.com/taosdata/TDengine/importSampleData` 文件夹到 $GOPATH 的 src 目录下再执行 `go build -o bin/taosimport app/main.go`。 + +## 使用 + +### 快速体验 + +执行命令 `bin/taosimport` 会根据默认配置执行以下操作: +1. 创建数据库 + + 自动创建名称为 `test_yyyyMMdd` 的数据库。 + +2. 创建超级表 + + 根据配置文件 `config/cfg.toml` 中指定的 `sensor_info` 场景信息创建相应的超级表。 + > 建表语句: create table s_sensor_info(ts timestamp, temperature int, humidity float) tags(location binary(20), color binary(16), devgroup int); + +3. 自动建立子表并插入数据 + + 根据配置文件 `config/cfg.toml` 中 `sensor_info` 场景指定的 `data/sensor_info.csv` 样例数据进行横向扩展 `100` 倍(可通过 hnum 参数指定),即自动创建 `10*100=1000` 张子表(默认样例数据中有 10 张子表,每张表 100 条数据),启动 `10` 个线程(可通过 thread 参数指定)对每张子表循环导入 `1000` 次(可通过 vnum 参数指定)。 + +进入 `taos shell`,可运行如下查询验证: + +* 查询记录数 + + ```shell + taos> use test_yyyyMMdd; + taos> select count(*) from s_sensor_info; + ``` +* 查询各个分组的记录数 + + ```shell + taos> select count(*) from s_sensor_info group by devgroup; + ``` +* 按 1h 间隔查询各聚合指标 + + ```shell + taos> select count(temperature), sum(temperature), avg(temperature) from s_sensor_info interval(1h); + ``` +* 查询指定位置最新上传指标 + + ```shell + taos> select last(*) from s_sensor_info where location = 'beijing'; + ``` +> 更多查询及函数使用请参考 [数据查询][4] + +### 详细使用说明 + +执行命令 `bin/taosimport -h` 可以查看详细参数使用说明: + +* -cfg string + + 导入配置文件路径,包含样例数据文件相关描述及对应 TDengine 配置信息。默认使用 `config/cfg.toml`。 + +* -cases string + + 需要导入的场景名称,该名称可从 -cfg 指定的配置文件中 `[usecase]` 查看,可同时导入多个场景,中间使用逗号分隔,如:`sensor_info,camera_detection`,默认为 `sensor_info`。 + +* -hnum int + + 需要将样例数据进行横向扩展的倍数,假设原有样例数据包含 1 张子表 `t_0` 数据,指定 hnum 为 2 时会根据原有表名创建 `t_0、t_1` 两张子表。默认为 100。 + +* -vnum int + + 需要将样例数据进行纵向扩展的次数,如果设置为 0 代表将历史数据导入至当前时间后持续按照指定间隔导入。默认为 1000,表示将样例数据在时间轴上纵向复制1000 次。 + +* -delay int + + 当 vnum 设置为 0 时持续导入的时间间隔,默认为所有场景中最小记录间隔时间的一半,单位 ms。 + +* -tick int + + 打印统计信息的时间间隔,默认 2000 ms。 + +* -save int + + 是否保存统计信息到 tdengine 的 statistic 表中,1 是,0 否, 默认 0。 + +* -auto int + + 是否自动生成样例数据中的主键时间戳,1 是,0 否, 默认 0。 + +* -start string + + 导入的记录开始时间,格式为 `"yyyy-MM-dd HH:mm:ss.SSS"`,不设置会使用样例数据中最小时间,设置后会忽略样例数据中的主键时间,会按照指定的 start 进行导入。如果 auto 为 1,则必须设置 start,默认为空。 + +* -interval int + + 导入的记录时间间隔,该设置只会在指定 `auto=1` 之后生效,否则会根据样例数据自动计算间隔时间。单位为毫秒,默认 1000。 + +* -thread int + + 执行导入数据的线程数目,默认为 10。 + +* -batch int + + 执行导入数据时的批量大小,默认为 100。批量是指一次写操作时,包含多少条记录。 + +* -host string + + 导入的 TDengine 服务器 IP,默认为 127.0.0.1。 + +* -port int + + 导入的 TDengine 服务器端口,默认为 6030。 + +* -user string + + 导入的 TDengine 用户名,默认为 root。 + +* -password string + + 导入的 TDengine 用户密码,默认为 taosdata。 + +* -dropdb int + + 导入数据之前是否删除数据库,1 是,0 否, 默认 0。 + +* -db string + + 导入的 TDengine 数据库名称,默认为 test_yyyyMMdd。 + +* -dbparam string + + 当指定的数据库不存在时,自动创建数据库时可选项配置参数,如 `days 10 cache 16000 ablocks 4`,默认为空。 + +### 常见使用示例 + +* `bin/taosimport -cfg config/cfg.toml -cases sensor_info,camera_detection -hnum 1 -vnum 10` + + 执行上述命令后会将 sensor_info、camera_detection 两个场景的数据各导入 10 次。 + +* `bin/taosimport -cfg config/cfg.toml -cases sensor_info -hnum 2 -vnum 0 -start "2019-12-12 00:00:00.000" -interval 5000` + + 执行上述命令后会将 sensor_info 场景的数据横向扩展2倍从指定时间 `2019-12-12 00:00:00.000` 开始且记录间隔时间为 5000 毫秒开始导入,导入至当前时间后会自动持续导入。 + +### config/cfg.toml 配置文件说明 + +``` toml +# 传感器场景 +[sensor_info] # 场景名称 +format = "csv" # 样例数据文件格式,可以是 json 或 csv,具体字段应至少包含 subTableName、tags、fields 指定的字段。 +filePath = "data/sensor_info.csv" # 样例数据文件路径,程序会循环使用该文件数据 +separator = "," # csv 样例文件中字段分隔符,默认逗号 + +stname = "sensor_info" # 超级表名称 +subTableName = "devid" # 使用样例数据中指定字段当作子表名称一部分,子表名称格式为 t_subTableName_stname,扩展表名为 t_subTableName_stname_i。 +timestamp = "ts" # 使用 fields 中哪个字段当作主键,类型必须为 timestamp +timestampType="millisecond" # 样例数据中主键时间字段是 millisecond 还是 dateTime 格式 +#timestampTypeFormat = "2006-01-02 15:04:05.000" # 主键日期时间格式,timestampType 为 dateTime 时需要指定 +tags = [ + # 标签列表,name 为标签名称,type 为标签类型 + { name = "location", type = "binary(20)" }, + { name = "color", type = "binary(16)" }, + { name = "devgroup", type = "int" }, +] + +fields = [ + # 字段列表,name 为字段名称,type 为字段类型 + { name = "ts", type = "timestamp" }, + { name = "temperature", type = "int" }, + { name = "humidity", type = "float" }, +] + +# 摄像头检测场景 +[camera_detection] # 场景名称 +format = "json" # 样例数据文件格式,可以是 json 或 csv,具体字段应至少包含 subTableName、tags、fields 指定的字段。 +filePath = "data/camera_detection.json" # 样例数据文件路径,程序会循环使用该文件数据 +#separator = "," # csv 样例文件中字段分隔符,默认逗号, 如果是 json 文件可以不用配置 + +stname = "camera_detection" # 超级表名称 +subTableName = "sensor_id" # 使用样例数据中指定字段当作子表名称一部分,子表名称格式为 t_subTableName_stname,扩展表名为 t_subTableName_stname_i。 +timestamp = "ts" # 使用 fields 中哪个字段当作主键,类型必须为 timestamp +timestampType="dateTime" # 样例数据中主键时间字段是 millisecond 还是 dateTime 格式 +timestampTypeFormat = "2006-01-02 15:04:05.000" # 主键日期时间格式,timestampType 为 dateTime 时需要指定 +tags = [ + # 标签列表,name 为标签名称,type 为标签类型 + { name = "home_id", type = "binary(30)" }, + { name = "object_type", type = "int" }, + { name = "object_kind", type = "binary(20)" }, +] + +fields = [ + # 字段列表,name 为字段名称,type 为字段类型 + { name = "ts", type = "timestamp" }, + { name = "states", type = "tinyint" }, + { name = "battery_voltage", type = "float" }, +] + +# other cases + +``` + +### 样例数据格式说明 + +#### json + +当配置文件 `config/cfg.toml` 中各场景的 format="json" 时,样例数据文件需要提供 tags 和 fields 字段列表中的字段值。样例数据格式如下: + +```json +{"home_id": "603", "sensor_id": "s100", "ts": "2019-01-01 00:00:00.000", "object_type": 1, "object_kind": "night", "battery_voltage": 0.8, "states": 1} +{"home_id": "604", "sensor_id": "s200", "ts": "2019-01-01 00:00:00.000", "object_type": 2, "object_kind": "day", "battery_voltage": 0.6, "states": 0} +``` + +#### csv + +当配置文件 `config/cfg.toml` 中各场景的 format="csv" 时,样例数据文件需要提供表头和对应的数据,其中字段分隔符由使用场景中 `separator` 指定,默认逗号。具体格式如下: + +```csv +devid,location,color,devgroup,ts,temperature,humidity +0, beijing, white, 0, 1575129600000, 16, 19.405091 +0, beijing, white, 0, 1575129601000, 22, 14.377142 +``` + + + +[1]: https://github.com/taosdata/TDengine +[2]: https://golang.org/doc/install +[3]: https://www.taosdata.com/cn/documentation/connector/#Go-Connector +[4]: https://www.taosdata.com/cn/documentation/taos-sql/#%E6%95%B0%E6%8D%AE%E6%9F%A5%E8%AF%A2 \ No newline at end of file diff --git a/importSampleData/app/main.go b/importSampleData/app/main.go new file mode 100644 index 0000000000000000000000000000000000000000..087b7bb7614e8a03da0ce9fae0c5693340314236 --- /dev/null +++ b/importSampleData/app/main.go @@ -0,0 +1,1077 @@ +package main + +import ( + "bufio" + "bytes" + "database/sql" + "encoding/json" + "flag" + "fmt" + "github.com/taosdata/TDengine/importSampleData/import" + "hash/crc32" + "io" + "log" + "os" + "sort" + "strconv" + "strings" + "sync" + "time" + + _ "github.com/taosdata/TDengine/src/connector/go/src/taosSql" +) + +const ( + TIMESTAMP = "timestamp" + DATETIME = "datetime" + MILLISECOND = "millisecond" + DEFAULT_STARTTIME int64 = -1 + DEFAULT_INTERVAL int64 = 1*1000 + DEFAULT_DELAY int64 = -1 + + JSON_FORMAT = "json" + CSV_FORMAT = "csv" + SUPERTABLE_PREFIX = "s_" + SUBTABLE_PREFIX = "t_" + + DRIVER_NAME = "taosSql" + STARTTIME_LAYOUT = "2006-01-02 15:04:05.000" + INSERT_PREFIX = "insert into " + STATISTIC_TABLE = "statistic" +) + +var ( + + cfg string + cases string + hnum int + vnum int + thread int + batch int + auto int + starttimestr string + interval int64 + host string + port int + user string + password string + dropdb int + db string + dbparam string + + dataSourceName string + startTime int64 + + superTableConfigMap = make(map[string]*superTableConfig) + subTableMap = make(map[string]*dataRows) + scaleTableNames []string + + scaleTableMap = make(map[string]*scaleTableInfo) + + successRows []int64 + lastStaticTime time.Time + lastTotalRows int64 + timeTicker *time.Ticker + delay int64 // default 10 milliseconds + tick int64 + save int +) + +type superTableConfig struct { + startTime int64 + endTime int64 + cycleTime int64 + avgInterval int64 + config dataimport.CaseConfig +} + +type scaleTableInfo struct { + scaleTableName string + subTableName string + insertRows int64 +} + +type tableRows struct { + tableName string // tableName + value string // values(...) +} + +type dataRows struct { + rows []map[string]interface{} + config dataimport.CaseConfig +} + +func (rows dataRows) Len() int { + return len(rows.rows) +} + +func (rows dataRows) Less(i, j int) bool { + itime := getPrimaryKey(rows.rows[i][rows.config.Timestamp]) + jtime := getPrimaryKey(rows.rows[j][rows.config.Timestamp]) + return itime < jtime +} + +func (rows dataRows) Swap(i, j int) { + rows.rows[i], rows.rows[j] = rows.rows[j], rows.rows[i] +} + +func getPrimaryKey(value interface{}) int64 { + val, _ := value.(int64) + //time, _ := strconv.ParseInt(str, 10, 64) + return val +} + +func init() { + parseArg() //parse argument + + if db == "" { + //db = "go" + db = fmt.Sprintf("test_%s",time.Now().Format("20060102")) + } + + if auto == 1 && len(starttimestr) == 0 { + log.Fatalf("startTime must be set when auto is 1, the format is \"yyyy-MM-dd HH:mm:ss.SSS\" ") + } + + if len(starttimestr) != 0 { + t, err := time.ParseInLocation(STARTTIME_LAYOUT, strings.TrimSpace(starttimestr), time.Local) + if err != nil { + log.Fatalf("param startTime %s error, %s\n", starttimestr, err) + } + + startTime = t.UnixNano() / 1e6 // as millisecond + }else{ + startTime = DEFAULT_STARTTIME + } + + dataSourceName = fmt.Sprintf("%s:%s@/tcp(%s:%d)/", user, password, host, port) + + printArg() + + log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile) +} + +func main() { + + importConfig := dataimport.LoadConfig(cfg) + + var caseMinumInterval int64 = -1 + + for _, userCase := range strings.Split(cases, ",") { + caseConfig, ok := importConfig.UserCases[userCase] + + if !ok { + log.Println("not exist case: ", userCase) + continue + } + + checkUserCaseConfig(userCase, &caseConfig) + + //read file as map array + fileRows := readFile(caseConfig) + log.Printf("case [%s] sample data file contains %d rows.\n", userCase, len(fileRows.rows)) + + if len(fileRows.rows) == 0 { + log.Printf("there is no valid line in file %s\n", caseConfig.FilePath) + continue + } + + _, exists := superTableConfigMap[caseConfig.Stname] + if !exists { + superTableConfigMap[caseConfig.Stname] = &superTableConfig{config:caseConfig} + } else { + log.Fatalf("the stname of case %s already exist.\n", caseConfig.Stname) + } + + var start, cycleTime, avgInterval int64 = getSuperTableTimeConfig(fileRows) + + // set super table's startTime, cycleTime and avgInterval + superTableConfigMap[caseConfig.Stname].startTime = start + superTableConfigMap[caseConfig.Stname].avgInterval = avgInterval + superTableConfigMap[caseConfig.Stname].cycleTime = cycleTime + + if caseMinumInterval == -1 || caseMinumInterval > avgInterval { + caseMinumInterval = avgInterval + } + + startStr := time.Unix(0, start*int64(time.Millisecond)).Format(STARTTIME_LAYOUT) + log.Printf("case [%s] startTime %s(%d), average dataInterval %d ms, cycleTime %d ms.\n", userCase, startStr, start, avgInterval, cycleTime) + } + + if DEFAULT_DELAY == delay { + // default delay + delay = caseMinumInterval / 2 + if delay < 1 { + delay = 1 + } + log.Printf("actual delay is %d ms.", delay) + } + + superTableNum := len(superTableConfigMap) + if superTableNum == 0 { + log.Fatalln("no valid file, exited") + } + + start := time.Now() + // create super table + createSuperTable(superTableConfigMap) + log.Printf("create %d superTable ,used %d ms.\n", superTableNum, time.Since(start)/1e6) + + //create sub table + start = time.Now() + createSubTable(subTableMap) + log.Printf("create %d times of %d subtable ,all %d tables, used %d ms.\n", hnum, len(subTableMap), len(scaleTableMap), time.Since(start)/1e6) + + subTableNum := len(scaleTableMap) + + if subTableNum < thread { + thread = subTableNum + } + + filePerThread := subTableNum / thread + leftFileNum := subTableNum % thread + + var wg sync.WaitGroup + + start = time.Now() + + successRows = make([]int64, thread) + + startIndex, endIndex := 0, filePerThread + for i := 0; i < thread; i++ { + // start thread + if i < leftFileNum { + endIndex++ + } + wg.Add(1) + + go insertData(i, startIndex, endIndex, &wg, successRows) + startIndex, endIndex = endIndex, endIndex+filePerThread + } + + lastStaticTime = time.Now() + timeTicker = time.NewTicker(time.Millisecond * time.Duration(tick)) + go staticSpeed() + wg.Wait() + + usedTime := time.Since(start) + + total := getTotalRows(successRows) + + log.Printf("finished insert %d rows, used %d ms, speed %d rows/s", total, usedTime/1e6, total * 1e9 / int64(usedTime)) + + if vnum == 0 { + // continue waiting for insert data + wait := make(chan string) + v := <- wait + log.Printf("program receive %s, exited.\n", v) + }else{ + timeTicker.Stop() + } + +} + +func staticSpeed(){ + + connection := getConnection() + defer connection.Close() + + if save == 1 { + connection.Exec("use " + db) + _, err := connection.Exec("create table if not exists " + STATISTIC_TABLE +"(ts timestamp, speed int)") + if err != nil { + log.Fatalf("create %s Table error: %s\n", STATISTIC_TABLE, err) + } + } + + for { + <-timeTicker.C + + currentTime := time.Now() + usedTime := currentTime.UnixNano() - lastStaticTime.UnixNano() + + total := getTotalRows(successRows) + currentSuccessRows := total - lastTotalRows + + speed := currentSuccessRows * 1e9 / int64(usedTime) + log.Printf("insert %d rows, used %d ms, speed %d rows/s", currentSuccessRows, usedTime/1e6, speed) + + if save == 1 { + insertSql := fmt.Sprintf("insert into %s values(%d, %d)", STATISTIC_TABLE, currentTime.UnixNano()/1e6, speed) + connection.Exec(insertSql) + } + + lastStaticTime = currentTime + lastTotalRows = total + } + +} + +func getTotalRows(successRows []int64) int64{ + var total int64 = 0 + for j := 0; j < len(successRows); j++ { + total += successRows[j] + } + return total +} + +func getSuperTableTimeConfig(fileRows dataRows) (start, cycleTime, avgInterval int64){ + if auto == 1 { + // use auto generate data time + start = startTime + avgInterval = interval + maxTableRows := normalizationDataWithSameInterval(fileRows, avgInterval) + cycleTime = maxTableRows * avgInterval + avgInterval + + } else { + + // use the sample data primary timestamp + sort.Sort(fileRows)// sort the file data by the primarykey + minTime := getPrimaryKey(fileRows.rows[0][fileRows.config.Timestamp]) + maxTime := getPrimaryKey(fileRows.rows[len(fileRows.rows)-1][fileRows.config.Timestamp]) + + start = minTime // default startTime use the minTime + if DEFAULT_STARTTIME != startTime { + start = startTime + } + + tableNum := normalizationData(fileRows, minTime) + + if minTime == maxTime { + avgInterval = interval + cycleTime = tableNum * avgInterval + avgInterval + }else{ + avgInterval = (maxTime - minTime) / int64(len(fileRows.rows)) * tableNum + cycleTime = maxTime - minTime + avgInterval + } + + } + return +} + +func createStatisticTable(){ + connection := getConnection() + defer connection.Close() + + _, err := connection.Exec("create table if not exist " + db + "."+ STATISTIC_TABLE +"(ts timestamp, speed int)") + if err != nil { + log.Fatalf("createStatisticTable error: %s\n", err) + } +} + +func createSubTable(subTableMaps map[string]*dataRows) { + + connection := getConnection() + defer connection.Close() + + connection.Exec("use " + db) + + createTablePrefix := "create table if not exists " + for subTableName := range subTableMaps { + + superTableName := getSuperTableName(subTableMaps[subTableName].config.Stname) + tagValues := subTableMaps[subTableName].rows[0] // the first rows values as tags + + buffers := bytes.Buffer{} + // create table t using supertTable tags(...); + for i := 0; i < hnum; i++ { + tableName := getScaleSubTableName(subTableName, i) + + scaleTableMap[tableName] = &scaleTableInfo{ + subTableName: subTableName, + insertRows: 0, + } + scaleTableNames = append(scaleTableNames, tableName) + + buffers.WriteString(createTablePrefix) + buffers.WriteString(tableName) + buffers.WriteString(" using ") + buffers.WriteString(superTableName) + buffers.WriteString(" tags(") + for _, tag := range subTableMaps[subTableName].config.Tags{ + tagValue := fmt.Sprintf("%v", tagValues[strings.ToLower(tag.Name)]) + buffers.WriteString("'" + tagValue + "'") + buffers.WriteString(",") + } + buffers.Truncate(buffers.Len()-1) + buffers.WriteString(")") + + createTableSql := buffers.String() + buffers.Reset() + + //log.Printf("create table: %s\n", createTableSql) + _, err := connection.Exec(createTableSql) + if err != nil { + log.Fatalf("create table error: %s\n", err) + } + } + } +} + +func createSuperTable(superTableConfigMap map[string]*superTableConfig) { + + connection := getConnection() + defer connection.Close() + + if dropdb == 1 { + dropDbSql := "drop database if exists " + db + _, err := connection.Exec(dropDbSql) // drop database if exists + if err != nil { + log.Fatalf("drop database error: %s\n", err) + } + log.Printf("dropDb: %s\n", dropDbSql) + } + + createDbSql := "create database if not exists " + db + " " + dbparam + + _, err := connection.Exec(createDbSql) // create database if not exists + if err != nil { + log.Fatalf("create database error: %s\n", err) + } + log.Printf("createDb: %s\n", createDbSql) + + connection.Exec("use " + db) + + prefix := "create table if not exists " + var buffer bytes.Buffer + //CREATE TABLE ( TIMESTAMP, field_name1 field_type,…) TAGS(tag_name tag_type, …) + for key := range superTableConfigMap { + + buffer.WriteString(prefix) + buffer.WriteString(getSuperTableName(key)) + buffer.WriteString("(") + + superTableConf := superTableConfigMap[key] + + buffer.WriteString(superTableConf.config.Timestamp) + buffer.WriteString(" timestamp, ") + + for _, field := range superTableConf.config.Fields { + buffer.WriteString(field.Name + " " + field.Type + ",") + } + + buffer.Truncate(buffer.Len()-1) + buffer.WriteString(") tags( ") + + for _, tag := range superTableConf.config.Tags { + buffer.WriteString(tag.Name + " " + tag.Type + ",") + } + + buffer.Truncate(buffer.Len()-1) + buffer.WriteString(")") + + createSql := buffer.String() + buffer.Reset() + + //log.Printf("supertable: %s\n", createSql) + _, err = connection.Exec(createSql) + if err != nil { + log.Fatalf("create supertable error: %s\n", err) + } + } + +} + +func getScaleSubTableName(subTableName string, hnum int) string { + if hnum == 0 { + return subTableName + } + return fmt.Sprintf( "%s_%d", subTableName, hnum) +} + +func getSuperTableName(stname string) string { + return SUPERTABLE_PREFIX + stname +} + + +/** +* normalizationData , and return the num of subTables + */ +func normalizationData(fileRows dataRows, minTime int64) int64 { + + var tableNum int64 = 0 + for _, row := range fileRows.rows { + // get subTableName + tableValue := getSubTableNameValue(row[fileRows.config.SubTableName]) + if len(tableValue) == 0 { + continue + } + + row[fileRows.config.Timestamp] = getPrimaryKey(row[fileRows.config.Timestamp]) - minTime + + subTableName := getSubTableName(tableValue, fileRows.config.Stname) + + value, ok := subTableMap[subTableName] + if !ok { + subTableMap[subTableName] = &dataRows{ + rows: []map[string]interface{}{row}, + config: fileRows.config, + } + + tableNum++ + }else{ + value.rows = append(value.rows, row) + } + } + return tableNum +} + +// return the maximum table rows +func normalizationDataWithSameInterval(fileRows dataRows, avgInterval int64) int64{ + // subTableMap + currSubTableMap := make(map[string]*dataRows) + for _, row := range fileRows.rows { + // get subTableName + tableValue := getSubTableNameValue(row[fileRows.config.SubTableName]) + if len(tableValue) == 0 { + continue + } + + subTableName := getSubTableName(tableValue, fileRows.config.Stname) + + value, ok := currSubTableMap[subTableName] + if !ok { + row[fileRows.config.Timestamp] = 0 + currSubTableMap[subTableName] = &dataRows{ + rows: []map[string]interface{}{row}, + config: fileRows.config, + } + }else{ + row[fileRows.config.Timestamp] = int64(len(value.rows)) * avgInterval + value.rows = append(value.rows, row) + } + + } + + var maxRows, tableRows int = 0, 0 + for tableName := range currSubTableMap{ + tableRows = len(currSubTableMap[tableName].rows) + subTableMap[tableName] = currSubTableMap[tableName] // add to global subTableMap + if tableRows > maxRows { + maxRows = tableRows + } + } + + return int64(maxRows) +} + + +func getSubTableName(subTableValue string, superTableName string) string { + return SUBTABLE_PREFIX + subTableValue + "_" + superTableName +} + + +func insertData(threadIndex, start, end int, wg *sync.WaitGroup, successRows []int64) { + connection := getConnection() + defer connection.Close() + defer wg.Done() + + connection.Exec("use " + db) // use db + + log.Printf("thread-%d start insert into [%d, %d) subtables.\n", threadIndex, start, end) + + num := 0 + subTables := scaleTableNames[start:end] + for { + var currSuccessRows int64 + var appendRows int + var lastTableName string + + buffers := bytes.Buffer{} + buffers.WriteString(INSERT_PREFIX) + + for _, tableName := range subTables { + + subTableInfo := subTableMap[scaleTableMap[tableName].subTableName] + subTableRows := int64(len(subTableInfo.rows)) + superTableConf := superTableConfigMap[subTableInfo.config.Stname] + + tableStartTime := superTableConf.startTime + var tableEndTime int64 + if vnum == 0 { + // need continue generate data + tableEndTime = time.Now().UnixNano()/1e6 + }else { + tableEndTime = tableStartTime + superTableConf.cycleTime * int64(vnum) - superTableConf.avgInterval + } + + insertRows := scaleTableMap[tableName].insertRows + + for { + loopNum := insertRows / subTableRows + rowIndex := insertRows % subTableRows + currentRow := subTableInfo.rows[rowIndex] + + currentTime := getPrimaryKey(currentRow[subTableInfo.config.Timestamp]) + loopNum * superTableConf.cycleTime + tableStartTime + if currentTime <= tableEndTime { + // append + + if lastTableName != tableName { + buffers.WriteString(tableName) + buffers.WriteString(" values") + } + lastTableName = tableName + + buffers.WriteString("(") + buffers.WriteString(fmt.Sprintf("%v", currentTime)) + buffers.WriteString(",") + + // fieldNum := len(subTableInfo.config.Fields) + for _,field := range subTableInfo.config.Fields { + buffers.WriteString(getFieldValue(currentRow[strings.ToLower(field.Name)])) + buffers.WriteString(",") + // if( i != fieldNum -1){ + + // } + } + + buffers.Truncate(buffers.Len()-1) + buffers.WriteString(") ") + + appendRows++ + insertRows++ + if appendRows == batch { + // executebatch + insertSql := buffers.String() + affectedRows := executeBatchInsert(insertSql, connection) + + successRows[threadIndex] += affectedRows + currSuccessRows += affectedRows + + buffers.Reset() + buffers.WriteString(INSERT_PREFIX) + lastTableName = "" + appendRows = 0 + } + }else { + // finished insert current table + break + } + } + + scaleTableMap[tableName].insertRows = insertRows + + } + + // left := len(rows) + if appendRows > 0 { + // executebatch + insertSql := buffers.String() + affectedRows := executeBatchInsert(insertSql, connection) + + successRows[threadIndex] += affectedRows + currSuccessRows += affectedRows + + buffers.Reset() + } + + // log.Printf("thread-%d finished insert %d rows, used %d ms.", threadIndex, currSuccessRows, time.Since(threadStartTime)/1e6) + + if vnum != 0 { + // thread finished insert data + // log.Printf("thread-%d exit\n", threadIndex) + break + } + + if(num == 0){ + wg.Done() //finished insert history data + num++ + } + + if currSuccessRows == 0 { + // log.Printf("thread-%d start to sleep %d ms.", threadIndex, delay) + time.Sleep(time.Duration(delay) * time.Millisecond) + } + + // need continue insert data + } + +} + +func buildSql(rows []tableRows) string{ + + var lastTableName string + + buffers := bytes.Buffer{} + + for i, row := range rows { + if i == 0 { + lastTableName = row.tableName + buffers.WriteString(INSERT_PREFIX) + buffers.WriteString(row.tableName) + buffers.WriteString(" values") + buffers.WriteString(row.value) + continue + } + + if lastTableName == row.tableName { + buffers.WriteString(row.value) + }else { + buffers.WriteString(" ") + buffers.WriteString(row.tableName) + buffers.WriteString(" values") + buffers.WriteString(row.value) + lastTableName = row.tableName + } + } + + inserSql := buffers.String() + return inserSql +} + +func buildRow(tableName string, currentTime int64, subTableInfo *dataRows, currentRow map[string]interface{}) tableRows{ + + tableRows := tableRows{tableName: tableName} + + buffers := bytes.Buffer{} + + buffers.WriteString("(") + buffers.WriteString(fmt.Sprintf("%v", currentTime)) + buffers.WriteString(",") + + for _,field := range subTableInfo.config.Fields { + buffers.WriteString(getFieldValue(currentRow[strings.ToLower(field.Name)])) + buffers.WriteString(",") + } + + buffers.Truncate(buffers.Len()-1) + buffers.WriteString(")") + + insertSql := buffers.String() + tableRows.value = insertSql + + return tableRows +} + +func executeBatchInsert(insertSql string, connection *sql.DB) int64 { + result, error := connection.Exec(insertSql) + if error != nil { + log.Printf("execute insertSql %s error, %s\n", insertSql, error) + return 0 + } + affected, _ := result.RowsAffected() + if affected < 0 { + affected = 0 + } + return affected + // return 0 +} + +func getFieldValue(fieldValue interface{}) string { + return fmt.Sprintf("'%v'", fieldValue) +} + +func getConnection() *sql.DB{ + db, err := sql.Open(DRIVER_NAME, dataSourceName) + if err != nil { + panic(err) + } + return db +} + + +func getSubTableNameValue(suffix interface{}) string { + return fmt.Sprintf("%v", suffix) +} + +func hash(s string) int { + v := int(crc32.ChecksumIEEE([]byte(s))) + if v < 0 { + return -v + } + return v +} + +func readFile(config dataimport.CaseConfig) dataRows { + fileFormat := strings.ToLower(config.Format) + if fileFormat == JSON_FORMAT { + return readJSONFile(config) + } else if fileFormat == CSV_FORMAT { + return readCSVFile(config) + } + + log.Printf("the file %s is not supported yet\n", config.FilePath) + return dataRows{} +} + +func readCSVFile(config dataimport.CaseConfig) dataRows { + var rows dataRows + f, err := os.Open(config.FilePath) + if err != nil { + log.Printf("Error: %s, %s\n", config.FilePath, err) + return rows + } + defer f.Close() + + r := bufio.NewReader(f) + + //read the first line as title + lineBytes, _, err := r.ReadLine() + if err == io.EOF { + log.Printf("the file %s is empty\n", config.FilePath) + return rows + } + line := strings.ToLower(string(lineBytes)) + titles := strings.Split(line, config.Separator) + if len(titles) < 3 { + // need suffix、 primarykey and at least one other field + log.Printf("the first line of file %s should be title row, and at least 3 field.\n", config.FilePath) + return rows + } + + rows.config = config + + var lineNum = 0 + for { + // read data row + lineBytes, _, err = r.ReadLine() + lineNum++ + if err == io.EOF { + break + } + // fmt.Println(line) + rowData := strings.Split(string(lineBytes), config.Separator) + + dataMap := make(map[string]interface{}) + for i, title := range titles { + title = strings.TrimSpace(title) + if i < len(rowData) { + dataMap[title] = strings.TrimSpace(rowData[i]) + } else { + dataMap[title] = "" + } + } + + // if the suffix valid + if !existMapKeyAndNotEmpty(config.Timestamp, dataMap) { + log.Printf("the Timestamp[%s] of line %d is empty, will filtered.\n", config.Timestamp, lineNum) + continue + } + + // if the primary key valid + primaryKeyValue := getPrimaryKeyMillisec(config.Timestamp, config.TimestampType, config.TimestampTypeFormat, dataMap) + if primaryKeyValue == -1 { + log.Printf("the Timestamp[%s] of line %d is not valid, will filtered.\n", config.Timestamp, lineNum) + continue + } + + dataMap[config.Timestamp] = primaryKeyValue + + rows.rows = append(rows.rows, dataMap) + } + return rows +} + +func readJSONFile(config dataimport.CaseConfig) dataRows { + + var rows dataRows + f, err := os.Open(config.FilePath) + if err != nil { + log.Printf("Error: %s, %s\n", config.FilePath, err) + return rows + } + defer f.Close() + + r := bufio.NewReader(f) + //log.Printf("file size %d\n", r.Size()) + + rows.config = config + var lineNum = 0 + for { + lineBytes, _, err := r.ReadLine() + lineNum++ + if err == io.EOF { + break + } + + line := make(map[string]interface{}) + err = json.Unmarshal(lineBytes, &line) + + if err != nil { + log.Printf("line [%d] of file %s parse error, reason: %s\n", lineNum, config.FilePath, err) + continue + } + + // transfer the key to lowercase + lowerMapKey(line) + + if !existMapKeyAndNotEmpty(config.SubTableName, line) { + log.Printf("the SubTableName[%s] of line %d is empty, will filtered.\n", config.SubTableName, lineNum) + continue + } + + primaryKeyValue := getPrimaryKeyMillisec(config.Timestamp, config.TimestampType, config.TimestampTypeFormat, line) + if primaryKeyValue == -1 { + log.Printf("the Timestamp[%s] of line %d is not valid, will filtered.\n", config.Timestamp, lineNum) + continue + } + + line[config.Timestamp] = primaryKeyValue + + rows.rows = append(rows.rows, line) + } + + return rows +} + +/** +* get primary key as millisecond , otherwise return -1 + */ +func getPrimaryKeyMillisec(key string, valueType string, valueFormat string, line map[string]interface{}) int64 { + if !existMapKeyAndNotEmpty(key, line) { + return -1 + } + if DATETIME == valueType { + // transfer the datetime to milliseconds + return parseMillisecond(line[key], valueFormat) + } + + value, err := strconv.ParseInt(fmt.Sprintf("%v", line[key]), 10, 64) + // as millisecond num + if err != nil { + return -1 + } + return value +} + +// parseMillisecond parse the dateStr to millisecond, return -1 if failed +func parseMillisecond(str interface{}, layout string) int64 { + value, ok := str.(string) + if !ok { + return -1 + } + + t, err := time.ParseInLocation(layout, strings.TrimSpace(value), time.Local) + + if err != nil { + log.Println(err) + return -1 + } + return t.UnixNano()/1e6 +} + +// lowerMapKey transfer all the map key to lowercase +func lowerMapKey(maps map[string]interface{}) { + for key := range maps { + value := maps[key] + delete(maps, key) + maps[strings.ToLower(key)] = value + } +} + +func existMapKeyAndNotEmpty(key string, maps map[string]interface{}) bool { + value, ok := maps[key] + if !ok { + return false + } + + str, err := value.(string) + if err && len(str) == 0 { + return false + } + return true +} + +func checkUserCaseConfig(caseName string, caseConfig *dataimport.CaseConfig) { + + if len(caseConfig.Stname) == 0 { + log.Fatalf("the stname of case %s can't be empty\n", caseName) + } + + caseConfig.Stname = strings.ToLower(caseConfig.Stname) + + if len(caseConfig.Tags) == 0 { + log.Fatalf("the tags of case %s can't be empty\n", caseName) + } + + if len(caseConfig.Fields) == 0 { + log.Fatalf("the fields of case %s can't be empty\n", caseName) + } + + if len(caseConfig.SubTableName) == 0 { + log.Fatalf("the suffix of case %s can't be empty\n", caseName) + } + + caseConfig.SubTableName = strings.ToLower(caseConfig.SubTableName) + + caseConfig.Timestamp = strings.ToLower(caseConfig.Timestamp) + + var timestampExist = false + for i, field := range caseConfig.Fields { + if strings.EqualFold(field.Name, caseConfig.Timestamp) { + if strings.ToLower(field.Type) != TIMESTAMP { + log.Fatalf("case %s's primaryKey %s field type is %s, it must be timestamp\n", caseName, caseConfig.Timestamp, field.Type) + } + timestampExist = true + if i < len(caseConfig.Fields)-1 { + // delete middle item, a = a[:i+copy(a[i:], a[i+1:])] + caseConfig.Fields = caseConfig.Fields[:i+copy(caseConfig.Fields[i:], caseConfig.Fields[i+1:])] + }else { + // delete the last item + caseConfig.Fields = caseConfig.Fields[:len(caseConfig.Fields)-1] + } + break + } + } + + if !timestampExist { + log.Fatalf("case %s primaryKey %s is not exist in fields\n", caseName, caseConfig.Timestamp) + } + + caseConfig.TimestampType = strings.ToLower(caseConfig.TimestampType) + if caseConfig.TimestampType != MILLISECOND && caseConfig.TimestampType != DATETIME { + log.Fatalf("case %s's timestampType %s error, only can be timestamp or datetime\n", caseName, caseConfig.TimestampType) + } + + if caseConfig.TimestampType == DATETIME && len(caseConfig.TimestampTypeFormat) == 0 { + log.Fatalf("case %s's timestampTypeFormat %s can't be empty when timestampType is datetime\n", caseName, caseConfig.TimestampTypeFormat) + } + +} + +func parseArg() { + flag.StringVar(&cfg, "cfg", "config/cfg.toml", "configuration file which describes usecase and data format.") + flag.StringVar(&cases, "cases", "sensor_info", "usecase for dataset to be imported. Multiple choices can be separated by comma, for example, -cases sensor_info,camera_detection.") + flag.IntVar(&hnum, "hnum", 100, "magnification factor of the sample tables. For example, if hnum is 100 and in the sample data there are 10 tables, then 10x100=1000 tables will be created in the database.") + flag.IntVar(&vnum, "vnum", 1000, "copies of the sample records in each table. If set to 0,this program will never stop simulating and importing data even if the timestamp has passed current time.") + flag.Int64Var(&delay, "delay", DEFAULT_DELAY, "the delay time interval(millisecond) to continue generating data when vnum set 0.") + flag.Int64Var(&tick, "tick", 2000, "the tick time interval(millisecond) to print statistic info.") + flag.IntVar(&save, "save", 0, "whether to save the statistical info into 'statistic' table. 0 is disabled and 1 is enabled.") + flag.IntVar(&thread, "thread", 10, "number of threads to import data.") + flag.IntVar(&batch, "batch", 100, "rows of records in one import batch.") + flag.IntVar(&auto, "auto", 0, "whether to use the starttime and interval specified by users when simulating the data. 0 is disabled and 1 is enabled.") + flag.StringVar(&starttimestr, "start", "", "the starting timestamp of simulated data, in the format of yyyy-MM-dd HH:mm:ss.SSS. If not specified, the ealiest timestamp in the sample data will be set as the starttime.") + flag.Int64Var(&interval, "interval", DEFAULT_INTERVAL, "time inteval between two consecutive records, in the unit of millisecond. Only valid when auto is 1.") + flag.StringVar(&host, "host", "127.0.0.1", "tdengine server ip.") + flag.IntVar(&port, "port", 6030, "tdengine server port.") + flag.StringVar(&user, "user", "root", "user name to login into the database.") + flag.StringVar(&password, "password", "taosdata", "the import tdengine user password") + flag.IntVar(&dropdb, "dropdb", 0, "whether to drop the existing datbase. 1 is yes and 0 otherwise.") + flag.StringVar(&db, "db", "", "name of the database to store data.") + flag.StringVar(&dbparam, "dbparam", "", "database configurations when it is created.") + + flag.Parse() +} + +func printArg() { + fmt.Println("used param: ") + fmt.Println("-cfg: ", cfg) + fmt.Println("-cases:", cases) + fmt.Println("-hnum:", hnum) + fmt.Println("-vnum:", vnum) + fmt.Println("-delay:", delay) + fmt.Println("-tick:", tick) + fmt.Println("-save:", save) + fmt.Println("-thread:", thread) + fmt.Println("-batch:", batch) + fmt.Println("-auto:", auto) + fmt.Println("-start:", starttimestr) + fmt.Println("-interval:", interval) + fmt.Println("-host:", host) + fmt.Println("-port", port) + fmt.Println("-user", user) + fmt.Println("-password", password) + fmt.Println("-dropdb", dropdb) + fmt.Println("-db", db) + fmt.Println("-dbparam", dbparam) +} diff --git a/importSampleData/bin/taosimport b/importSampleData/bin/taosimport new file mode 100755 index 0000000000000000000000000000000000000000..1cb3c12926ec6657190471ea590e79f4a6b191b6 Binary files /dev/null and b/importSampleData/bin/taosimport differ diff --git a/importSampleData/config/cfg.toml b/importSampleData/config/cfg.toml new file mode 100644 index 0000000000000000000000000000000000000000..52a5d5f3169d21ce17039ead956250a636b37a01 --- /dev/null +++ b/importSampleData/config/cfg.toml @@ -0,0 +1,51 @@ +# 传感器场景 +[sensor_info] # 场景名称 +format = "csv" # 样例数据文件格式,可以是 json 或 csv,具体字段应至少包含 subTableName、tags、fields 指定的字段。 +filePath = "data/sensor_info.csv" # 样例数据文件路径,程序会循环使用该文件数据 +separator = "," # csv 样例文件中字段分隔符,默认逗号 + +stname = "sensor_info" # 超级表名称 +subTableName = "devid" # 使用样例数据中指定字段当作子表名称一部分,子表名称格式为 t_subTableName_stname,扩展表名为 t_subTableName_stname_i。 +timestamp = "ts" # 使用 fields 中哪个字段当作主键,类型必须为 timestamp +timestampType="millisecond" # 样例数据中主键时间字段是 millisecond 还是 dateTime 格式 +#timestampTypeFormat = "2006-01-02 15:04:05.000" # 主键日期时间格式,timestampType 为 dateTime 时需要指定 +tags = [ + # 标签列表,name 为标签名称,type 为标签类型 + { name = "location", type = "binary(20)" }, + { name = "color", type = "binary(16)" }, + { name = "devgroup", type = "int" }, +] + +fields = [ + # 字段列表,name 为字段名称,type 为字段类型 + { name = "ts", type = "timestamp" }, + { name = "temperature", type = "int" }, + { name = "humidity", type = "float" }, +] + +# 摄像头检测场景 +[camera_detection] # 场景名称 +format = "json" # 样例数据文件格式,可以是 json 或 csv,具体字段应至少包含 subTableName、tags、fields 指定的字段。 +filePath = "data/camera_detection.json" # 样例数据文件路径,程序会循环使用该文件数据 +#separator = "," # csv 样例文件中字段分隔符,默认逗号, 如果是 json 文件可以不用配置 + +stname = "camera_detection" # 超级表名称 +subTableName = "sensor_id" # 使用样例数据中指定字段当作子表名称一部分,子表名称格式为 t_subTableName_stname,扩展表名为 t_subTableName_stname_i。 +timestamp = "ts" # 使用 fields 中哪个字段当作主键,类型必须为 timestamp +timestampType="dateTime" # 样例数据中主键时间字段是 millisecond 还是 dateTime 格式 +timestampTypeFormat = "2006-01-02 15:04:05.000" # 主键日期时间格式,timestampType 为 dateTime 时需要指定 +tags = [ + # 标签列表,name 为标签名称,type 为标签类型 + { name = "home_id", type = "binary(30)" }, + { name = "object_type", type = "int" }, + { name = "object_kind", type = "binary(20)" }, +] + +fields = [ + # 字段列表,name 为字段名称,type 为字段类型 + { name = "ts", type = "timestamp" }, + { name = "states", type = "tinyint" }, + { name = "battery_voltage", type = "float" }, +] + +# other case \ No newline at end of file diff --git a/importSampleData/dashboard/sensor_info.json b/importSampleData/dashboard/sensor_info.json new file mode 100644 index 0000000000000000000000000000000000000000..6dcf5505f2a1a2db3a10cb9c7bed47ac5dc3687c --- /dev/null +++ b/importSampleData/dashboard/sensor_info.json @@ -0,0 +1,380 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 7, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": null, + "format": "celsius", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 6, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true, + "ymax": null, + "ymin": null + }, + "tableColumn": "", + "targets": [ + { + "alias": "lastest_temperature", + "refId": "A", + "sql": "select ts, temp from test.stream_temp_last where ts >= $from and ts < $to", + "target": "select metric", + "type": "timeserie" + } + ], + "thresholds": "20,30", + "timeFrom": null, + "timeShift": null, + "title": "最新温度", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "datasource": null, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 8, + "options": { + "fieldOptions": { + "calcs": [ + "last" + ], + "defaults": { + "decimals": 2, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ], + "title": "" + }, + "override": {}, + "values": false + }, + "orientation": "auto", + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "6.4.3", + "targets": [ + { + "alias": "maxHumidity", + "refId": "A", + "sql": "select ts, humidity from test.stream_humidity_max where ts >= $from and ts < $to", + "target": "select metric", + "type": "timeserie" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "最大湿度", + "type": "gauge" + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 4, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "avgTemperature", + "refId": "A", + "sql": "select ts, temp from test.stream_temp_avg where ts >= $from and ts < $to", + "target": "select metric", + "type": "timeserie" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "平均温度", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "celsius", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "max", + "refId": "A", + "sql": "select ts, max_temp from test.stream_sensor where ts >= $from and ts < $to", + "target": "select metric", + "type": "timeserie" + }, + { + "alias": "avg", + "refId": "B", + "sql": "select ts, avg_temp from test.stream_sensor where ts >= $from and ts < $to", + "target": "select metric", + "type": "timeserie" + }, + { + "alias": "min", + "refId": "C", + "sql": "select ts, min_temp from test.stream_sensor where ts >= $from and ts < $to", + "target": "select metric", + "type": "timeserie" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "某传感器", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "celsius", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "5s", + "schemaVersion": 20, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "sensor_info", + "uid": "dGSoaTLWz", + "version": 2 +} \ No newline at end of file diff --git a/importSampleData/data/camera_detection.json b/importSampleData/data/camera_detection.json new file mode 100644 index 0000000000000000000000000000000000000000..cf67e38fa71255fc63ada2a05f1891e2e509fc2f --- /dev/null +++ b/importSampleData/data/camera_detection.json @@ -0,0 +1,1000 @@ +{"battery_voltage":0.80233014,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:00.000"} +{"battery_voltage":0.83228004,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:01.000"} +{"battery_voltage":0.7123188,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:02.000"} +{"battery_voltage":0.5328185,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:03.000"} +{"battery_voltage":0.54848474,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:04.000"} +{"battery_voltage":0.7576063,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:05.000"} +{"battery_voltage":0.60713196,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:06.000"} +{"battery_voltage":0.65902907,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:07.000"} +{"battery_voltage":0.64151704,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:08.000"} +{"battery_voltage":0.8395423,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:09.000"} +{"battery_voltage":0.60159343,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:10.000"} +{"battery_voltage":0.7853366,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:11.000"} +{"battery_voltage":0.6465571,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:12.000"} +{"battery_voltage":0.8762865,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:13.000"} +{"battery_voltage":0.9326675,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:14.000"} +{"battery_voltage":0.76191014,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:15.000"} +{"battery_voltage":0.57916415,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:16.000"} +{"battery_voltage":0.98762083,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:17.000"} +{"battery_voltage":0.7974043,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:18.000"} +{"battery_voltage":0.8460123,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:19.000"} +{"battery_voltage":0.5866331,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:20.000"} +{"battery_voltage":0.7720778,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:21.000"} +{"battery_voltage":0.7115761,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:22.000"} +{"battery_voltage":0.62677026,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:23.000"} +{"battery_voltage":0.8943025,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:24.000"} +{"battery_voltage":0.94027156,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:25.000"} +{"battery_voltage":0.94718087,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:26.000"} +{"battery_voltage":0.9884584,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:27.000"} +{"battery_voltage":0.6111447,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:28.000"} +{"battery_voltage":0.6207575,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:29.000"} +{"battery_voltage":0.9664232,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:30.000"} +{"battery_voltage":0.9005275,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:31.000"} +{"battery_voltage":0.59146243,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:32.000"} +{"battery_voltage":0.948496,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:33.000"} +{"battery_voltage":0.98946464,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:34.000"} +{"battery_voltage":0.5454186,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:35.000"} +{"battery_voltage":0.9634934,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:36.000"} +{"battery_voltage":0.673977,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:37.000"} +{"battery_voltage":0.8554536,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:38.000"} +{"battery_voltage":0.8247447,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:39.000"} +{"battery_voltage":0.87791175,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:40.000"} +{"battery_voltage":0.56532556,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:41.000"} +{"battery_voltage":0.9481709,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:42.000"} +{"battery_voltage":0.8605739,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:43.000"} +{"battery_voltage":0.54276025,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:44.000"} +{"battery_voltage":0.8113642,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:45.000"} +{"battery_voltage":0.6184113,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:46.000"} +{"battery_voltage":0.59362304,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:47.000"} +{"battery_voltage":0.8140491,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:48.000"} +{"battery_voltage":0.6406652,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:49.000"} +{"battery_voltage":0.7174562,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:50.000"} +{"battery_voltage":0.77507347,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:51.000"} +{"battery_voltage":0.8645904,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:52.000"} +{"battery_voltage":0.5002569,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:53.000"} +{"battery_voltage":0.6999919,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:54.000"} +{"battery_voltage":0.8019891,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:55.000"} +{"battery_voltage":0.51483566,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:56.000"} +{"battery_voltage":0.5014215,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:57.000"} +{"battery_voltage":0.7949171,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:00:58.000"} +{"battery_voltage":0.90770257,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:00:59.000"} +{"battery_voltage":0.7292212,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:00.000"} +{"battery_voltage":0.5131326,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:01.000"} +{"battery_voltage":0.6248466,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:02.000"} +{"battery_voltage":0.6237333,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:03.000"} +{"battery_voltage":0.79631186,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:04.000"} +{"battery_voltage":0.84691906,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:05.000"} +{"battery_voltage":0.76960504,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:06.000"} +{"battery_voltage":0.8753815,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:07.000"} +{"battery_voltage":0.8765806,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:08.000"} +{"battery_voltage":0.6778836,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:09.000"} +{"battery_voltage":0.615915,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:10.000"} +{"battery_voltage":0.7491971,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:11.000"} +{"battery_voltage":0.51259696,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:12.000"} +{"battery_voltage":0.79469156,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:13.000"} +{"battery_voltage":0.7860434,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:14.000"} +{"battery_voltage":0.70588136,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:15.000"} +{"battery_voltage":0.7458037,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:16.000"} +{"battery_voltage":0.8986043,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:17.000"} +{"battery_voltage":0.8915175,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:18.000"} +{"battery_voltage":0.56520694,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:19.000"} +{"battery_voltage":0.86991286,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:20.000"} +{"battery_voltage":0.5491919,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:21.000"} +{"battery_voltage":0.5498648,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:22.000"} +{"battery_voltage":0.5380951,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:23.000"} +{"battery_voltage":0.57982546,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:24.000"} +{"battery_voltage":0.6613053,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:25.000"} +{"battery_voltage":0.7854258,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:26.000"} +{"battery_voltage":0.84208757,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:27.000"} +{"battery_voltage":0.7622499,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:28.000"} +{"battery_voltage":0.8581842,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:29.000"} +{"battery_voltage":0.506413,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:30.000"} +{"battery_voltage":0.54901546,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:31.000"} +{"battery_voltage":0.9132271,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":1,"ts":"2019-12-01 00:01:32.000"} +{"battery_voltage":0.6721575,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:33.000"} +{"battery_voltage":0.6082356,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:34.000"} +{"battery_voltage":0.70103544,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:35.000"} +{"battery_voltage":0.58433986,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:36.000"} +{"battery_voltage":0.91396403,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:37.000"} +{"battery_voltage":0.52896315,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:38.000"} +{"battery_voltage":0.7057702,"home_id":"603","object_kind":"night","object_type":1,"sensor_id":"s100","states":0,"ts":"2019-12-01 00:01:39.000"} +{"battery_voltage":0.89037704,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:00.000"} +{"battery_voltage":0.5267473,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:01.000"} +{"battery_voltage":0.6253811,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:02.000"} +{"battery_voltage":0.986941,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:03.000"} +{"battery_voltage":0.51076686,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:04.000"} +{"battery_voltage":0.54648507,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:05.000"} +{"battery_voltage":0.6559428,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:06.000"} +{"battery_voltage":0.7436196,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:07.000"} +{"battery_voltage":0.83591455,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:08.000"} +{"battery_voltage":0.9501376,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:09.000"} +{"battery_voltage":0.65966564,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:10.000"} +{"battery_voltage":0.7002162,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:11.000"} +{"battery_voltage":0.8225194,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:12.000"} +{"battery_voltage":0.6697984,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:13.000"} +{"battery_voltage":0.6181637,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:14.000"} +{"battery_voltage":0.51787734,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:15.000"} +{"battery_voltage":0.8129183,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:16.000"} +{"battery_voltage":0.5362242,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:17.000"} +{"battery_voltage":0.93992245,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:18.000"} +{"battery_voltage":0.92375016,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:19.000"} +{"battery_voltage":0.6239222,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:20.000"} +{"battery_voltage":0.5375186,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:21.000"} +{"battery_voltage":0.81466585,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:22.000"} +{"battery_voltage":0.8160017,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:23.000"} +{"battery_voltage":0.5074137,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:24.000"} +{"battery_voltage":0.5343781,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:25.000"} +{"battery_voltage":0.8245942,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:26.000"} +{"battery_voltage":0.91740286,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:27.000"} +{"battery_voltage":0.8306966,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:28.000"} +{"battery_voltage":0.65525514,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:29.000"} +{"battery_voltage":0.9835472,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:30.000"} +{"battery_voltage":0.6547742,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:31.000"} +{"battery_voltage":0.7086629,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:32.000"} +{"battery_voltage":0.70336837,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:33.000"} +{"battery_voltage":0.9790882,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:34.000"} +{"battery_voltage":0.8958361,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:35.000"} +{"battery_voltage":0.50759065,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:36.000"} +{"battery_voltage":0.9523881,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:37.000"} +{"battery_voltage":0.52146083,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:38.000"} +{"battery_voltage":0.6739295,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:39.000"} +{"battery_voltage":0.91997373,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:40.000"} +{"battery_voltage":0.5621818,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:41.000"} +{"battery_voltage":0.9174738,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:42.000"} +{"battery_voltage":0.5038406,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:43.000"} +{"battery_voltage":0.68513376,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:44.000"} +{"battery_voltage":0.821602,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:45.000"} +{"battery_voltage":0.89556265,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:46.000"} +{"battery_voltage":0.67343193,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:47.000"} +{"battery_voltage":0.91104645,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:48.000"} +{"battery_voltage":0.79959714,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:49.000"} +{"battery_voltage":0.7067905,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:50.000"} +{"battery_voltage":0.95580685,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:51.000"} +{"battery_voltage":0.6144588,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:52.000"} +{"battery_voltage":0.67538255,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:53.000"} +{"battery_voltage":0.65190107,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:54.000"} +{"battery_voltage":0.8357633,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:55.000"} +{"battery_voltage":0.9815697,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:56.000"} +{"battery_voltage":0.90397054,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:57.000"} +{"battery_voltage":0.9738802,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:00:58.000"} +{"battery_voltage":0.9766294,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:00:59.000"} +{"battery_voltage":0.5907954,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:00.000"} +{"battery_voltage":0.9156205,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:01.000"} +{"battery_voltage":0.92765516,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:02.000"} +{"battery_voltage":0.63674736,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:03.000"} +{"battery_voltage":0.95488065,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:04.000"} +{"battery_voltage":0.7493162,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:05.000"} +{"battery_voltage":0.98794764,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:06.000"} +{"battery_voltage":0.5224953,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:07.000"} +{"battery_voltage":0.9759531,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:08.000"} +{"battery_voltage":0.76789546,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:09.000"} +{"battery_voltage":0.9325875,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:10.000"} +{"battery_voltage":0.7892754,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:11.000"} +{"battery_voltage":0.7753079,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:12.000"} +{"battery_voltage":0.7549327,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:13.000"} +{"battery_voltage":0.745397,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:14.000"} +{"battery_voltage":0.6312453,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:15.000"} +{"battery_voltage":0.68574333,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:16.000"} +{"battery_voltage":0.70787597,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:17.000"} +{"battery_voltage":0.9508138,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:18.000"} +{"battery_voltage":0.6369623,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:19.000"} +{"battery_voltage":0.92772424,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:20.000"} +{"battery_voltage":0.9945661,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:21.000"} +{"battery_voltage":0.585473,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:22.000"} +{"battery_voltage":0.7667257,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:23.000"} +{"battery_voltage":0.9067954,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:24.000"} +{"battery_voltage":0.62860376,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:25.000"} +{"battery_voltage":0.66754717,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:26.000"} +{"battery_voltage":0.5024399,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:27.000"} +{"battery_voltage":0.6147868,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:28.000"} +{"battery_voltage":0.9749687,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:29.000"} +{"battery_voltage":0.9813121,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:30.000"} +{"battery_voltage":0.85633135,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:31.000"} +{"battery_voltage":0.70376605,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:32.000"} +{"battery_voltage":0.6737342,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:33.000"} +{"battery_voltage":0.79878306,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:34.000"} +{"battery_voltage":0.91642797,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:35.000"} +{"battery_voltage":0.96835375,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:36.000"} +{"battery_voltage":0.86015654,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:37.000"} +{"battery_voltage":0.725077,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":0,"ts":"2019-12-01 00:01:38.000"} +{"battery_voltage":0.736246,"home_id":"604","object_kind":"day","object_type":2,"sensor_id":"s101","states":1,"ts":"2019-12-01 00:01:39.000"} +{"battery_voltage":0.68116575,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:00.000"} +{"battery_voltage":0.5239342,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:01.000"} +{"battery_voltage":0.8781051,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:02.000"} +{"battery_voltage":0.61049944,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:03.000"} +{"battery_voltage":0.6954212,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:04.000"} +{"battery_voltage":0.57484275,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:05.000"} +{"battery_voltage":0.88279426,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:06.000"} +{"battery_voltage":0.727722,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:07.000"} +{"battery_voltage":0.54098475,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:08.000"} +{"battery_voltage":0.6331909,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:09.000"} +{"battery_voltage":0.5495351,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:10.000"} +{"battery_voltage":0.57960176,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:11.000"} +{"battery_voltage":0.8157383,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:12.000"} +{"battery_voltage":0.9837526,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:13.000"} +{"battery_voltage":0.66909057,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:14.000"} +{"battery_voltage":0.918733,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:15.000"} +{"battery_voltage":0.75111043,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:16.000"} +{"battery_voltage":0.73151976,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:17.000"} +{"battery_voltage":0.87203634,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:18.000"} +{"battery_voltage":0.6242085,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:19.000"} +{"battery_voltage":0.7118511,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:20.000"} +{"battery_voltage":0.8284241,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:21.000"} +{"battery_voltage":0.81839544,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:22.000"} +{"battery_voltage":0.6934307,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:23.000"} +{"battery_voltage":0.5631822,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:24.000"} +{"battery_voltage":0.7556696,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:25.000"} +{"battery_voltage":0.9973032,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:26.000"} +{"battery_voltage":0.8636595,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:27.000"} +{"battery_voltage":0.7570118,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:28.000"} +{"battery_voltage":0.7728013,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:29.000"} +{"battery_voltage":0.6466422,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:30.000"} +{"battery_voltage":0.57088935,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:31.000"} +{"battery_voltage":0.8156741,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:32.000"} +{"battery_voltage":0.5007058,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:33.000"} +{"battery_voltage":0.94389606,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:34.000"} +{"battery_voltage":0.7980893,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:35.000"} +{"battery_voltage":0.9149192,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:36.000"} +{"battery_voltage":0.5329674,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:37.000"} +{"battery_voltage":0.667759,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:38.000"} +{"battery_voltage":0.8095149,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:39.000"} +{"battery_voltage":0.66232204,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:40.000"} +{"battery_voltage":0.54209346,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:41.000"} +{"battery_voltage":0.8437841,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:42.000"} +{"battery_voltage":0.51106554,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:43.000"} +{"battery_voltage":0.5391229,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:44.000"} +{"battery_voltage":0.6142876,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:45.000"} +{"battery_voltage":0.63602245,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:46.000"} +{"battery_voltage":0.83091503,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:47.000"} +{"battery_voltage":0.98437226,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:48.000"} +{"battery_voltage":0.6822,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:49.000"} +{"battery_voltage":0.60308766,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:50.000"} +{"battery_voltage":0.88321567,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:51.000"} +{"battery_voltage":0.64395475,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:52.000"} +{"battery_voltage":0.726102,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:53.000"} +{"battery_voltage":0.6945282,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:54.000"} +{"battery_voltage":0.5037642,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:55.000"} +{"battery_voltage":0.50224465,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:56.000"} +{"battery_voltage":0.61892045,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:57.000"} +{"battery_voltage":0.8965783,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:00:58.000"} +{"battery_voltage":0.72004735,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:00:59.000"} +{"battery_voltage":0.89201033,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:00.000"} +{"battery_voltage":0.55109394,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:01.000"} +{"battery_voltage":0.5819292,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:02.000"} +{"battery_voltage":0.56059873,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:03.000"} +{"battery_voltage":0.99916655,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:04.000"} +{"battery_voltage":0.5516443,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:05.000"} +{"battery_voltage":0.65729505,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:06.000"} +{"battery_voltage":0.57163346,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:07.000"} +{"battery_voltage":0.843902,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:08.000"} +{"battery_voltage":0.51640797,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:09.000"} +{"battery_voltage":0.6674092,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:10.000"} +{"battery_voltage":0.67429006,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:11.000"} +{"battery_voltage":0.95735073,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:12.000"} +{"battery_voltage":0.5792276,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:13.000"} +{"battery_voltage":0.63157403,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:14.000"} +{"battery_voltage":0.59447736,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:15.000"} +{"battery_voltage":0.8206818,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:16.000"} +{"battery_voltage":0.8141984,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:17.000"} +{"battery_voltage":0.66849256,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:18.000"} +{"battery_voltage":0.71412754,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:19.000"} +{"battery_voltage":0.6733996,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:20.000"} +{"battery_voltage":0.9024965,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:21.000"} +{"battery_voltage":0.6886468,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:22.000"} +{"battery_voltage":0.7236516,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:23.000"} +{"battery_voltage":0.5494264,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:24.000"} +{"battery_voltage":0.51326233,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:25.000"} +{"battery_voltage":0.89173627,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:26.000"} +{"battery_voltage":0.98756754,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:27.000"} +{"battery_voltage":0.7213226,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:28.000"} +{"battery_voltage":0.8062184,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:29.000"} +{"battery_voltage":0.5482464,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:30.000"} +{"battery_voltage":0.61909574,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:31.000"} +{"battery_voltage":0.7190039,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:32.000"} +{"battery_voltage":0.60273135,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:33.000"} +{"battery_voltage":0.7350895,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":1,"ts":"2019-12-01 00:01:34.000"} +{"battery_voltage":0.5447789,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:35.000"} +{"battery_voltage":0.509202,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:36.000"} +{"battery_voltage":0.97541416,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:37.000"} +{"battery_voltage":0.7516321,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:38.000"} +{"battery_voltage":0.7726933,"home_id":"605","object_kind":"all","object_type":3,"sensor_id":"s102","states":0,"ts":"2019-12-01 00:01:39.000"} +{"battery_voltage":0.60115623,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:00.000"} +{"battery_voltage":0.9755862,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:01.000"} +{"battery_voltage":0.9823349,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:02.000"} +{"battery_voltage":0.6357885,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:03.000"} +{"battery_voltage":0.6279355,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:04.000"} +{"battery_voltage":0.59463865,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:05.000"} +{"battery_voltage":0.67826885,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:06.000"} +{"battery_voltage":0.8077018,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:07.000"} +{"battery_voltage":0.8912208,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:08.000"} +{"battery_voltage":0.8821316,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:09.000"} +{"battery_voltage":0.56158596,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:10.000"} +{"battery_voltage":0.76752067,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:11.000"} +{"battery_voltage":0.6092849,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:12.000"} +{"battery_voltage":0.8139862,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:13.000"} +{"battery_voltage":0.7290665,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:14.000"} +{"battery_voltage":0.93346804,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:15.000"} +{"battery_voltage":0.7031946,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:16.000"} +{"battery_voltage":0.73181903,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:17.000"} +{"battery_voltage":0.8115653,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:18.000"} +{"battery_voltage":0.66609514,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:19.000"} +{"battery_voltage":0.8918715,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:20.000"} +{"battery_voltage":0.89229536,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:21.000"} +{"battery_voltage":0.6547448,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:22.000"} +{"battery_voltage":0.5263817,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:23.000"} +{"battery_voltage":0.69104654,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:24.000"} +{"battery_voltage":0.64589655,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:25.000"} +{"battery_voltage":0.7149786,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:26.000"} +{"battery_voltage":0.6625407,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:27.000"} +{"battery_voltage":0.7064498,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:28.000"} +{"battery_voltage":0.8864048,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:29.000"} +{"battery_voltage":0.56908727,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:30.000"} +{"battery_voltage":0.66720784,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:31.000"} +{"battery_voltage":0.8207879,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:32.000"} +{"battery_voltage":0.7704214,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:33.000"} +{"battery_voltage":0.74916565,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:34.000"} +{"battery_voltage":0.53460443,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:35.000"} +{"battery_voltage":0.70717573,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:36.000"} +{"battery_voltage":0.9661542,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:37.000"} +{"battery_voltage":0.8559648,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:38.000"} +{"battery_voltage":0.5753055,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:39.000"} +{"battery_voltage":0.8062254,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:40.000"} +{"battery_voltage":0.8050467,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:41.000"} +{"battery_voltage":0.5420858,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:42.000"} +{"battery_voltage":0.89997375,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:43.000"} +{"battery_voltage":0.5517962,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:44.000"} +{"battery_voltage":0.7491184,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:45.000"} +{"battery_voltage":0.9720428,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:46.000"} +{"battery_voltage":0.8925575,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:47.000"} +{"battery_voltage":0.80679524,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:48.000"} +{"battery_voltage":0.80774236,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:49.000"} +{"battery_voltage":0.53613126,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:50.000"} +{"battery_voltage":0.9552542,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:51.000"} +{"battery_voltage":0.9303039,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:52.000"} +{"battery_voltage":0.9168983,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:53.000"} +{"battery_voltage":0.78906983,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:54.000"} +{"battery_voltage":0.5393992,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:55.000"} +{"battery_voltage":0.7752098,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:56.000"} +{"battery_voltage":0.7393297,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:00:57.000"} +{"battery_voltage":0.5901948,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:58.000"} +{"battery_voltage":0.82910055,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:00:59.000"} +{"battery_voltage":0.88593745,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:00.000"} +{"battery_voltage":0.60122955,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:01.000"} +{"battery_voltage":0.878977,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:02.000"} +{"battery_voltage":0.75698256,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:03.000"} +{"battery_voltage":0.50624055,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:04.000"} +{"battery_voltage":0.9885113,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:05.000"} +{"battery_voltage":0.74340963,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:06.000"} +{"battery_voltage":0.9759798,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:07.000"} +{"battery_voltage":0.73438704,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:08.000"} +{"battery_voltage":0.7121439,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:09.000"} +{"battery_voltage":0.7707707,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:10.000"} +{"battery_voltage":0.8732446,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:11.000"} +{"battery_voltage":0.8968997,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:12.000"} +{"battery_voltage":0.82115555,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:13.000"} +{"battery_voltage":0.85465467,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:14.000"} +{"battery_voltage":0.7902354,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:15.000"} +{"battery_voltage":0.50993747,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:16.000"} +{"battery_voltage":0.8614131,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:17.000"} +{"battery_voltage":0.92145103,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:18.000"} +{"battery_voltage":0.9863989,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:19.000"} +{"battery_voltage":0.58747536,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:20.000"} +{"battery_voltage":0.8356127,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:21.000"} +{"battery_voltage":0.8804123,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:22.000"} +{"battery_voltage":0.54516625,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:23.000"} +{"battery_voltage":0.54958564,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:24.000"} +{"battery_voltage":0.5939968,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:25.000"} +{"battery_voltage":0.5792352,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:26.000"} +{"battery_voltage":0.5488316,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:27.000"} +{"battery_voltage":0.9730228,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:28.000"} +{"battery_voltage":0.5745121,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:29.000"} +{"battery_voltage":0.8696457,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:30.000"} +{"battery_voltage":0.94995236,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:31.000"} +{"battery_voltage":0.9038729,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:32.000"} +{"battery_voltage":0.7729239,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:33.000"} +{"battery_voltage":0.6789726,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:34.000"} +{"battery_voltage":0.8997017,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:35.000"} +{"battery_voltage":0.72364557,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:36.000"} +{"battery_voltage":0.88753945,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":0,"ts":"2019-12-01 00:01:37.000"} +{"battery_voltage":0.7016446,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:38.000"} +{"battery_voltage":0.53595066,"home_id":"606","object_kind":"night","object_type":1,"sensor_id":"s103","states":1,"ts":"2019-12-01 00:01:39.000"} +{"battery_voltage":0.8033614,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:00.000"} +{"battery_voltage":0.8147938,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:01.000"} +{"battery_voltage":0.6050153,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:02.000"} +{"battery_voltage":0.7920519,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:03.000"} +{"battery_voltage":0.733798,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:04.000"} +{"battery_voltage":0.7512984,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:05.000"} +{"battery_voltage":0.972511,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:06.000"} +{"battery_voltage":0.8678342,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:07.000"} +{"battery_voltage":0.5627333,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:08.000"} +{"battery_voltage":0.50696725,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:09.000"} +{"battery_voltage":0.7697411,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:10.000"} +{"battery_voltage":0.7384832,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:11.000"} +{"battery_voltage":0.57802075,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:12.000"} +{"battery_voltage":0.6342828,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:13.000"} +{"battery_voltage":0.8889152,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:14.000"} +{"battery_voltage":0.7986384,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:15.000"} +{"battery_voltage":0.7695893,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:16.000"} +{"battery_voltage":0.6342156,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:17.000"} +{"battery_voltage":0.82402253,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:18.000"} +{"battery_voltage":0.9537116,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:19.000"} +{"battery_voltage":0.85123,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:20.000"} +{"battery_voltage":0.94443214,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:21.000"} +{"battery_voltage":0.81446874,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:22.000"} +{"battery_voltage":0.5079787,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:23.000"} +{"battery_voltage":0.82231855,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:24.000"} +{"battery_voltage":0.54318166,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:25.000"} +{"battery_voltage":0.887102,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:26.000"} +{"battery_voltage":0.7985031,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:27.000"} +{"battery_voltage":0.9324222,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:28.000"} +{"battery_voltage":0.9568784,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:29.000"} +{"battery_voltage":0.84419024,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:30.000"} +{"battery_voltage":0.63686687,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:31.000"} +{"battery_voltage":0.862638,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:32.000"} +{"battery_voltage":0.63915664,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:33.000"} +{"battery_voltage":0.94823104,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:34.000"} +{"battery_voltage":0.80180836,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:35.000"} +{"battery_voltage":0.56163365,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:36.000"} +{"battery_voltage":0.60698605,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:37.000"} +{"battery_voltage":0.90496016,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:38.000"} +{"battery_voltage":0.79479086,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:39.000"} +{"battery_voltage":0.5411746,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:40.000"} +{"battery_voltage":0.7360853,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:41.000"} +{"battery_voltage":0.8097295,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:42.000"} +{"battery_voltage":0.7171494,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:43.000"} +{"battery_voltage":0.849315,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:44.000"} +{"battery_voltage":0.663502,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:45.000"} +{"battery_voltage":0.51946706,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:46.000"} +{"battery_voltage":0.85430115,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:47.000"} +{"battery_voltage":0.82286215,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:48.000"} +{"battery_voltage":0.9102302,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:49.000"} +{"battery_voltage":0.94066036,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:50.000"} +{"battery_voltage":0.8434773,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:51.000"} +{"battery_voltage":0.95908654,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:52.000"} +{"battery_voltage":0.5931864,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:53.000"} +{"battery_voltage":0.9871588,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:54.000"} +{"battery_voltage":0.8742759,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:55.000"} +{"battery_voltage":0.50797683,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:56.000"} +{"battery_voltage":0.56906056,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:57.000"} +{"battery_voltage":0.9103812,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:00:58.000"} +{"battery_voltage":0.61753106,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:00:59.000"} +{"battery_voltage":0.7401742,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:00.000"} +{"battery_voltage":0.95390666,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:01.000"} +{"battery_voltage":0.5069772,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:02.000"} +{"battery_voltage":0.51301944,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:03.000"} +{"battery_voltage":0.72201246,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:04.000"} +{"battery_voltage":0.8913778,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:05.000"} +{"battery_voltage":0.976287,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:06.000"} +{"battery_voltage":0.991058,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:07.000"} +{"battery_voltage":0.99977124,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:08.000"} +{"battery_voltage":0.7334305,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:09.000"} +{"battery_voltage":0.552872,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:10.000"} +{"battery_voltage":0.7832855,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:11.000"} +{"battery_voltage":0.70349,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:12.000"} +{"battery_voltage":0.964519,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:13.000"} +{"battery_voltage":0.74284106,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:14.000"} +{"battery_voltage":0.66428864,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:15.000"} +{"battery_voltage":0.5493044,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:16.000"} +{"battery_voltage":0.74065554,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:17.000"} +{"battery_voltage":0.96337205,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:18.000"} +{"battery_voltage":0.67027295,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:19.000"} +{"battery_voltage":0.81034344,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:20.000"} +{"battery_voltage":0.6549411,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:21.000"} +{"battery_voltage":0.5835841,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:22.000"} +{"battery_voltage":0.96476233,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:23.000"} +{"battery_voltage":0.7508897,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:24.000"} +{"battery_voltage":0.5903082,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:25.000"} +{"battery_voltage":0.7541075,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:26.000"} +{"battery_voltage":0.8509584,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:27.000"} +{"battery_voltage":0.58535063,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:28.000"} +{"battery_voltage":0.51696,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:29.000"} +{"battery_voltage":0.8245963,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:30.000"} +{"battery_voltage":0.5676064,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:31.000"} +{"battery_voltage":0.9954416,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:32.000"} +{"battery_voltage":0.6617937,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:33.000"} +{"battery_voltage":0.5499162,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:34.000"} +{"battery_voltage":0.64593154,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":1,"ts":"2019-12-01 00:01:35.000"} +{"battery_voltage":0.946115,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:36.000"} +{"battery_voltage":0.5849637,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:37.000"} +{"battery_voltage":0.68064904,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:38.000"} +{"battery_voltage":0.8852545,"home_id":"603","object_kind":"day","object_type":2,"sensor_id":"s104","states":0,"ts":"2019-12-01 00:01:39.000"} +{"battery_voltage":0.70754087,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:00.000"} +{"battery_voltage":0.6483855,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:01.000"} +{"battery_voltage":0.5671366,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:02.000"} +{"battery_voltage":0.76337266,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:03.000"} +{"battery_voltage":0.9920288,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:04.000"} +{"battery_voltage":0.5574518,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:05.000"} +{"battery_voltage":0.59904534,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:06.000"} +{"battery_voltage":0.6480302,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:07.000"} +{"battery_voltage":0.63429725,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:08.000"} +{"battery_voltage":0.85299885,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:09.000"} +{"battery_voltage":0.77297366,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:10.000"} +{"battery_voltage":0.7668507,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:11.000"} +{"battery_voltage":0.57824785,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:12.000"} +{"battery_voltage":0.76801443,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:13.000"} +{"battery_voltage":0.8984245,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:14.000"} +{"battery_voltage":0.52167296,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:15.000"} +{"battery_voltage":0.8797653,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:16.000"} +{"battery_voltage":0.70621747,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:17.000"} +{"battery_voltage":0.8416389,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:18.000"} +{"battery_voltage":0.5681568,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:19.000"} +{"battery_voltage":0.9125648,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:20.000"} +{"battery_voltage":0.5100865,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:21.000"} +{"battery_voltage":0.9596597,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:22.000"} +{"battery_voltage":0.5011256,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:23.000"} +{"battery_voltage":0.8343365,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:24.000"} +{"battery_voltage":0.64652085,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:25.000"} +{"battery_voltage":0.6358192,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:26.000"} +{"battery_voltage":0.92160124,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:27.000"} +{"battery_voltage":0.909333,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:28.000"} +{"battery_voltage":0.95970964,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:29.000"} +{"battery_voltage":0.94331,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:30.000"} +{"battery_voltage":0.65175146,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:31.000"} +{"battery_voltage":0.69886935,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:32.000"} +{"battery_voltage":0.9866854,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:33.000"} +{"battery_voltage":0.5484814,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:34.000"} +{"battery_voltage":0.6101544,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:35.000"} +{"battery_voltage":0.8419212,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:36.000"} +{"battery_voltage":0.6960639,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:37.000"} +{"battery_voltage":0.8068489,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:38.000"} +{"battery_voltage":0.68448293,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:39.000"} +{"battery_voltage":0.8672006,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:40.000"} +{"battery_voltage":0.9113866,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:41.000"} +{"battery_voltage":0.8871064,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:42.000"} +{"battery_voltage":0.96817946,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:43.000"} +{"battery_voltage":0.5816642,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:44.000"} +{"battery_voltage":0.6309987,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:45.000"} +{"battery_voltage":0.9452791,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:46.000"} +{"battery_voltage":0.98369205,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:47.000"} +{"battery_voltage":0.7123141,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:48.000"} +{"battery_voltage":0.9546062,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:49.000"} +{"battery_voltage":0.92401385,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:50.000"} +{"battery_voltage":0.59127367,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:51.000"} +{"battery_voltage":0.87045366,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:52.000"} +{"battery_voltage":0.8465115,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:53.000"} +{"battery_voltage":0.91188776,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:54.000"} +{"battery_voltage":0.61064494,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:55.000"} +{"battery_voltage":0.84154475,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:00:56.000"} +{"battery_voltage":0.69890535,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:57.000"} +{"battery_voltage":0.57661706,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:58.000"} +{"battery_voltage":0.89222425,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:00:59.000"} +{"battery_voltage":0.56609154,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:00.000"} +{"battery_voltage":0.9224727,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:01.000"} +{"battery_voltage":0.8360301,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:02.000"} +{"battery_voltage":0.91405284,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:03.000"} +{"battery_voltage":0.8875489,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:04.000"} +{"battery_voltage":0.6775255,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:05.000"} +{"battery_voltage":0.71002764,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:06.000"} +{"battery_voltage":0.7901696,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:07.000"} +{"battery_voltage":0.84012544,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:08.000"} +{"battery_voltage":0.7698927,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:09.000"} +{"battery_voltage":0.6951759,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:10.000"} +{"battery_voltage":0.5941455,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:11.000"} +{"battery_voltage":0.8753067,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:12.000"} +{"battery_voltage":0.8527192,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:13.000"} +{"battery_voltage":0.7162281,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:14.000"} +{"battery_voltage":0.96830696,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:15.000"} +{"battery_voltage":0.82742965,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:16.000"} +{"battery_voltage":0.62583256,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:17.000"} +{"battery_voltage":0.8133428,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:18.000"} +{"battery_voltage":0.73012495,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:19.000"} +{"battery_voltage":0.8870168,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:20.000"} +{"battery_voltage":0.592625,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:21.000"} +{"battery_voltage":0.58833945,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:22.000"} +{"battery_voltage":0.6206717,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:23.000"} +{"battery_voltage":0.6431462,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:24.000"} +{"battery_voltage":0.8724054,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:25.000"} +{"battery_voltage":0.79947186,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:26.000"} +{"battery_voltage":0.9971847,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:27.000"} +{"battery_voltage":0.9268321,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:28.000"} +{"battery_voltage":0.82837874,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:29.000"} +{"battery_voltage":0.5304892,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:30.000"} +{"battery_voltage":0.6329912,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:31.000"} +{"battery_voltage":0.90618366,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:32.000"} +{"battery_voltage":0.5784858,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:33.000"} +{"battery_voltage":0.7942324,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:34.000"} +{"battery_voltage":0.6310129,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:35.000"} +{"battery_voltage":0.9656929,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:36.000"} +{"battery_voltage":0.9464745,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:37.000"} +{"battery_voltage":0.5906156,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":0,"ts":"2019-12-01 00:01:38.000"} +{"battery_voltage":0.57623565,"home_id":"604","object_kind":"all","object_type":3,"sensor_id":"s105","states":1,"ts":"2019-12-01 00:01:39.000"} +{"battery_voltage":0.8002974,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:00.000"} +{"battery_voltage":0.65368044,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:01.000"} +{"battery_voltage":0.71293247,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:02.000"} +{"battery_voltage":0.9082031,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:03.000"} +{"battery_voltage":0.7811729,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:04.000"} +{"battery_voltage":0.96570766,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:05.000"} +{"battery_voltage":0.8413833,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:06.000"} +{"battery_voltage":0.5964865,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:07.000"} +{"battery_voltage":0.8187906,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:08.000"} +{"battery_voltage":0.95528543,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:09.000"} +{"battery_voltage":0.8641478,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:10.000"} +{"battery_voltage":0.9830004,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:11.000"} +{"battery_voltage":0.88352764,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:12.000"} +{"battery_voltage":0.9232228,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:13.000"} +{"battery_voltage":0.95486975,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:14.000"} +{"battery_voltage":0.94609356,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:15.000"} +{"battery_voltage":0.61100274,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:16.000"} +{"battery_voltage":0.5691416,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:17.000"} +{"battery_voltage":0.9360826,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:18.000"} +{"battery_voltage":0.8925245,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:19.000"} +{"battery_voltage":0.6242925,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:20.000"} +{"battery_voltage":0.7285948,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:21.000"} +{"battery_voltage":0.74059856,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:22.000"} +{"battery_voltage":0.64874685,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:23.000"} +{"battery_voltage":0.7564658,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:24.000"} +{"battery_voltage":0.98491573,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:25.000"} +{"battery_voltage":0.598005,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:26.000"} +{"battery_voltage":0.88058275,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:27.000"} +{"battery_voltage":0.54105055,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:28.000"} +{"battery_voltage":0.93672323,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:29.000"} +{"battery_voltage":0.82872415,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:30.000"} +{"battery_voltage":0.6971599,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:31.000"} +{"battery_voltage":0.6769042,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:32.000"} +{"battery_voltage":0.6805867,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:33.000"} +{"battery_voltage":0.6872542,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:34.000"} +{"battery_voltage":0.82297754,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:35.000"} +{"battery_voltage":0.81444764,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:36.000"} +{"battery_voltage":0.69297683,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:37.000"} +{"battery_voltage":0.8391928,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:38.000"} +{"battery_voltage":0.80736417,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:39.000"} +{"battery_voltage":0.7868073,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:40.000"} +{"battery_voltage":0.77172005,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:41.000"} +{"battery_voltage":0.5137727,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:42.000"} +{"battery_voltage":0.95526296,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:43.000"} +{"battery_voltage":0.938064,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:44.000"} +{"battery_voltage":0.9020388,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:45.000"} +{"battery_voltage":0.9114888,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:46.000"} +{"battery_voltage":0.6880104,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:47.000"} +{"battery_voltage":0.9375304,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:48.000"} +{"battery_voltage":0.7244901,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:49.000"} +{"battery_voltage":0.82105714,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:50.000"} +{"battery_voltage":0.6234149,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:51.000"} +{"battery_voltage":0.92923963,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:52.000"} +{"battery_voltage":0.6733919,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:53.000"} +{"battery_voltage":0.76741683,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:54.000"} +{"battery_voltage":0.5319273,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:00:55.000"} +{"battery_voltage":0.68805224,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:56.000"} +{"battery_voltage":0.7300814,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:57.000"} +{"battery_voltage":0.6131429,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:58.000"} +{"battery_voltage":0.6922425,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:00:59.000"} +{"battery_voltage":0.9727907,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:00.000"} +{"battery_voltage":0.82986295,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:01.000"} +{"battery_voltage":0.5132921,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:02.000"} +{"battery_voltage":0.77134275,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:03.000"} +{"battery_voltage":0.5777383,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:04.000"} +{"battery_voltage":0.7101292,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:05.000"} +{"battery_voltage":0.6752328,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:06.000"} +{"battery_voltage":0.6355128,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:07.000"} +{"battery_voltage":0.9268579,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:08.000"} +{"battery_voltage":0.8940948,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:09.000"} +{"battery_voltage":0.8045571,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:10.000"} +{"battery_voltage":0.6397352,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:11.000"} +{"battery_voltage":0.5142179,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:12.000"} +{"battery_voltage":0.57437795,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:13.000"} +{"battery_voltage":0.5779674,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:14.000"} +{"battery_voltage":0.5777746,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:15.000"} +{"battery_voltage":0.79977393,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:16.000"} +{"battery_voltage":0.91564786,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:17.000"} +{"battery_voltage":0.83601356,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:18.000"} +{"battery_voltage":0.60413766,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:19.000"} +{"battery_voltage":0.98716986,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:20.000"} +{"battery_voltage":0.93296355,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:21.000"} +{"battery_voltage":0.90041673,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:22.000"} +{"battery_voltage":0.5376759,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:23.000"} +{"battery_voltage":0.71533316,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:24.000"} +{"battery_voltage":0.69811344,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:25.000"} +{"battery_voltage":0.9715346,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:26.000"} +{"battery_voltage":0.9206581,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:27.000"} +{"battery_voltage":0.8165749,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:28.000"} +{"battery_voltage":0.6838542,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:29.000"} +{"battery_voltage":0.87848604,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:30.000"} +{"battery_voltage":0.67027926,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:31.000"} +{"battery_voltage":0.90292645,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:32.000"} +{"battery_voltage":0.58885974,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:33.000"} +{"battery_voltage":0.6755761,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:34.000"} +{"battery_voltage":0.58424705,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:35.000"} +{"battery_voltage":0.8706522,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:36.000"} +{"battery_voltage":0.5665725,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:37.000"} +{"battery_voltage":0.8853537,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":0,"ts":"2019-12-01 00:01:38.000"} +{"battery_voltage":0.74042374,"home_id":"605","object_kind":"night","object_type":1,"sensor_id":"s106","states":1,"ts":"2019-12-01 00:01:39.000"} +{"battery_voltage":0.7546813,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:00.000"} +{"battery_voltage":0.6428457,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:01.000"} +{"battery_voltage":0.8217722,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:02.000"} +{"battery_voltage":0.5497275,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:03.000"} +{"battery_voltage":0.549164,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:04.000"} +{"battery_voltage":0.99488986,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:05.000"} +{"battery_voltage":0.65951693,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:06.000"} +{"battery_voltage":0.98187494,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:07.000"} +{"battery_voltage":0.51635957,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:08.000"} +{"battery_voltage":0.71983063,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:09.000"} +{"battery_voltage":0.9287454,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:10.000"} +{"battery_voltage":0.764307,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:11.000"} +{"battery_voltage":0.7559774,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:12.000"} +{"battery_voltage":0.8555727,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:13.000"} +{"battery_voltage":0.74285305,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:14.000"} +{"battery_voltage":0.8345988,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:15.000"} +{"battery_voltage":0.80865055,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:16.000"} +{"battery_voltage":0.6373774,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:17.000"} +{"battery_voltage":0.70070326,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:18.000"} +{"battery_voltage":0.7702416,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:19.000"} +{"battery_voltage":0.8708988,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:20.000"} +{"battery_voltage":0.7460189,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:21.000"} +{"battery_voltage":0.8054011,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:22.000"} +{"battery_voltage":0.70088184,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:23.000"} +{"battery_voltage":0.97855425,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:24.000"} +{"battery_voltage":0.92553365,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:25.000"} +{"battery_voltage":0.8004091,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:26.000"} +{"battery_voltage":0.58621615,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:27.000"} +{"battery_voltage":0.8544398,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:28.000"} +{"battery_voltage":0.93507946,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:29.000"} +{"battery_voltage":0.981555,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:30.000"} +{"battery_voltage":0.6559863,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:31.000"} +{"battery_voltage":0.589917,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:32.000"} +{"battery_voltage":0.77023107,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:33.000"} +{"battery_voltage":0.8414885,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:34.000"} +{"battery_voltage":0.92723155,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:35.000"} +{"battery_voltage":0.68667865,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:36.000"} +{"battery_voltage":0.6563879,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:37.000"} +{"battery_voltage":0.5494162,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:38.000"} +{"battery_voltage":0.73033655,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:39.000"} +{"battery_voltage":0.8967389,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:40.000"} +{"battery_voltage":0.93003184,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:41.000"} +{"battery_voltage":0.5939365,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:42.000"} +{"battery_voltage":0.8320396,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:43.000"} +{"battery_voltage":0.99154466,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:44.000"} +{"battery_voltage":0.9142281,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:45.000"} +{"battery_voltage":0.9949862,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:46.000"} +{"battery_voltage":0.7782185,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:47.000"} +{"battery_voltage":0.5089121,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:48.000"} +{"battery_voltage":0.73104143,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:49.000"} +{"battery_voltage":0.8676681,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:50.000"} +{"battery_voltage":0.6835471,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:51.000"} +{"battery_voltage":0.7104448,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:52.000"} +{"battery_voltage":0.8338785,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:53.000"} +{"battery_voltage":0.78650606,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:54.000"} +{"battery_voltage":0.86156666,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:55.000"} +{"battery_voltage":0.67074865,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:56.000"} +{"battery_voltage":0.92131823,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:57.000"} +{"battery_voltage":0.6692456,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:00:58.000"} +{"battery_voltage":0.70075643,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:00:59.000"} +{"battery_voltage":0.810084,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:00.000"} +{"battery_voltage":0.5218424,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:01.000"} +{"battery_voltage":0.66221285,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:02.000"} +{"battery_voltage":0.8589293,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:03.000"} +{"battery_voltage":0.85367,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:04.000"} +{"battery_voltage":0.76111495,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:05.000"} +{"battery_voltage":0.5683803,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:06.000"} +{"battery_voltage":0.965793,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:07.000"} +{"battery_voltage":0.97445166,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:08.000"} +{"battery_voltage":0.64657986,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:09.000"} +{"battery_voltage":0.8598856,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:10.000"} +{"battery_voltage":0.9699453,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:11.000"} +{"battery_voltage":0.77614653,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:12.000"} +{"battery_voltage":0.73633116,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:13.000"} +{"battery_voltage":0.66921216,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:14.000"} +{"battery_voltage":0.61229855,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:15.000"} +{"battery_voltage":0.9456196,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:16.000"} +{"battery_voltage":0.8569248,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:17.000"} +{"battery_voltage":0.5586567,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:18.000"} +{"battery_voltage":0.5249643,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:19.000"} +{"battery_voltage":0.51541376,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:20.000"} +{"battery_voltage":0.9897876,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:21.000"} +{"battery_voltage":0.5684158,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:22.000"} +{"battery_voltage":0.7586645,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:23.000"} +{"battery_voltage":0.57831913,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:24.000"} +{"battery_voltage":0.5272984,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:25.000"} +{"battery_voltage":0.8490623,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:26.000"} +{"battery_voltage":0.61126375,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:27.000"} +{"battery_voltage":0.6298294,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:28.000"} +{"battery_voltage":0.58072305,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:29.000"} +{"battery_voltage":0.54520565,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:30.000"} +{"battery_voltage":0.65894264,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:31.000"} +{"battery_voltage":0.55736834,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:32.000"} +{"battery_voltage":0.9139086,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:33.000"} +{"battery_voltage":0.59066606,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:34.000"} +{"battery_voltage":0.65324485,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:35.000"} +{"battery_voltage":0.52651376,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:36.000"} +{"battery_voltage":0.79430807,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:37.000"} +{"battery_voltage":0.68324184,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":0,"ts":"2019-12-01 00:01:38.000"} +{"battery_voltage":0.9977864,"home_id":"606","object_kind":"day","object_type":2,"sensor_id":"s107","states":1,"ts":"2019-12-01 00:01:39.000"} +{"battery_voltage":0.86721027,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:00.000"} +{"battery_voltage":0.91057515,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:01.000"} +{"battery_voltage":0.6340915,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:02.000"} +{"battery_voltage":0.9256289,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:03.000"} +{"battery_voltage":0.524389,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:04.000"} +{"battery_voltage":0.900969,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:05.000"} +{"battery_voltage":0.70975065,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:06.000"} +{"battery_voltage":0.6816068,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:07.000"} +{"battery_voltage":0.60286266,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:08.000"} +{"battery_voltage":0.64431405,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:09.000"} +{"battery_voltage":0.8481047,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:10.000"} +{"battery_voltage":0.74875927,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:11.000"} +{"battery_voltage":0.553125,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:12.000"} +{"battery_voltage":0.89230585,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:13.000"} +{"battery_voltage":0.8484179,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:14.000"} +{"battery_voltage":0.508562,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:15.000"} +{"battery_voltage":0.6212453,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:16.000"} +{"battery_voltage":0.8540254,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:17.000"} +{"battery_voltage":0.5535025,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:18.000"} +{"battery_voltage":0.73381513,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:19.000"} +{"battery_voltage":0.64239544,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:20.000"} +{"battery_voltage":0.55263007,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:21.000"} +{"battery_voltage":0.6341637,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:22.000"} +{"battery_voltage":0.7654568,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:23.000"} +{"battery_voltage":0.92196476,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:24.000"} +{"battery_voltage":0.9304836,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:25.000"} +{"battery_voltage":0.6291903,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:26.000"} +{"battery_voltage":0.72140205,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:27.000"} +{"battery_voltage":0.8851147,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:28.000"} +{"battery_voltage":0.80896443,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:29.000"} +{"battery_voltage":0.63162744,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:30.000"} +{"battery_voltage":0.539704,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:31.000"} +{"battery_voltage":0.9556397,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:32.000"} +{"battery_voltage":0.6092425,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:33.000"} +{"battery_voltage":0.64407754,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:34.000"} +{"battery_voltage":0.8924454,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:35.000"} +{"battery_voltage":0.6341453,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:36.000"} +{"battery_voltage":0.80927,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:37.000"} +{"battery_voltage":0.6517041,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:38.000"} +{"battery_voltage":0.597603,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:39.000"} +{"battery_voltage":0.89759815,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:40.000"} +{"battery_voltage":0.91360915,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:41.000"} +{"battery_voltage":0.77801263,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:42.000"} +{"battery_voltage":0.6941989,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:43.000"} +{"battery_voltage":0.5947089,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:44.000"} +{"battery_voltage":0.5456626,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:45.000"} +{"battery_voltage":0.607256,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:46.000"} +{"battery_voltage":0.61421853,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:47.000"} +{"battery_voltage":0.63586694,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:48.000"} +{"battery_voltage":0.6851482,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:49.000"} +{"battery_voltage":0.6763804,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:50.000"} +{"battery_voltage":0.82943195,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:51.000"} +{"battery_voltage":0.50045407,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:52.000"} +{"battery_voltage":0.7916049,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:53.000"} +{"battery_voltage":0.7013703,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:54.000"} +{"battery_voltage":0.6699885,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:55.000"} +{"battery_voltage":0.8420504,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:56.000"} +{"battery_voltage":0.51466507,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:00:57.000"} +{"battery_voltage":0.90366614,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:58.000"} +{"battery_voltage":0.85084975,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:00:59.000"} +{"battery_voltage":0.9257466,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:00.000"} +{"battery_voltage":0.5102245,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:01.000"} +{"battery_voltage":0.96108043,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:02.000"} +{"battery_voltage":0.5486912,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:03.000"} +{"battery_voltage":0.89654887,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:04.000"} +{"battery_voltage":0.8891253,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:05.000"} +{"battery_voltage":0.5727371,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:06.000"} +{"battery_voltage":0.783249,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:07.000"} +{"battery_voltage":0.5469513,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:08.000"} +{"battery_voltage":0.9613789,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:09.000"} +{"battery_voltage":0.69545364,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:10.000"} +{"battery_voltage":0.86351585,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:11.000"} +{"battery_voltage":0.8531561,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:12.000"} +{"battery_voltage":0.7359057,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:13.000"} +{"battery_voltage":0.621776,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:14.000"} +{"battery_voltage":0.6604511,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:15.000"} +{"battery_voltage":0.5478783,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:16.000"} +{"battery_voltage":0.66255414,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:17.000"} +{"battery_voltage":0.9499179,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:18.000"} +{"battery_voltage":0.88831574,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:19.000"} +{"battery_voltage":0.7580633,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:20.000"} +{"battery_voltage":0.9225353,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:21.000"} +{"battery_voltage":0.6692219,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:22.000"} +{"battery_voltage":0.61912835,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:23.000"} +{"battery_voltage":0.99582875,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:24.000"} +{"battery_voltage":0.87902415,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:25.000"} +{"battery_voltage":0.67628443,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:26.000"} +{"battery_voltage":0.83687174,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:27.000"} +{"battery_voltage":0.9943143,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:28.000"} +{"battery_voltage":0.6201099,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:29.000"} +{"battery_voltage":0.674114,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:30.000"} +{"battery_voltage":0.67246366,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:31.000"} +{"battery_voltage":0.8239599,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:32.000"} +{"battery_voltage":0.70240146,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:33.000"} +{"battery_voltage":0.69047993,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:34.000"} +{"battery_voltage":0.7104731,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:35.000"} +{"battery_voltage":0.9709189,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:36.000"} +{"battery_voltage":0.94283324,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:37.000"} +{"battery_voltage":0.9247738,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":0,"ts":"2019-12-01 00:01:38.000"} +{"battery_voltage":0.552071,"home_id":"603","object_kind":"all","object_type":3,"sensor_id":"s108","states":1,"ts":"2019-12-01 00:01:39.000"} +{"battery_voltage":0.9636625,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:00.000"} +{"battery_voltage":0.6839534,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:01.000"} +{"battery_voltage":0.9954566,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:02.000"} +{"battery_voltage":0.86396515,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:03.000"} +{"battery_voltage":0.61659896,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:04.000"} +{"battery_voltage":0.71129197,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:05.000"} +{"battery_voltage":0.905854,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:06.000"} +{"battery_voltage":0.7705264,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:07.000"} +{"battery_voltage":0.7981062,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:08.000"} +{"battery_voltage":0.7636435,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:09.000"} +{"battery_voltage":0.9345093,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:10.000"} +{"battery_voltage":0.5336993,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:11.000"} +{"battery_voltage":0.80898285,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:12.000"} +{"battery_voltage":0.89411414,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:13.000"} +{"battery_voltage":0.56510407,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:14.000"} +{"battery_voltage":0.7335708,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:15.000"} +{"battery_voltage":0.93600345,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:16.000"} +{"battery_voltage":0.9809611,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:17.000"} +{"battery_voltage":0.59630346,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:18.000"} +{"battery_voltage":0.8613196,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:19.000"} +{"battery_voltage":0.62268347,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:20.000"} +{"battery_voltage":0.9764792,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:21.000"} +{"battery_voltage":0.8251264,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:22.000"} +{"battery_voltage":0.95377636,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:23.000"} +{"battery_voltage":0.8570133,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:24.000"} +{"battery_voltage":0.92142123,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:25.000"} +{"battery_voltage":0.8477019,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:26.000"} +{"battery_voltage":0.8612052,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:27.000"} +{"battery_voltage":0.59492385,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:28.000"} +{"battery_voltage":0.87671703,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:29.000"} +{"battery_voltage":0.9056556,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:30.000"} +{"battery_voltage":0.93940216,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:31.000"} +{"battery_voltage":0.8290224,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:32.000"} +{"battery_voltage":0.5113568,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:33.000"} +{"battery_voltage":0.59223604,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:34.000"} +{"battery_voltage":0.51160496,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:35.000"} +{"battery_voltage":0.54997766,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:36.000"} +{"battery_voltage":0.8167529,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:37.000"} +{"battery_voltage":0.73863506,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:38.000"} +{"battery_voltage":0.7665298,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:39.000"} +{"battery_voltage":0.82101595,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:40.000"} +{"battery_voltage":0.97279453,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:41.000"} +{"battery_voltage":0.5629725,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:42.000"} +{"battery_voltage":0.53847814,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:43.000"} +{"battery_voltage":0.589947,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:44.000"} +{"battery_voltage":0.98508626,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:45.000"} +{"battery_voltage":0.84777415,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:46.000"} +{"battery_voltage":0.68025327,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:47.000"} +{"battery_voltage":0.6514157,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:48.000"} +{"battery_voltage":0.5478574,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:49.000"} +{"battery_voltage":0.8615689,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:50.000"} +{"battery_voltage":0.9215113,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:51.000"} +{"battery_voltage":0.5097517,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:52.000"} +{"battery_voltage":0.99524146,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:53.000"} +{"battery_voltage":0.62237006,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:54.000"} +{"battery_voltage":0.7505579,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:55.000"} +{"battery_voltage":0.6049488,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:56.000"} +{"battery_voltage":0.6638993,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:57.000"} +{"battery_voltage":0.8366454,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:00:58.000"} +{"battery_voltage":0.5381521,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:00:59.000"} +{"battery_voltage":0.662686,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:00.000"} +{"battery_voltage":0.6258177,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:01.000"} +{"battery_voltage":0.64257276,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:02.000"} +{"battery_voltage":0.65594685,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:03.000"} +{"battery_voltage":0.57828206,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:04.000"} +{"battery_voltage":0.786163,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:05.000"} +{"battery_voltage":0.6895987,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:06.000"} +{"battery_voltage":0.904716,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:07.000"} +{"battery_voltage":0.5041426,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:08.000"} +{"battery_voltage":0.66904837,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:09.000"} +{"battery_voltage":0.7101751,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:10.000"} +{"battery_voltage":0.69509715,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:11.000"} +{"battery_voltage":0.6266739,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:12.000"} +{"battery_voltage":0.97146165,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:13.000"} +{"battery_voltage":0.71578836,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:14.000"} +{"battery_voltage":0.7764681,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:15.000"} +{"battery_voltage":0.94571376,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:16.000"} +{"battery_voltage":0.7120625,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:17.000"} +{"battery_voltage":0.98183215,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:18.000"} +{"battery_voltage":0.9253825,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:19.000"} +{"battery_voltage":0.53743166,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:20.000"} +{"battery_voltage":0.69378746,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:21.000"} +{"battery_voltage":0.784279,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:22.000"} +{"battery_voltage":0.87504184,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:23.000"} +{"battery_voltage":0.7890485,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:24.000"} +{"battery_voltage":0.9394257,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:25.000"} +{"battery_voltage":0.7325297,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:26.000"} +{"battery_voltage":0.79771256,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:27.000"} +{"battery_voltage":0.5948397,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:28.000"} +{"battery_voltage":0.5982751,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:29.000"} +{"battery_voltage":0.5305714,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:30.000"} +{"battery_voltage":0.9328362,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:31.000"} +{"battery_voltage":0.60514575,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:32.000"} +{"battery_voltage":0.64315695,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:33.000"} +{"battery_voltage":0.61862606,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:34.000"} +{"battery_voltage":0.9997138,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":1,"ts":"2019-12-01 00:01:35.000"} +{"battery_voltage":0.9584835,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:36.000"} +{"battery_voltage":0.74601066,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:37.000"} +{"battery_voltage":0.5287202,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:38.000"} +{"battery_voltage":0.9887305,"home_id":"604","object_kind":"night","object_type":1,"sensor_id":"s109","states":0,"ts":"2019-12-01 00:01:39.000"} diff --git a/importSampleData/data/sensor_info.csv b/importSampleData/data/sensor_info.csv new file mode 100644 index 0000000000000000000000000000000000000000..d049c8b00460cdcc2a1bd5b990ae6efa2aa63bd3 --- /dev/null +++ b/importSampleData/data/sensor_info.csv @@ -0,0 +1,1001 @@ +devid,location,color,devgroup,ts,temperature,humidity +0, beijing, white, 0, 1575129600000, 16, 19.405091 +0, beijing, white, 0, 1575129601000, 22, 14.377142 +0, beijing, white, 0, 1575129602000, 16, 16.868231 +0, beijing, white, 0, 1575129603000, 20, 11.565193 +0, beijing, white, 0, 1575129604000, 31, 13.009119 +0, beijing, white, 0, 1575129605000, 29, 18.136400 +0, beijing, white, 0, 1575129606000, 17, 13.806572 +0, beijing, white, 0, 1575129607000, 23, 14.688898 +0, beijing, white, 0, 1575129608000, 26, 12.931019 +0, beijing, white, 0, 1575129609000, 32, 12.185531 +0, beijing, white, 0, 1575129610000, 30, 13.608714 +0, beijing, white, 0, 1575129611000, 23, 18.624914 +0, beijing, white, 0, 1575129612000, 22, 12.970826 +0, beijing, white, 0, 1575129613000, 22, 12.065827 +0, beijing, white, 0, 1575129614000, 25, 16.967192 +0, beijing, white, 0, 1575129615000, 16, 10.283031 +0, beijing, white, 0, 1575129616000, 22, 16.072534 +0, beijing, white, 0, 1575129617000, 24, 10.794536 +0, beijing, white, 0, 1575129618000, 32, 10.591207 +0, beijing, white, 0, 1575129619000, 20, 13.015227 +0, beijing, white, 0, 1575129620000, 28, 15.410999 +0, beijing, white, 0, 1575129621000, 29, 12.785076 +0, beijing, white, 0, 1575129622000, 28, 15.305857 +0, beijing, white, 0, 1575129623000, 33, 12.820810 +0, beijing, white, 0, 1575129624000, 34, 13.618055 +0, beijing, white, 0, 1575129625000, 32, 12.971123 +0, beijing, white, 0, 1575129626000, 24, 10.974546 +0, beijing, white, 0, 1575129627000, 15, 10.742910 +0, beijing, white, 0, 1575129628000, 23, 16.810783 +0, beijing, white, 0, 1575129629000, 18, 13.115224 +0, beijing, white, 0, 1575129630000, 26, 17.418490 +0, beijing, white, 0, 1575129631000, 20, 17.302315 +0, beijing, white, 0, 1575129632000, 21, 14.283571 +0, beijing, white, 0, 1575129633000, 16, 16.826535 +0, beijing, white, 0, 1575129634000, 18, 19.222123 +0, beijing, white, 0, 1575129635000, 18, 14.931420 +0, beijing, white, 0, 1575129636000, 17, 19.549454 +0, beijing, white, 0, 1575129637000, 22, 16.908388 +0, beijing, white, 0, 1575129638000, 32, 15.637796 +0, beijing, white, 0, 1575129639000, 31, 15.517650 +0, beijing, white, 0, 1575129640000, 18, 14.038033 +0, beijing, white, 0, 1575129641000, 32, 19.859647 +0, beijing, white, 0, 1575129642000, 16, 13.220840 +0, beijing, white, 0, 1575129643000, 28, 16.445398 +0, beijing, white, 0, 1575129644000, 26, 16.695753 +0, beijing, white, 0, 1575129645000, 33, 13.696928 +0, beijing, white, 0, 1575129646000, 21, 15.352819 +0, beijing, white, 0, 1575129647000, 15, 12.388407 +0, beijing, white, 0, 1575129648000, 27, 11.267529 +0, beijing, white, 0, 1575129649000, 20, 14.103228 +0, beijing, white, 0, 1575129650000, 20, 16.250950 +0, beijing, white, 0, 1575129651000, 30, 16.236088 +0, beijing, white, 0, 1575129652000, 22, 18.305339 +0, beijing, white, 0, 1575129653000, 25, 17.360686 +0, beijing, white, 0, 1575129654000, 25, 14.978681 +0, beijing, white, 0, 1575129655000, 33, 14.096183 +0, beijing, white, 0, 1575129656000, 26, 10.019039 +0, beijing, white, 0, 1575129657000, 19, 19.158213 +0, beijing, white, 0, 1575129658000, 22, 15.593924 +0, beijing, white, 0, 1575129659000, 26, 18.780118 +0, beijing, white, 0, 1575129660000, 21, 16.001656 +0, beijing, white, 0, 1575129661000, 16, 18.458328 +0, beijing, white, 0, 1575129662000, 21, 16.417843 +0, beijing, white, 0, 1575129663000, 28, 11.736558 +0, beijing, white, 0, 1575129664000, 34, 18.143946 +0, beijing, white, 0, 1575129665000, 27, 10.303225 +0, beijing, white, 0, 1575129666000, 20, 19.756748 +0, beijing, white, 0, 1575129667000, 22, 12.940063 +0, beijing, white, 0, 1575129668000, 23, 11.509640 +0, beijing, white, 0, 1575129669000, 19, 18.319309 +0, beijing, white, 0, 1575129670000, 19, 16.278346 +0, beijing, white, 0, 1575129671000, 27, 10.898361 +0, beijing, white, 0, 1575129672000, 31, 13.922162 +0, beijing, white, 0, 1575129673000, 15, 19.296116 +0, beijing, white, 0, 1575129674000, 26, 15.885763 +0, beijing, white, 0, 1575129675000, 15, 15.525804 +0, beijing, white, 0, 1575129676000, 19, 19.579539 +0, beijing, white, 0, 1575129677000, 20, 11.073811 +0, beijing, white, 0, 1575129678000, 16, 13.932510 +0, beijing, white, 0, 1575129679000, 17, 11.900328 +0, beijing, white, 0, 1575129680000, 22, 16.540414 +0, beijing, white, 0, 1575129681000, 33, 15.203803 +0, beijing, white, 0, 1575129682000, 17, 11.518434 +0, beijing, white, 0, 1575129683000, 17, 13.152081 +0, beijing, white, 0, 1575129684000, 18, 11.378041 +0, beijing, white, 0, 1575129685000, 21, 15.390745 +0, beijing, white, 0, 1575129686000, 30, 15.127818 +0, beijing, white, 0, 1575129687000, 19, 16.530402 +0, beijing, white, 0, 1575129688000, 32, 16.542701 +0, beijing, white, 0, 1575129689000, 26, 16.366442 +0, beijing, white, 0, 1575129690000, 25, 10.306822 +0, beijing, white, 0, 1575129691000, 15, 13.691117 +0, beijing, white, 0, 1575129692000, 15, 13.476817 +0, beijing, white, 0, 1575129693000, 25, 12.529998 +0, beijing, white, 0, 1575129694000, 22, 15.550021 +0, beijing, white, 0, 1575129695000, 20, 15.064971 +0, beijing, white, 0, 1575129696000, 24, 13.313683 +0, beijing, white, 0, 1575129697000, 23, 17.002879 +0, beijing, white, 0, 1575129698000, 30, 19.991595 +0, beijing, white, 0, 1575129699000, 15, 11.116746 +1, shanghai, black, 1, 1575129600000, 24, 10.921176 +1, shanghai, black, 1, 1575129601000, 26, 17.146958 +1, shanghai, black, 1, 1575129602000, 21, 18.486329 +1, shanghai, black, 1, 1575129603000, 34, 12.125609 +1, shanghai, black, 1, 1575129604000, 22, 19.451948 +1, shanghai, black, 1, 1575129605000, 23, 16.458334 +1, shanghai, black, 1, 1575129606000, 18, 14.484644 +1, shanghai, black, 1, 1575129607000, 33, 10.824797 +1, shanghai, black, 1, 1575129608000, 34, 14.001883 +1, shanghai, black, 1, 1575129609000, 32, 19.498832 +1, shanghai, black, 1, 1575129610000, 30, 14.993855 +1, shanghai, black, 1, 1575129611000, 28, 10.198087 +1, shanghai, black, 1, 1575129612000, 32, 14.286884 +1, shanghai, black, 1, 1575129613000, 25, 18.874475 +1, shanghai, black, 1, 1575129614000, 21, 17.650082 +1, shanghai, black, 1, 1575129615000, 15, 17.275773 +1, shanghai, black, 1, 1575129616000, 17, 15.130875 +1, shanghai, black, 1, 1575129617000, 16, 17.242291 +1, shanghai, black, 1, 1575129618000, 15, 19.777635 +1, shanghai, black, 1, 1575129619000, 29, 18.321979 +1, shanghai, black, 1, 1575129620000, 15, 19.133991 +1, shanghai, black, 1, 1575129621000, 16, 18.351038 +1, shanghai, black, 1, 1575129622000, 31, 17.517406 +1, shanghai, black, 1, 1575129623000, 34, 10.969342 +1, shanghai, black, 1, 1575129624000, 28, 15.838347 +1, shanghai, black, 1, 1575129625000, 19, 19.982738 +1, shanghai, black, 1, 1575129626000, 24, 19.854656 +1, shanghai, black, 1, 1575129627000, 34, 13.320561 +1, shanghai, black, 1, 1575129628000, 15, 19.560206 +1, shanghai, black, 1, 1575129629000, 15, 11.843907 +1, shanghai, black, 1, 1575129630000, 19, 18.332418 +1, shanghai, black, 1, 1575129631000, 30, 18.058718 +1, shanghai, black, 1, 1575129632000, 16, 17.185304 +1, shanghai, black, 1, 1575129633000, 29, 18.958033 +1, shanghai, black, 1, 1575129634000, 25, 10.187132 +1, shanghai, black, 1, 1575129635000, 33, 14.235532 +1, shanghai, black, 1, 1575129636000, 19, 14.326982 +1, shanghai, black, 1, 1575129637000, 29, 18.557044 +1, shanghai, black, 1, 1575129638000, 19, 16.590305 +1, shanghai, black, 1, 1575129639000, 21, 15.034868 +1, shanghai, black, 1, 1575129640000, 27, 10.231096 +1, shanghai, black, 1, 1575129641000, 17, 12.611756 +1, shanghai, black, 1, 1575129642000, 32, 13.148048 +1, shanghai, black, 1, 1575129643000, 20, 18.997501 +1, shanghai, black, 1, 1575129644000, 34, 11.001994 +1, shanghai, black, 1, 1575129645000, 24, 17.698891 +1, shanghai, black, 1, 1575129646000, 16, 12.623819 +1, shanghai, black, 1, 1575129647000, 26, 12.146537 +1, shanghai, black, 1, 1575129648000, 28, 13.511343 +1, shanghai, black, 1, 1575129649000, 34, 15.783513 +1, shanghai, black, 1, 1575129650000, 23, 11.198505 +1, shanghai, black, 1, 1575129651000, 23, 10.537856 +1, shanghai, black, 1, 1575129652000, 29, 13.241740 +1, shanghai, black, 1, 1575129653000, 30, 13.492887 +1, shanghai, black, 1, 1575129654000, 21, 19.687462 +1, shanghai, black, 1, 1575129655000, 21, 12.079431 +1, shanghai, black, 1, 1575129656000, 29, 13.022024 +1, shanghai, black, 1, 1575129657000, 34, 11.340842 +1, shanghai, black, 1, 1575129658000, 18, 16.408648 +1, shanghai, black, 1, 1575129659000, 22, 18.098742 +1, shanghai, black, 1, 1575129660000, 29, 19.427574 +1, shanghai, black, 1, 1575129661000, 26, 14.946804 +1, shanghai, black, 1, 1575129662000, 18, 17.107439 +1, shanghai, black, 1, 1575129663000, 31, 14.076329 +1, shanghai, black, 1, 1575129664000, 32, 19.443971 +1, shanghai, black, 1, 1575129665000, 31, 12.886383 +1, shanghai, black, 1, 1575129666000, 20, 14.525845 +1, shanghai, black, 1, 1575129667000, 24, 13.153620 +1, shanghai, black, 1, 1575129668000, 22, 17.515631 +1, shanghai, black, 1, 1575129669000, 24, 16.697146 +1, shanghai, black, 1, 1575129670000, 34, 14.588845 +1, shanghai, black, 1, 1575129671000, 17, 14.815298 +1, shanghai, black, 1, 1575129672000, 20, 19.506232 +1, shanghai, black, 1, 1575129673000, 28, 17.425147 +1, shanghai, black, 1, 1575129674000, 15, 10.661514 +1, shanghai, black, 1, 1575129675000, 20, 19.254679 +1, shanghai, black, 1, 1575129676000, 24, 14.094194 +1, shanghai, black, 1, 1575129677000, 31, 10.972616 +1, shanghai, black, 1, 1575129678000, 15, 10.044447 +1, shanghai, black, 1, 1575129679000, 32, 11.093067 +1, shanghai, black, 1, 1575129680000, 33, 12.570554 +1, shanghai, black, 1, 1575129681000, 28, 19.264114 +1, shanghai, black, 1, 1575129682000, 23, 13.038871 +1, shanghai, black, 1, 1575129683000, 20, 11.764896 +1, shanghai, black, 1, 1575129684000, 19, 17.051371 +1, shanghai, black, 1, 1575129685000, 18, 12.503689 +1, shanghai, black, 1, 1575129686000, 28, 17.512406 +1, shanghai, black, 1, 1575129687000, 28, 18.409932 +1, shanghai, black, 1, 1575129688000, 22, 10.132855 +1, shanghai, black, 1, 1575129689000, 23, 18.993715 +1, shanghai, black, 1, 1575129690000, 26, 10.430004 +1, shanghai, black, 1, 1575129691000, 21, 10.510941 +1, shanghai, black, 1, 1575129692000, 26, 14.756974 +1, shanghai, black, 1, 1575129693000, 32, 10.407199 +1, shanghai, black, 1, 1575129694000, 29, 12.601247 +1, shanghai, black, 1, 1575129695000, 25, 19.604975 +1, shanghai, black, 1, 1575129696000, 22, 12.293202 +1, shanghai, black, 1, 1575129697000, 19, 17.564823 +1, shanghai, black, 1, 1575129698000, 28, 13.389774 +1, shanghai, black, 1, 1575129699000, 31, 19.859944 +2, guangzhou, green, 2, 1575129600000, 17, 12.496550 +2, guangzhou, green, 2, 1575129601000, 29, 17.897172 +2, guangzhou, green, 2, 1575129602000, 34, 16.574690 +2, guangzhou, green, 2, 1575129603000, 15, 16.575054 +2, guangzhou, green, 2, 1575129604000, 34, 19.192545 +2, guangzhou, green, 2, 1575129605000, 19, 15.203920 +2, guangzhou, green, 2, 1575129606000, 28, 12.481825 +2, guangzhou, green, 2, 1575129607000, 30, 16.997891 +2, guangzhou, green, 2, 1575129608000, 24, 15.122720 +2, guangzhou, green, 2, 1575129609000, 20, 16.220016 +2, guangzhou, green, 2, 1575129610000, 16, 11.405753 +2, guangzhou, green, 2, 1575129611000, 26, 19.440151 +2, guangzhou, green, 2, 1575129612000, 24, 12.457920 +2, guangzhou, green, 2, 1575129613000, 30, 15.369806 +2, guangzhou, green, 2, 1575129614000, 27, 16.716676 +2, guangzhou, green, 2, 1575129615000, 32, 17.338548 +2, guangzhou, green, 2, 1575129616000, 28, 14.234738 +2, guangzhou, green, 2, 1575129617000, 34, 19.530447 +2, guangzhou, green, 2, 1575129618000, 15, 14.551896 +2, guangzhou, green, 2, 1575129619000, 21, 17.198856 +2, guangzhou, green, 2, 1575129620000, 19, 17.425909 +2, guangzhou, green, 2, 1575129621000, 29, 16.825216 +2, guangzhou, green, 2, 1575129622000, 28, 12.485828 +2, guangzhou, green, 2, 1575129623000, 25, 17.699710 +2, guangzhou, green, 2, 1575129624000, 30, 12.866378 +2, guangzhou, green, 2, 1575129625000, 18, 11.985615 +2, guangzhou, green, 2, 1575129626000, 24, 16.359533 +2, guangzhou, green, 2, 1575129627000, 20, 14.123154 +2, guangzhou, green, 2, 1575129628000, 23, 11.311899 +2, guangzhou, green, 2, 1575129629000, 29, 18.450350 +2, guangzhou, green, 2, 1575129630000, 29, 17.783038 +2, guangzhou, green, 2, 1575129631000, 22, 16.543795 +2, guangzhou, green, 2, 1575129632000, 25, 13.939652 +2, guangzhou, green, 2, 1575129633000, 22, 15.658666 +2, guangzhou, green, 2, 1575129634000, 24, 14.524828 +2, guangzhou, green, 2, 1575129635000, 15, 16.428353 +2, guangzhou, green, 2, 1575129636000, 16, 18.103802 +2, guangzhou, green, 2, 1575129637000, 28, 10.814747 +2, guangzhou, green, 2, 1575129638000, 21, 14.906347 +2, guangzhou, green, 2, 1575129639000, 25, 16.276587 +2, guangzhou, green, 2, 1575129640000, 28, 17.932145 +2, guangzhou, green, 2, 1575129641000, 34, 12.543257 +2, guangzhou, green, 2, 1575129642000, 21, 14.202174 +2, guangzhou, green, 2, 1575129643000, 19, 12.169968 +2, guangzhou, green, 2, 1575129644000, 31, 15.638443 +2, guangzhou, green, 2, 1575129645000, 23, 13.675736 +2, guangzhou, green, 2, 1575129646000, 20, 19.002998 +2, guangzhou, green, 2, 1575129647000, 34, 14.451299 +2, guangzhou, green, 2, 1575129648000, 29, 16.676133 +2, guangzhou, green, 2, 1575129649000, 31, 10.066270 +2, guangzhou, green, 2, 1575129650000, 26, 17.824551 +2, guangzhou, green, 2, 1575129651000, 34, 18.082416 +2, guangzhou, green, 2, 1575129652000, 28, 16.099497 +2, guangzhou, green, 2, 1575129653000, 16, 12.265096 +2, guangzhou, green, 2, 1575129654000, 34, 12.468646 +2, guangzhou, green, 2, 1575129655000, 16, 11.534757 +2, guangzhou, green, 2, 1575129656000, 16, 19.092035 +2, guangzhou, green, 2, 1575129657000, 20, 13.272631 +2, guangzhou, green, 2, 1575129658000, 19, 14.302918 +2, guangzhou, green, 2, 1575129659000, 31, 10.996095 +2, guangzhou, green, 2, 1575129660000, 17, 15.220791 +2, guangzhou, green, 2, 1575129661000, 28, 18.482870 +2, guangzhou, green, 2, 1575129662000, 17, 15.654042 +2, guangzhou, green, 2, 1575129663000, 30, 12.753545 +2, guangzhou, green, 2, 1575129664000, 18, 19.292998 +2, guangzhou, green, 2, 1575129665000, 33, 12.108711 +2, guangzhou, green, 2, 1575129666000, 34, 14.724292 +2, guangzhou, green, 2, 1575129667000, 28, 13.754784 +2, guangzhou, green, 2, 1575129668000, 22, 17.879010 +2, guangzhou, green, 2, 1575129669000, 27, 10.963891 +2, guangzhou, green, 2, 1575129670000, 32, 15.231074 +2, guangzhou, green, 2, 1575129671000, 24, 11.802718 +2, guangzhou, green, 2, 1575129672000, 21, 13.681011 +2, guangzhou, green, 2, 1575129673000, 19, 10.910179 +2, guangzhou, green, 2, 1575129674000, 29, 13.944866 +2, guangzhou, green, 2, 1575129675000, 18, 17.558532 +2, guangzhou, green, 2, 1575129676000, 19, 13.186824 +2, guangzhou, green, 2, 1575129677000, 25, 12.784448 +2, guangzhou, green, 2, 1575129678000, 28, 15.774681 +2, guangzhou, green, 2, 1575129679000, 29, 11.104902 +2, guangzhou, green, 2, 1575129680000, 16, 13.809837 +2, guangzhou, green, 2, 1575129681000, 16, 18.830369 +2, guangzhou, green, 2, 1575129682000, 32, 11.798459 +2, guangzhou, green, 2, 1575129683000, 17, 11.893725 +2, guangzhou, green, 2, 1575129684000, 16, 11.646352 +2, guangzhou, green, 2, 1575129685000, 30, 16.511740 +2, guangzhou, green, 2, 1575129686000, 27, 11.837594 +2, guangzhou, green, 2, 1575129687000, 26, 17.312381 +2, guangzhou, green, 2, 1575129688000, 16, 12.512595 +2, guangzhou, green, 2, 1575129689000, 27, 10.224634 +2, guangzhou, green, 2, 1575129690000, 31, 15.000720 +2, guangzhou, green, 2, 1575129691000, 18, 12.810097 +2, guangzhou, green, 2, 1575129692000, 24, 19.154830 +2, guangzhou, green, 2, 1575129693000, 29, 17.029148 +2, guangzhou, green, 2, 1575129694000, 25, 19.416777 +2, guangzhou, green, 2, 1575129695000, 17, 17.692554 +2, guangzhou, green, 2, 1575129696000, 25, 10.939226 +2, guangzhou, green, 2, 1575129697000, 23, 10.632203 +2, guangzhou, green, 2, 1575129698000, 21, 17.977449 +2, guangzhou, green, 2, 1575129699000, 20, 14.047369 +3, shenzhen, yellow, 0, 1575129600000, 17, 13.181688 +3, shenzhen, yellow, 0, 1575129601000, 26, 17.912070 +3, shenzhen, yellow, 0, 1575129602000, 28, 11.660286 +3, shenzhen, yellow, 0, 1575129603000, 28, 16.496510 +3, shenzhen, yellow, 0, 1575129604000, 32, 16.164662 +3, shenzhen, yellow, 0, 1575129605000, 16, 19.604285 +3, shenzhen, yellow, 0, 1575129606000, 33, 19.308120 +3, shenzhen, yellow, 0, 1575129607000, 16, 16.755204 +3, shenzhen, yellow, 0, 1575129608000, 33, 10.658284 +3, shenzhen, yellow, 0, 1575129609000, 30, 17.241293 +3, shenzhen, yellow, 0, 1575129610000, 16, 18.088522 +3, shenzhen, yellow, 0, 1575129611000, 31, 15.455248 +3, shenzhen, yellow, 0, 1575129612000, 29, 10.505713 +3, shenzhen, yellow, 0, 1575129613000, 28, 16.189388 +3, shenzhen, yellow, 0, 1575129614000, 16, 14.723009 +3, shenzhen, yellow, 0, 1575129615000, 27, 15.670388 +3, shenzhen, yellow, 0, 1575129616000, 29, 16.080214 +3, shenzhen, yellow, 0, 1575129617000, 18, 18.544671 +3, shenzhen, yellow, 0, 1575129618000, 23, 16.947663 +3, shenzhen, yellow, 0, 1575129619000, 15, 16.917797 +3, shenzhen, yellow, 0, 1575129620000, 25, 17.888324 +3, shenzhen, yellow, 0, 1575129621000, 34, 18.520162 +3, shenzhen, yellow, 0, 1575129622000, 29, 10.271190 +3, shenzhen, yellow, 0, 1575129623000, 26, 11.781460 +3, shenzhen, yellow, 0, 1575129624000, 16, 17.737292 +3, shenzhen, yellow, 0, 1575129625000, 15, 13.730896 +3, shenzhen, yellow, 0, 1575129626000, 28, 12.161647 +3, shenzhen, yellow, 0, 1575129627000, 33, 15.012675 +3, shenzhen, yellow, 0, 1575129628000, 28, 12.880752 +3, shenzhen, yellow, 0, 1575129629000, 28, 12.418301 +3, shenzhen, yellow, 0, 1575129630000, 16, 15.744831 +3, shenzhen, yellow, 0, 1575129631000, 23, 10.551453 +3, shenzhen, yellow, 0, 1575129632000, 32, 11.782227 +3, shenzhen, yellow, 0, 1575129633000, 32, 16.531595 +3, shenzhen, yellow, 0, 1575129634000, 19, 12.512090 +3, shenzhen, yellow, 0, 1575129635000, 22, 16.554170 +3, shenzhen, yellow, 0, 1575129636000, 20, 12.593234 +3, shenzhen, yellow, 0, 1575129637000, 23, 10.267977 +3, shenzhen, yellow, 0, 1575129638000, 19, 18.470475 +3, shenzhen, yellow, 0, 1575129639000, 27, 11.479857 +3, shenzhen, yellow, 0, 1575129640000, 29, 17.387964 +3, shenzhen, yellow, 0, 1575129641000, 28, 18.605927 +3, shenzhen, yellow, 0, 1575129642000, 28, 14.150780 +3, shenzhen, yellow, 0, 1575129643000, 30, 12.112675 +3, shenzhen, yellow, 0, 1575129644000, 20, 12.126206 +3, shenzhen, yellow, 0, 1575129645000, 34, 11.627235 +3, shenzhen, yellow, 0, 1575129646000, 34, 18.202179 +3, shenzhen, yellow, 0, 1575129647000, 30, 12.447241 +3, shenzhen, yellow, 0, 1575129648000, 15, 12.542049 +3, shenzhen, yellow, 0, 1575129649000, 34, 12.043278 +3, shenzhen, yellow, 0, 1575129650000, 26, 15.254272 +3, shenzhen, yellow, 0, 1575129651000, 33, 14.655641 +3, shenzhen, yellow, 0, 1575129652000, 21, 17.835511 +3, shenzhen, yellow, 0, 1575129653000, 30, 18.979520 +3, shenzhen, yellow, 0, 1575129654000, 26, 12.942195 +3, shenzhen, yellow, 0, 1575129655000, 29, 19.775977 +3, shenzhen, yellow, 0, 1575129656000, 31, 14.242160 +3, shenzhen, yellow, 0, 1575129657000, 15, 10.568320 +3, shenzhen, yellow, 0, 1575129658000, 21, 12.407690 +3, shenzhen, yellow, 0, 1575129659000, 23, 14.165327 +3, shenzhen, yellow, 0, 1575129660000, 27, 11.292074 +3, shenzhen, yellow, 0, 1575129661000, 18, 11.011734 +3, shenzhen, yellow, 0, 1575129662000, 22, 18.100115 +3, shenzhen, yellow, 0, 1575129663000, 18, 11.857615 +3, shenzhen, yellow, 0, 1575129664000, 20, 15.402887 +3, shenzhen, yellow, 0, 1575129665000, 32, 17.952958 +3, shenzhen, yellow, 0, 1575129666000, 16, 15.407510 +3, shenzhen, yellow, 0, 1575129667000, 23, 17.344025 +3, shenzhen, yellow, 0, 1575129668000, 34, 13.251864 +3, shenzhen, yellow, 0, 1575129669000, 31, 15.406216 +3, shenzhen, yellow, 0, 1575129670000, 19, 16.385551 +3, shenzhen, yellow, 0, 1575129671000, 32, 13.493399 +3, shenzhen, yellow, 0, 1575129672000, 27, 11.856057 +3, shenzhen, yellow, 0, 1575129673000, 30, 12.977649 +3, shenzhen, yellow, 0, 1575129674000, 19, 18.339123 +3, shenzhen, yellow, 0, 1575129675000, 23, 16.442236 +3, shenzhen, yellow, 0, 1575129676000, 18, 19.140272 +3, shenzhen, yellow, 0, 1575129677000, 27, 16.562737 +3, shenzhen, yellow, 0, 1575129678000, 16, 10.993309 +3, shenzhen, yellow, 0, 1575129679000, 27, 15.137385 +3, shenzhen, yellow, 0, 1575129680000, 15, 18.754543 +3, shenzhen, yellow, 0, 1575129681000, 26, 10.116102 +3, shenzhen, yellow, 0, 1575129682000, 29, 14.024587 +3, shenzhen, yellow, 0, 1575129683000, 31, 14.016558 +3, shenzhen, yellow, 0, 1575129684000, 19, 10.671284 +3, shenzhen, yellow, 0, 1575129685000, 32, 14.641297 +3, shenzhen, yellow, 0, 1575129686000, 18, 12.823655 +3, shenzhen, yellow, 0, 1575129687000, 30, 19.260822 +3, shenzhen, yellow, 0, 1575129688000, 30, 16.105202 +3, shenzhen, yellow, 0, 1575129689000, 22, 10.230556 +3, shenzhen, yellow, 0, 1575129690000, 17, 10.732315 +3, shenzhen, yellow, 0, 1575129691000, 31, 15.320282 +3, shenzhen, yellow, 0, 1575129692000, 24, 17.208577 +3, shenzhen, yellow, 0, 1575129693000, 16, 12.506668 +3, shenzhen, yellow, 0, 1575129694000, 17, 18.911875 +3, shenzhen, yellow, 0, 1575129695000, 15, 12.665488 +3, shenzhen, yellow, 0, 1575129696000, 18, 11.283357 +3, shenzhen, yellow, 0, 1575129697000, 15, 13.186590 +3, shenzhen, yellow, 0, 1575129698000, 34, 15.659293 +3, shenzhen, yellow, 0, 1575129699000, 30, 12.898771 +4, hangzhou, blue, 1, 1575129600000, 33, 18.262612 +4, hangzhou, blue, 1, 1575129601000, 20, 11.612149 +4, hangzhou, blue, 1, 1575129602000, 26, 17.261305 +4, hangzhou, blue, 1, 1575129603000, 27, 19.240210 +4, hangzhou, blue, 1, 1575129604000, 27, 17.412985 +4, hangzhou, blue, 1, 1575129605000, 19, 12.835781 +4, hangzhou, blue, 1, 1575129606000, 24, 13.087003 +4, hangzhou, blue, 1, 1575129607000, 24, 13.701138 +4, hangzhou, blue, 1, 1575129608000, 31, 10.076716 +4, hangzhou, blue, 1, 1575129609000, 27, 14.703408 +4, hangzhou, blue, 1, 1575129610000, 19, 17.503874 +4, hangzhou, blue, 1, 1575129611000, 21, 18.607839 +4, hangzhou, blue, 1, 1575129612000, 16, 15.416387 +4, hangzhou, blue, 1, 1575129613000, 19, 19.477280 +4, hangzhou, blue, 1, 1575129614000, 15, 17.374174 +4, hangzhou, blue, 1, 1575129615000, 30, 10.732940 +4, hangzhou, blue, 1, 1575129616000, 33, 16.863960 +4, hangzhou, blue, 1, 1575129617000, 16, 10.413205 +4, hangzhou, blue, 1, 1575129618000, 27, 14.130482 +4, hangzhou, blue, 1, 1575129619000, 19, 10.731398 +4, hangzhou, blue, 1, 1575129620000, 27, 11.713011 +4, hangzhou, blue, 1, 1575129621000, 26, 19.063695 +4, hangzhou, blue, 1, 1575129622000, 26, 16.309728 +4, hangzhou, blue, 1, 1575129623000, 33, 12.229796 +4, hangzhou, blue, 1, 1575129624000, 16, 15.176824 +4, hangzhou, blue, 1, 1575129625000, 31, 12.417684 +4, hangzhou, blue, 1, 1575129626000, 31, 17.284961 +4, hangzhou, blue, 1, 1575129627000, 24, 12.530188 +4, hangzhou, blue, 1, 1575129628000, 32, 15.067641 +4, hangzhou, blue, 1, 1575129629000, 32, 18.546511 +4, hangzhou, blue, 1, 1575129630000, 21, 13.049847 +4, hangzhou, blue, 1, 1575129631000, 19, 17.509510 +4, hangzhou, blue, 1, 1575129632000, 24, 13.289143 +4, hangzhou, blue, 1, 1575129633000, 18, 19.179227 +4, hangzhou, blue, 1, 1575129634000, 25, 18.128126 +4, hangzhou, blue, 1, 1575129635000, 26, 19.627125 +4, hangzhou, blue, 1, 1575129636000, 25, 16.090493 +4, hangzhou, blue, 1, 1575129637000, 19, 19.093488 +4, hangzhou, blue, 1, 1575129638000, 32, 17.563422 +4, hangzhou, blue, 1, 1575129639000, 16, 12.867582 +4, hangzhou, blue, 1, 1575129640000, 32, 11.606473 +4, hangzhou, blue, 1, 1575129641000, 31, 12.321989 +4, hangzhou, blue, 1, 1575129642000, 30, 17.043967 +4, hangzhou, blue, 1, 1575129643000, 20, 14.553511 +4, hangzhou, blue, 1, 1575129644000, 34, 19.068052 +4, hangzhou, blue, 1, 1575129645000, 18, 15.992107 +4, hangzhou, blue, 1, 1575129646000, 34, 11.308531 +4, hangzhou, blue, 1, 1575129647000, 18, 19.053088 +4, hangzhou, blue, 1, 1575129648000, 25, 18.617738 +4, hangzhou, blue, 1, 1575129649000, 25, 14.190978 +4, hangzhou, blue, 1, 1575129650000, 22, 18.049969 +4, hangzhou, blue, 1, 1575129651000, 19, 16.890290 +4, hangzhou, blue, 1, 1575129652000, 26, 10.055835 +4, hangzhou, blue, 1, 1575129653000, 32, 18.772190 +4, hangzhou, blue, 1, 1575129654000, 18, 15.347443 +4, hangzhou, blue, 1, 1575129655000, 19, 15.611078 +4, hangzhou, blue, 1, 1575129656000, 24, 11.345082 +4, hangzhou, blue, 1, 1575129657000, 27, 10.883929 +4, hangzhou, blue, 1, 1575129658000, 25, 19.810161 +4, hangzhou, blue, 1, 1575129659000, 33, 10.159027 +4, hangzhou, blue, 1, 1575129660000, 20, 11.900341 +4, hangzhou, blue, 1, 1575129661000, 24, 12.395535 +4, hangzhou, blue, 1, 1575129662000, 25, 13.832159 +4, hangzhou, blue, 1, 1575129663000, 26, 15.066722 +4, hangzhou, blue, 1, 1575129664000, 24, 12.441406 +4, hangzhou, blue, 1, 1575129665000, 22, 16.281200 +4, hangzhou, blue, 1, 1575129666000, 21, 14.116693 +4, hangzhou, blue, 1, 1575129667000, 28, 12.441770 +4, hangzhou, blue, 1, 1575129668000, 18, 11.402083 +4, hangzhou, blue, 1, 1575129669000, 28, 15.167379 +4, hangzhou, blue, 1, 1575129670000, 16, 15.433220 +4, hangzhou, blue, 1, 1575129671000, 23, 10.211150 +4, hangzhou, blue, 1, 1575129672000, 19, 19.501424 +4, hangzhou, blue, 1, 1575129673000, 18, 17.974835 +4, hangzhou, blue, 1, 1575129674000, 26, 12.904804 +4, hangzhou, blue, 1, 1575129675000, 27, 17.012268 +4, hangzhou, blue, 1, 1575129676000, 34, 11.223162 +4, hangzhou, blue, 1, 1575129677000, 34, 11.008873 +4, hangzhou, blue, 1, 1575129678000, 18, 13.466623 +4, hangzhou, blue, 1, 1575129679000, 25, 11.714342 +4, hangzhou, blue, 1, 1575129680000, 32, 15.193444 +4, hangzhou, blue, 1, 1575129681000, 17, 13.998644 +4, hangzhou, blue, 1, 1575129682000, 27, 12.180101 +4, hangzhou, blue, 1, 1575129683000, 17, 16.405635 +4, hangzhou, blue, 1, 1575129684000, 33, 16.027225 +4, hangzhou, blue, 1, 1575129685000, 28, 17.864308 +4, hangzhou, blue, 1, 1575129686000, 20, 16.057140 +4, hangzhou, blue, 1, 1575129687000, 26, 17.240991 +4, hangzhou, blue, 1, 1575129688000, 31, 11.178153 +4, hangzhou, blue, 1, 1575129689000, 29, 11.688910 +4, hangzhou, blue, 1, 1575129690000, 24, 15.830195 +4, hangzhou, blue, 1, 1575129691000, 33, 13.083720 +4, hangzhou, blue, 1, 1575129692000, 25, 15.003569 +4, hangzhou, blue, 1, 1575129693000, 16, 14.412837 +4, hangzhou, blue, 1, 1575129694000, 26, 18.930523 +4, hangzhou, blue, 1, 1575129695000, 19, 10.657332 +4, hangzhou, blue, 1, 1575129696000, 28, 11.193432 +4, hangzhou, blue, 1, 1575129697000, 17, 18.000253 +4, hangzhou, blue, 1, 1575129698000, 21, 15.908098 +4, hangzhou, blue, 1, 1575129699000, 25, 14.506726 +5, nanjing, white, 2, 1575129600000, 20, 17.327941 +5, nanjing, white, 2, 1575129601000, 18, 14.271766 +5, nanjing, white, 2, 1575129602000, 26, 19.593114 +5, nanjing, white, 2, 1575129603000, 19, 13.142911 +5, nanjing, white, 2, 1575129604000, 27, 15.166424 +5, nanjing, white, 2, 1575129605000, 28, 11.804980 +5, nanjing, white, 2, 1575129606000, 24, 17.625403 +5, nanjing, white, 2, 1575129607000, 19, 11.373316 +5, nanjing, white, 2, 1575129608000, 34, 19.434849 +5, nanjing, white, 2, 1575129609000, 31, 14.078995 +5, nanjing, white, 2, 1575129610000, 27, 11.647533 +5, nanjing, white, 2, 1575129611000, 25, 16.624403 +5, nanjing, white, 2, 1575129612000, 28, 12.862567 +5, nanjing, white, 2, 1575129613000, 20, 18.218963 +5, nanjing, white, 2, 1575129614000, 17, 10.021056 +5, nanjing, white, 2, 1575129615000, 30, 16.042743 +5, nanjing, white, 2, 1575129616000, 26, 11.424560 +5, nanjing, white, 2, 1575129617000, 21, 10.094065 +5, nanjing, white, 2, 1575129618000, 31, 15.982905 +5, nanjing, white, 2, 1575129619000, 17, 15.925533 +5, nanjing, white, 2, 1575129620000, 30, 15.622108 +5, nanjing, white, 2, 1575129621000, 18, 19.320662 +5, nanjing, white, 2, 1575129622000, 19, 14.068873 +5, nanjing, white, 2, 1575129623000, 15, 15.213653 +5, nanjing, white, 2, 1575129624000, 32, 16.028939 +5, nanjing, white, 2, 1575129625000, 28, 17.858151 +5, nanjing, white, 2, 1575129626000, 18, 11.261528 +5, nanjing, white, 2, 1575129627000, 21, 10.262692 +5, nanjing, white, 2, 1575129628000, 27, 13.190850 +5, nanjing, white, 2, 1575129629000, 17, 15.404541 +5, nanjing, white, 2, 1575129630000, 27, 10.852643 +5, nanjing, white, 2, 1575129631000, 23, 13.134271 +5, nanjing, white, 2, 1575129632000, 22, 19.928938 +5, nanjing, white, 2, 1575129633000, 19, 10.683633 +5, nanjing, white, 2, 1575129634000, 29, 15.450679 +5, nanjing, white, 2, 1575129635000, 20, 17.032495 +5, nanjing, white, 2, 1575129636000, 21, 16.081343 +5, nanjing, white, 2, 1575129637000, 31, 15.173797 +5, nanjing, white, 2, 1575129638000, 17, 18.062092 +5, nanjing, white, 2, 1575129639000, 22, 14.139422 +5, nanjing, white, 2, 1575129640000, 30, 15.335309 +5, nanjing, white, 2, 1575129641000, 30, 18.381148 +5, nanjing, white, 2, 1575129642000, 28, 15.640517 +5, nanjing, white, 2, 1575129643000, 15, 10.603125 +5, nanjing, white, 2, 1575129644000, 18, 12.096534 +5, nanjing, white, 2, 1575129645000, 27, 17.015026 +5, nanjing, white, 2, 1575129646000, 24, 15.616134 +5, nanjing, white, 2, 1575129647000, 32, 15.552120 +5, nanjing, white, 2, 1575129648000, 18, 13.846167 +5, nanjing, white, 2, 1575129649000, 32, 15.406105 +5, nanjing, white, 2, 1575129650000, 19, 14.396603 +5, nanjing, white, 2, 1575129651000, 34, 15.660214 +5, nanjing, white, 2, 1575129652000, 29, 19.035787 +5, nanjing, white, 2, 1575129653000, 26, 14.746065 +5, nanjing, white, 2, 1575129654000, 29, 14.144764 +5, nanjing, white, 2, 1575129655000, 32, 11.953327 +5, nanjing, white, 2, 1575129656000, 16, 11.546639 +5, nanjing, white, 2, 1575129657000, 20, 12.779206 +5, nanjing, white, 2, 1575129658000, 16, 16.364659 +5, nanjing, white, 2, 1575129659000, 29, 10.204467 +5, nanjing, white, 2, 1575129660000, 22, 18.824781 +5, nanjing, white, 2, 1575129661000, 26, 18.795199 +5, nanjing, white, 2, 1575129662000, 16, 12.142987 +5, nanjing, white, 2, 1575129663000, 30, 13.810269 +5, nanjing, white, 2, 1575129664000, 28, 19.670323 +5, nanjing, white, 2, 1575129665000, 17, 10.776152 +5, nanjing, white, 2, 1575129666000, 31, 18.095779 +5, nanjing, white, 2, 1575129667000, 34, 12.720668 +5, nanjing, white, 2, 1575129668000, 27, 18.285647 +5, nanjing, white, 2, 1575129669000, 18, 15.929034 +5, nanjing, white, 2, 1575129670000, 27, 10.397290 +5, nanjing, white, 2, 1575129671000, 29, 12.914206 +5, nanjing, white, 2, 1575129672000, 29, 11.560832 +5, nanjing, white, 2, 1575129673000, 21, 15.487904 +5, nanjing, white, 2, 1575129674000, 28, 11.585003 +5, nanjing, white, 2, 1575129675000, 30, 15.042832 +5, nanjing, white, 2, 1575129676000, 23, 12.408045 +5, nanjing, white, 2, 1575129677000, 15, 17.353187 +5, nanjing, white, 2, 1575129678000, 31, 18.084138 +5, nanjing, white, 2, 1575129679000, 34, 10.756624 +5, nanjing, white, 2, 1575129680000, 19, 13.270267 +5, nanjing, white, 2, 1575129681000, 27, 16.639891 +5, nanjing, white, 2, 1575129682000, 31, 14.671892 +5, nanjing, white, 2, 1575129683000, 27, 10.554016 +5, nanjing, white, 2, 1575129684000, 16, 14.507173 +5, nanjing, white, 2, 1575129685000, 19, 11.977540 +5, nanjing, white, 2, 1575129686000, 26, 13.286239 +5, nanjing, white, 2, 1575129687000, 30, 17.858074 +5, nanjing, white, 2, 1575129688000, 24, 19.446978 +5, nanjing, white, 2, 1575129689000, 21, 19.698453 +5, nanjing, white, 2, 1575129690000, 21, 19.494527 +5, nanjing, white, 2, 1575129691000, 34, 11.911972 +5, nanjing, white, 2, 1575129692000, 16, 16.283904 +5, nanjing, white, 2, 1575129693000, 29, 12.346139 +5, nanjing, white, 2, 1575129694000, 25, 10.589538 +5, nanjing, white, 2, 1575129695000, 23, 16.730700 +5, nanjing, white, 2, 1575129696000, 33, 16.858111 +5, nanjing, white, 2, 1575129697000, 27, 13.779923 +5, nanjing, white, 2, 1575129698000, 20, 11.035122 +5, nanjing, white, 2, 1575129699000, 34, 10.444430 +6, wuhan, black, 0, 1575129600000, 30, 13.948532 +6, wuhan, black, 0, 1575129601000, 28, 12.860198 +6, wuhan, black, 0, 1575129602000, 32, 14.979606 +6, wuhan, black, 0, 1575129603000, 22, 11.844284 +6, wuhan, black, 0, 1575129604000, 16, 19.507148 +6, wuhan, black, 0, 1575129605000, 22, 14.315308 +6, wuhan, black, 0, 1575129606000, 19, 13.773210 +6, wuhan, black, 0, 1575129607000, 31, 18.224420 +6, wuhan, black, 0, 1575129608000, 28, 15.962573 +6, wuhan, black, 0, 1575129609000, 32, 12.855757 +6, wuhan, black, 0, 1575129610000, 32, 11.010859 +6, wuhan, black, 0, 1575129611000, 33, 11.110190 +6, wuhan, black, 0, 1575129612000, 24, 18.628721 +6, wuhan, black, 0, 1575129613000, 30, 16.044831 +6, wuhan, black, 0, 1575129614000, 29, 14.617854 +6, wuhan, black, 0, 1575129615000, 31, 15.591157 +6, wuhan, black, 0, 1575129616000, 31, 12.486593 +6, wuhan, black, 0, 1575129617000, 21, 17.680152 +6, wuhan, black, 0, 1575129618000, 27, 10.341043 +6, wuhan, black, 0, 1575129619000, 28, 13.359138 +6, wuhan, black, 0, 1575129620000, 30, 19.654174 +6, wuhan, black, 0, 1575129621000, 28, 18.037469 +6, wuhan, black, 0, 1575129622000, 25, 18.404051 +6, wuhan, black, 0, 1575129623000, 16, 14.856599 +6, wuhan, black, 0, 1575129624000, 29, 19.552920 +6, wuhan, black, 0, 1575129625000, 17, 13.434096 +6, wuhan, black, 0, 1575129626000, 27, 17.019559 +6, wuhan, black, 0, 1575129627000, 26, 15.173058 +6, wuhan, black, 0, 1575129628000, 32, 12.826764 +6, wuhan, black, 0, 1575129629000, 26, 17.535447 +6, wuhan, black, 0, 1575129630000, 21, 14.249137 +6, wuhan, black, 0, 1575129631000, 17, 17.047627 +6, wuhan, black, 0, 1575129632000, 27, 16.650397 +6, wuhan, black, 0, 1575129633000, 15, 13.081019 +6, wuhan, black, 0, 1575129634000, 31, 16.957137 +6, wuhan, black, 0, 1575129635000, 16, 14.120849 +6, wuhan, black, 0, 1575129636000, 20, 19.559244 +6, wuhan, black, 0, 1575129637000, 24, 17.951023 +6, wuhan, black, 0, 1575129638000, 28, 12.034821 +6, wuhan, black, 0, 1575129639000, 27, 19.410968 +6, wuhan, black, 0, 1575129640000, 32, 19.163660 +6, wuhan, black, 0, 1575129641000, 19, 18.268331 +6, wuhan, black, 0, 1575129642000, 17, 13.487017 +6, wuhan, black, 0, 1575129643000, 15, 19.085113 +6, wuhan, black, 0, 1575129644000, 31, 18.786878 +6, wuhan, black, 0, 1575129645000, 25, 17.901693 +6, wuhan, black, 0, 1575129646000, 16, 13.458948 +6, wuhan, black, 0, 1575129647000, 17, 16.372939 +6, wuhan, black, 0, 1575129648000, 20, 16.547324 +6, wuhan, black, 0, 1575129649000, 22, 14.801144 +6, wuhan, black, 0, 1575129650000, 16, 15.819640 +6, wuhan, black, 0, 1575129651000, 24, 16.569364 +6, wuhan, black, 0, 1575129652000, 29, 13.750153 +6, wuhan, black, 0, 1575129653000, 16, 14.846974 +6, wuhan, black, 0, 1575129654000, 23, 15.937862 +6, wuhan, black, 0, 1575129655000, 32, 19.969213 +6, wuhan, black, 0, 1575129656000, 17, 16.589262 +6, wuhan, black, 0, 1575129657000, 16, 15.983127 +6, wuhan, black, 0, 1575129658000, 32, 19.981177 +6, wuhan, black, 0, 1575129659000, 30, 15.526706 +6, wuhan, black, 0, 1575129660000, 30, 11.473325 +6, wuhan, black, 0, 1575129661000, 34, 14.734314 +6, wuhan, black, 0, 1575129662000, 31, 19.298395 +6, wuhan, black, 0, 1575129663000, 22, 16.150773 +6, wuhan, black, 0, 1575129664000, 18, 10.211251 +6, wuhan, black, 0, 1575129665000, 23, 16.773732 +6, wuhan, black, 0, 1575129666000, 22, 14.005852 +6, wuhan, black, 0, 1575129667000, 17, 13.159840 +6, wuhan, black, 0, 1575129668000, 26, 13.747615 +6, wuhan, black, 0, 1575129669000, 26, 14.601900 +6, wuhan, black, 0, 1575129670000, 29, 10.489225 +6, wuhan, black, 0, 1575129671000, 21, 16.890829 +6, wuhan, black, 0, 1575129672000, 26, 11.081302 +6, wuhan, black, 0, 1575129673000, 26, 19.336692 +6, wuhan, black, 0, 1575129674000, 22, 13.601869 +6, wuhan, black, 0, 1575129675000, 19, 11.627652 +6, wuhan, black, 0, 1575129676000, 19, 13.767122 +6, wuhan, black, 0, 1575129677000, 17, 15.320825 +6, wuhan, black, 0, 1575129678000, 16, 13.546837 +6, wuhan, black, 0, 1575129679000, 26, 19.562339 +6, wuhan, black, 0, 1575129680000, 24, 18.861545 +6, wuhan, black, 0, 1575129681000, 22, 11.048994 +6, wuhan, black, 0, 1575129682000, 32, 18.633559 +6, wuhan, black, 0, 1575129683000, 24, 11.423349 +6, wuhan, black, 0, 1575129684000, 31, 10.958536 +6, wuhan, black, 0, 1575129685000, 27, 16.700368 +6, wuhan, black, 0, 1575129686000, 32, 19.383603 +6, wuhan, black, 0, 1575129687000, 25, 12.817186 +6, wuhan, black, 0, 1575129688000, 21, 19.289010 +6, wuhan, black, 0, 1575129689000, 21, 18.514933 +6, wuhan, black, 0, 1575129690000, 22, 19.214387 +6, wuhan, black, 0, 1575129691000, 33, 11.673355 +6, wuhan, black, 0, 1575129692000, 23, 18.321138 +6, wuhan, black, 0, 1575129693000, 29, 11.371021 +6, wuhan, black, 0, 1575129694000, 32, 10.531389 +6, wuhan, black, 0, 1575129695000, 18, 15.921944 +6, wuhan, black, 0, 1575129696000, 27, 16.780309 +6, wuhan, black, 0, 1575129697000, 29, 12.028908 +6, wuhan, black, 0, 1575129698000, 32, 14.714637 +6, wuhan, black, 0, 1575129699000, 29, 12.753968 +7, suzhou, green, 1, 1575129600000, 24, 15.501768 +7, suzhou, green, 1, 1575129601000, 18, 17.583403 +7, suzhou, green, 1, 1575129602000, 15, 14.919566 +7, suzhou, green, 1, 1575129603000, 34, 11.870620 +7, suzhou, green, 1, 1575129604000, 29, 13.098385 +7, suzhou, green, 1, 1575129605000, 16, 17.498160 +7, suzhou, green, 1, 1575129606000, 30, 19.744556 +7, suzhou, green, 1, 1575129607000, 33, 16.558870 +7, suzhou, green, 1, 1575129608000, 16, 12.532103 +7, suzhou, green, 1, 1575129609000, 16, 16.504603 +7, suzhou, green, 1, 1575129610000, 25, 11.681246 +7, suzhou, green, 1, 1575129611000, 30, 10.620805 +7, suzhou, green, 1, 1575129612000, 22, 16.687937 +7, suzhou, green, 1, 1575129613000, 25, 17.911474 +7, suzhou, green, 1, 1575129614000, 32, 11.036519 +7, suzhou, green, 1, 1575129615000, 29, 16.162914 +7, suzhou, green, 1, 1575129616000, 30, 10.425992 +7, suzhou, green, 1, 1575129617000, 34, 19.630803 +7, suzhou, green, 1, 1575129618000, 29, 17.739556 +7, suzhou, green, 1, 1575129619000, 32, 17.805220 +7, suzhou, green, 1, 1575129620000, 23, 15.547236 +7, suzhou, green, 1, 1575129621000, 19, 13.928559 +7, suzhou, green, 1, 1575129622000, 34, 15.063669 +7, suzhou, green, 1, 1575129623000, 33, 16.968293 +7, suzhou, green, 1, 1575129624000, 24, 17.425284 +7, suzhou, green, 1, 1575129625000, 29, 12.856950 +7, suzhou, green, 1, 1575129626000, 16, 10.769358 +7, suzhou, green, 1, 1575129627000, 19, 19.106196 +7, suzhou, green, 1, 1575129628000, 15, 18.987306 +7, suzhou, green, 1, 1575129629000, 18, 19.311755 +7, suzhou, green, 1, 1575129630000, 20, 11.854711 +7, suzhou, green, 1, 1575129631000, 17, 11.268703 +7, suzhou, green, 1, 1575129632000, 28, 18.451425 +7, suzhou, green, 1, 1575129633000, 30, 15.813294 +7, suzhou, green, 1, 1575129634000, 28, 14.549649 +7, suzhou, green, 1, 1575129635000, 30, 18.777474 +7, suzhou, green, 1, 1575129636000, 28, 18.789080 +7, suzhou, green, 1, 1575129637000, 22, 12.038230 +7, suzhou, green, 1, 1575129638000, 15, 10.294816 +7, suzhou, green, 1, 1575129639000, 18, 19.396735 +7, suzhou, green, 1, 1575129640000, 20, 17.763178 +7, suzhou, green, 1, 1575129641000, 27, 17.413355 +7, suzhou, green, 1, 1575129642000, 29, 12.723483 +7, suzhou, green, 1, 1575129643000, 29, 12.753222 +7, suzhou, green, 1, 1575129644000, 25, 11.097518 +7, suzhou, green, 1, 1575129645000, 27, 15.300300 +7, suzhou, green, 1, 1575129646000, 34, 11.625943 +7, suzhou, green, 1, 1575129647000, 25, 16.646308 +7, suzhou, green, 1, 1575129648000, 31, 10.940592 +7, suzhou, green, 1, 1575129649000, 25, 18.853796 +7, suzhou, green, 1, 1575129650000, 23, 16.183418 +7, suzhou, green, 1, 1575129651000, 34, 15.379113 +7, suzhou, green, 1, 1575129652000, 15, 10.424659 +7, suzhou, green, 1, 1575129653000, 25, 10.196040 +7, suzhou, green, 1, 1575129654000, 24, 15.591199 +7, suzhou, green, 1, 1575129655000, 31, 17.032220 +7, suzhou, green, 1, 1575129656000, 30, 14.349576 +7, suzhou, green, 1, 1575129657000, 21, 14.315072 +7, suzhou, green, 1, 1575129658000, 18, 12.297491 +7, suzhou, green, 1, 1575129659000, 27, 13.134474 +7, suzhou, green, 1, 1575129660000, 28, 16.510527 +7, suzhou, green, 1, 1575129661000, 21, 17.905938 +7, suzhou, green, 1, 1575129662000, 16, 14.310720 +7, suzhou, green, 1, 1575129663000, 33, 12.415139 +7, suzhou, green, 1, 1575129664000, 28, 19.899145 +7, suzhou, green, 1, 1575129665000, 32, 18.874009 +7, suzhou, green, 1, 1575129666000, 34, 16.834873 +7, suzhou, green, 1, 1575129667000, 16, 18.383447 +7, suzhou, green, 1, 1575129668000, 29, 11.365641 +7, suzhou, green, 1, 1575129669000, 34, 13.137474 +7, suzhou, green, 1, 1575129670000, 18, 13.566243 +7, suzhou, green, 1, 1575129671000, 27, 16.454975 +7, suzhou, green, 1, 1575129672000, 21, 10.957562 +7, suzhou, green, 1, 1575129673000, 24, 14.916977 +7, suzhou, green, 1, 1575129674000, 28, 12.449565 +7, suzhou, green, 1, 1575129675000, 20, 10.217084 +7, suzhou, green, 1, 1575129676000, 32, 15.026526 +7, suzhou, green, 1, 1575129677000, 20, 10.291223 +7, suzhou, green, 1, 1575129678000, 24, 13.561227 +7, suzhou, green, 1, 1575129679000, 26, 10.091348 +7, suzhou, green, 1, 1575129680000, 25, 13.574391 +7, suzhou, green, 1, 1575129681000, 33, 17.308216 +7, suzhou, green, 1, 1575129682000, 15, 11.635235 +7, suzhou, green, 1, 1575129683000, 31, 19.967076 +7, suzhou, green, 1, 1575129684000, 25, 11.849431 +7, suzhou, green, 1, 1575129685000, 31, 16.161484 +7, suzhou, green, 1, 1575129686000, 20, 15.716389 +7, suzhou, green, 1, 1575129687000, 22, 17.486091 +7, suzhou, green, 1, 1575129688000, 29, 10.390956 +7, suzhou, green, 1, 1575129689000, 18, 18.549987 +7, suzhou, green, 1, 1575129690000, 21, 12.367505 +7, suzhou, green, 1, 1575129691000, 30, 12.345558 +7, suzhou, green, 1, 1575129692000, 17, 14.100245 +7, suzhou, green, 1, 1575129693000, 19, 11.093554 +7, suzhou, green, 1, 1575129694000, 26, 13.614985 +7, suzhou, green, 1, 1575129695000, 28, 13.753683 +7, suzhou, green, 1, 1575129696000, 21, 12.691688 +7, suzhou, green, 1, 1575129697000, 29, 17.595583 +7, suzhou, green, 1, 1575129698000, 20, 13.184472 +7, suzhou, green, 1, 1575129699000, 17, 14.349156 +8, haerbing, yellow, 2, 1575129600000, 28, 13.254039 +8, haerbing, yellow, 2, 1575129601000, 21, 17.815564 +8, haerbing, yellow, 2, 1575129602000, 19, 11.209747 +8, haerbing, yellow, 2, 1575129603000, 26, 16.861074 +8, haerbing, yellow, 2, 1575129604000, 31, 11.504868 +8, haerbing, yellow, 2, 1575129605000, 34, 19.224629 +8, haerbing, yellow, 2, 1575129606000, 23, 11.358596 +8, haerbing, yellow, 2, 1575129607000, 31, 12.635280 +8, haerbing, yellow, 2, 1575129608000, 26, 11.433395 +8, haerbing, yellow, 2, 1575129609000, 17, 13.468466 +8, haerbing, yellow, 2, 1575129610000, 33, 14.519953 +8, haerbing, yellow, 2, 1575129611000, 15, 14.241436 +8, haerbing, yellow, 2, 1575129612000, 16, 13.055456 +8, haerbing, yellow, 2, 1575129613000, 17, 13.772431 +8, haerbing, yellow, 2, 1575129614000, 19, 12.057286 +8, haerbing, yellow, 2, 1575129615000, 19, 13.647710 +8, haerbing, yellow, 2, 1575129616000, 20, 15.103685 +8, haerbing, yellow, 2, 1575129617000, 18, 16.627761 +8, haerbing, yellow, 2, 1575129618000, 26, 18.441795 +8, haerbing, yellow, 2, 1575129619000, 15, 18.348824 +8, haerbing, yellow, 2, 1575129620000, 32, 18.431012 +8, haerbing, yellow, 2, 1575129621000, 17, 10.795047 +8, haerbing, yellow, 2, 1575129622000, 34, 10.793828 +8, haerbing, yellow, 2, 1575129623000, 18, 16.664458 +8, haerbing, yellow, 2, 1575129624000, 22, 16.533227 +8, haerbing, yellow, 2, 1575129625000, 15, 12.870278 +8, haerbing, yellow, 2, 1575129626000, 31, 17.592231 +8, haerbing, yellow, 2, 1575129627000, 17, 10.092316 +8, haerbing, yellow, 2, 1575129628000, 22, 10.988946 +8, haerbing, yellow, 2, 1575129629000, 17, 14.493579 +8, haerbing, yellow, 2, 1575129630000, 20, 11.943546 +8, haerbing, yellow, 2, 1575129631000, 28, 19.871601 +8, haerbing, yellow, 2, 1575129632000, 16, 16.607235 +8, haerbing, yellow, 2, 1575129633000, 19, 10.197650 +8, haerbing, yellow, 2, 1575129634000, 19, 10.742104 +8, haerbing, yellow, 2, 1575129635000, 30, 18.785863 +8, haerbing, yellow, 2, 1575129636000, 16, 14.827333 +8, haerbing, yellow, 2, 1575129637000, 28, 13.826542 +8, haerbing, yellow, 2, 1575129638000, 16, 18.638533 +8, haerbing, yellow, 2, 1575129639000, 24, 17.832974 +8, haerbing, yellow, 2, 1575129640000, 31, 14.904558 +8, haerbing, yellow, 2, 1575129641000, 32, 16.034774 +8, haerbing, yellow, 2, 1575129642000, 33, 16.879997 +8, haerbing, yellow, 2, 1575129643000, 18, 16.981511 +8, haerbing, yellow, 2, 1575129644000, 19, 18.554924 +8, haerbing, yellow, 2, 1575129645000, 28, 12.138742 +8, haerbing, yellow, 2, 1575129646000, 27, 17.938497 +8, haerbing, yellow, 2, 1575129647000, 25, 16.919425 +8, haerbing, yellow, 2, 1575129648000, 15, 17.739521 +8, haerbing, yellow, 2, 1575129649000, 26, 16.017035 +8, haerbing, yellow, 2, 1575129650000, 20, 14.530903 +8, haerbing, yellow, 2, 1575129651000, 32, 10.938258 +8, haerbing, yellow, 2, 1575129652000, 18, 15.265134 +8, haerbing, yellow, 2, 1575129653000, 25, 11.227825 +8, haerbing, yellow, 2, 1575129654000, 32, 15.839538 +8, haerbing, yellow, 2, 1575129655000, 20, 12.813906 +8, haerbing, yellow, 2, 1575129656000, 34, 14.348205 +8, haerbing, yellow, 2, 1575129657000, 23, 13.158134 +8, haerbing, yellow, 2, 1575129658000, 27, 18.320920 +8, haerbing, yellow, 2, 1575129659000, 31, 10.848533 +8, haerbing, yellow, 2, 1575129660000, 21, 13.549193 +8, haerbing, yellow, 2, 1575129661000, 21, 10.043014 +8, haerbing, yellow, 2, 1575129662000, 17, 13.852666 +8, haerbing, yellow, 2, 1575129663000, 20, 13.046154 +8, haerbing, yellow, 2, 1575129664000, 15, 15.538251 +8, haerbing, yellow, 2, 1575129665000, 25, 15.422191 +8, haerbing, yellow, 2, 1575129666000, 23, 17.912156 +8, haerbing, yellow, 2, 1575129667000, 31, 10.870706 +8, haerbing, yellow, 2, 1575129668000, 15, 15.348852 +8, haerbing, yellow, 2, 1575129669000, 15, 19.605174 +8, haerbing, yellow, 2, 1575129670000, 20, 12.633162 +8, haerbing, yellow, 2, 1575129671000, 23, 15.347140 +8, haerbing, yellow, 2, 1575129672000, 23, 19.131427 +8, haerbing, yellow, 2, 1575129673000, 28, 17.031277 +8, haerbing, yellow, 2, 1575129674000, 25, 12.871234 +8, haerbing, yellow, 2, 1575129675000, 27, 12.112865 +8, haerbing, yellow, 2, 1575129676000, 28, 14.989160 +8, haerbing, yellow, 2, 1575129677000, 34, 12.925199 +8, haerbing, yellow, 2, 1575129678000, 30, 11.244869 +8, haerbing, yellow, 2, 1575129679000, 34, 13.189385 +8, haerbing, yellow, 2, 1575129680000, 32, 12.347545 +8, haerbing, yellow, 2, 1575129681000, 29, 14.551418 +8, haerbing, yellow, 2, 1575129682000, 30, 14.502223 +8, haerbing, yellow, 2, 1575129683000, 32, 13.304706 +8, haerbing, yellow, 2, 1575129684000, 25, 12.030741 +8, haerbing, yellow, 2, 1575129685000, 17, 16.387617 +8, haerbing, yellow, 2, 1575129686000, 15, 19.766795 +8, haerbing, yellow, 2, 1575129687000, 21, 16.533866 +8, haerbing, yellow, 2, 1575129688000, 17, 11.657003 +8, haerbing, yellow, 2, 1575129689000, 34, 12.667008 +8, haerbing, yellow, 2, 1575129690000, 22, 15.673815 +8, haerbing, yellow, 2, 1575129691000, 22, 15.767975 +8, haerbing, yellow, 2, 1575129692000, 31, 19.982548 +8, haerbing, yellow, 2, 1575129693000, 29, 19.036149 +8, haerbing, yellow, 2, 1575129694000, 24, 16.044736 +8, haerbing, yellow, 2, 1575129695000, 19, 12.138802 +8, haerbing, yellow, 2, 1575129696000, 28, 17.771396 +8, haerbing, yellow, 2, 1575129697000, 31, 16.321497 +8, haerbing, yellow, 2, 1575129698000, 25, 15.864515 +8, haerbing, yellow, 2, 1575129699000, 25, 16.492443 +9, sijiazhuang, blue, 0, 1575129600000, 23, 16.002889 +9, sijiazhuang, blue, 0, 1575129601000, 26, 17.034610 +9, sijiazhuang, blue, 0, 1575129602000, 29, 12.892319 +9, sijiazhuang, blue, 0, 1575129603000, 34, 15.321807 +9, sijiazhuang, blue, 0, 1575129604000, 29, 12.562642 +9, sijiazhuang, blue, 0, 1575129605000, 32, 17.190246 +9, sijiazhuang, blue, 0, 1575129606000, 19, 15.361774 +9, sijiazhuang, blue, 0, 1575129607000, 26, 15.022364 +9, sijiazhuang, blue, 0, 1575129608000, 31, 14.837084 +9, sijiazhuang, blue, 0, 1575129609000, 25, 11.554289 +9, sijiazhuang, blue, 0, 1575129610000, 21, 15.313973 +9, sijiazhuang, blue, 0, 1575129611000, 27, 18.621783 +9, sijiazhuang, blue, 0, 1575129612000, 31, 18.018101 +9, sijiazhuang, blue, 0, 1575129613000, 23, 14.421450 +9, sijiazhuang, blue, 0, 1575129614000, 28, 10.833142 +9, sijiazhuang, blue, 0, 1575129615000, 33, 18.169837 +9, sijiazhuang, blue, 0, 1575129616000, 21, 18.772730 +9, sijiazhuang, blue, 0, 1575129617000, 24, 18.893146 +9, sijiazhuang, blue, 0, 1575129618000, 24, 10.290187 +9, sijiazhuang, blue, 0, 1575129619000, 23, 17.393345 +9, sijiazhuang, blue, 0, 1575129620000, 30, 12.949215 +9, sijiazhuang, blue, 0, 1575129621000, 19, 19.267621 +9, sijiazhuang, blue, 0, 1575129622000, 33, 14.831735 +9, sijiazhuang, blue, 0, 1575129623000, 21, 14.711125 +9, sijiazhuang, blue, 0, 1575129624000, 16, 17.168485 +9, sijiazhuang, blue, 0, 1575129625000, 17, 16.426433 +9, sijiazhuang, blue, 0, 1575129626000, 19, 13.879050 +9, sijiazhuang, blue, 0, 1575129627000, 21, 18.308168 +9, sijiazhuang, blue, 0, 1575129628000, 17, 10.845681 +9, sijiazhuang, blue, 0, 1575129629000, 20, 10.238272 +9, sijiazhuang, blue, 0, 1575129630000, 19, 19.424976 +9, sijiazhuang, blue, 0, 1575129631000, 31, 13.885909 +9, sijiazhuang, blue, 0, 1575129632000, 15, 19.264740 +9, sijiazhuang, blue, 0, 1575129633000, 30, 12.460645 +9, sijiazhuang, blue, 0, 1575129634000, 27, 17.608036 +9, sijiazhuang, blue, 0, 1575129635000, 25, 13.493812 +9, sijiazhuang, blue, 0, 1575129636000, 19, 10.955939 +9, sijiazhuang, blue, 0, 1575129637000, 24, 11.956587 +9, sijiazhuang, blue, 0, 1575129638000, 15, 19.141381 +9, sijiazhuang, blue, 0, 1575129639000, 24, 14.801530 +9, sijiazhuang, blue, 0, 1575129640000, 17, 14.347318 +9, sijiazhuang, blue, 0, 1575129641000, 29, 14.803237 +9, sijiazhuang, blue, 0, 1575129642000, 28, 10.342297 +9, sijiazhuang, blue, 0, 1575129643000, 29, 19.368282 +9, sijiazhuang, blue, 0, 1575129644000, 31, 17.491654 +9, sijiazhuang, blue, 0, 1575129645000, 18, 13.161736 +9, sijiazhuang, blue, 0, 1575129646000, 17, 16.067354 +9, sijiazhuang, blue, 0, 1575129647000, 18, 13.736465 +9, sijiazhuang, blue, 0, 1575129648000, 23, 19.103276 +9, sijiazhuang, blue, 0, 1575129649000, 29, 16.075892 +9, sijiazhuang, blue, 0, 1575129650000, 21, 10.728566 +9, sijiazhuang, blue, 0, 1575129651000, 15, 18.921849 +9, sijiazhuang, blue, 0, 1575129652000, 24, 16.914709 +9, sijiazhuang, blue, 0, 1575129653000, 19, 13.501651 +9, sijiazhuang, blue, 0, 1575129654000, 19, 13.538347 +9, sijiazhuang, blue, 0, 1575129655000, 16, 13.261095 +9, sijiazhuang, blue, 0, 1575129656000, 32, 16.315746 +9, sijiazhuang, blue, 0, 1575129657000, 27, 16.400939 +9, sijiazhuang, blue, 0, 1575129658000, 24, 13.321819 +9, sijiazhuang, blue, 0, 1575129659000, 27, 19.070181 +9, sijiazhuang, blue, 0, 1575129660000, 27, 13.040922 +9, sijiazhuang, blue, 0, 1575129661000, 32, 10.872530 +9, sijiazhuang, blue, 0, 1575129662000, 28, 16.428657 +9, sijiazhuang, blue, 0, 1575129663000, 32, 13.883854 +9, sijiazhuang, blue, 0, 1575129664000, 33, 14.299554 +9, sijiazhuang, blue, 0, 1575129665000, 30, 16.445130 +9, sijiazhuang, blue, 0, 1575129666000, 15, 18.059404 +9, sijiazhuang, blue, 0, 1575129667000, 21, 12.348847 +9, sijiazhuang, blue, 0, 1575129668000, 32, 13.315378 +9, sijiazhuang, blue, 0, 1575129669000, 17, 15.689507 +9, sijiazhuang, blue, 0, 1575129670000, 22, 15.591808 +9, sijiazhuang, blue, 0, 1575129671000, 27, 16.386065 +9, sijiazhuang, blue, 0, 1575129672000, 25, 10.564803 +9, sijiazhuang, blue, 0, 1575129673000, 20, 12.276544 +9, sijiazhuang, blue, 0, 1575129674000, 26, 15.828786 +9, sijiazhuang, blue, 0, 1575129675000, 18, 12.236420 +9, sijiazhuang, blue, 0, 1575129676000, 15, 19.439522 +9, sijiazhuang, blue, 0, 1575129677000, 19, 19.831531 +9, sijiazhuang, blue, 0, 1575129678000, 22, 17.115744 +9, sijiazhuang, blue, 0, 1575129679000, 29, 19.879456 +9, sijiazhuang, blue, 0, 1575129680000, 34, 10.207136 +9, sijiazhuang, blue, 0, 1575129681000, 16, 17.633523 +9, sijiazhuang, blue, 0, 1575129682000, 15, 14.227873 +9, sijiazhuang, blue, 0, 1575129683000, 34, 12.027768 +9, sijiazhuang, blue, 0, 1575129684000, 22, 11.376610 +9, sijiazhuang, blue, 0, 1575129685000, 21, 11.711299 +9, sijiazhuang, blue, 0, 1575129686000, 33, 14.281126 +9, sijiazhuang, blue, 0, 1575129687000, 31, 10.895302 +9, sijiazhuang, blue, 0, 1575129688000, 31, 13.971350 +9, sijiazhuang, blue, 0, 1575129689000, 15, 15.262790 +9, sijiazhuang, blue, 0, 1575129690000, 23, 12.440568 +9, sijiazhuang, blue, 0, 1575129691000, 32, 19.731267 +9, sijiazhuang, blue, 0, 1575129692000, 22, 10.518092 +9, sijiazhuang, blue, 0, 1575129693000, 34, 17.863021 +9, sijiazhuang, blue, 0, 1575129694000, 28, 11.478909 +9, sijiazhuang, blue, 0, 1575129695000, 16, 15.075524 +9, sijiazhuang, blue, 0, 1575129696000, 16, 10.292127 +9, sijiazhuang, blue, 0, 1575129697000, 22, 13.716012 +9, sijiazhuang, blue, 0, 1575129698000, 32, 10.906551 +9, sijiazhuang, blue, 0, 1575129699000, 19, 18.386868 \ No newline at end of file diff --git a/importSampleData/import/import_config.go b/importSampleData/import/import_config.go new file mode 100644 index 0000000000000000000000000000000000000000..e7942cc5050ae369afe896d0f46a0e242fb7e8f6 --- /dev/null +++ b/importSampleData/import/import_config.go @@ -0,0 +1,66 @@ +package dataimport + +import ( + "encoding/json" + "fmt" + "path/filepath" + "sync" + + "github.com/pelletier/go-toml" +) + +var ( + cfg Config + once sync.Once +) + +// Config inclue all scene import config +type Config struct { + UserCases map[string]CaseConfig +} + +// CaseConfig include the sample data config and tdengine config +type CaseConfig struct { + Format string + FilePath string + Separator string + Stname string + SubTableName string + Timestamp string + TimestampType string + TimestampTypeFormat string + Tags []FieldInfo + Fields []FieldInfo +} + +// FieldInfo is field or tag info +type FieldInfo struct { + Name string + Type string +} + +// LoadConfig will load the specified file config +func LoadConfig(filePath string) Config { + once.Do(func() { + filePath, err := filepath.Abs(filePath) + if err != nil { + panic(err) + } + fmt.Printf("parse toml file once. filePath: %s\n", filePath) + tree, err := toml.LoadFile(filePath) + if err != nil { + panic(err) + } + + bytes, err := json.Marshal(tree.ToMap()) + if err != nil { + panic(err) + } + + err = json.Unmarshal(bytes, &cfg.UserCases) + if err != nil { + panic(err) + } + }) + return cfg +} diff --git a/packaging/cfg/taos.cfg b/packaging/cfg/taos.cfg index fa289c277cf273396375690c8a496fd4eacd77fe..1e2fb4fed4031f4a2984edf96b19cac71457c58f 100644 --- a/packaging/cfg/taos.cfg +++ b/packaging/cfg/taos.cfg @@ -5,14 +5,39 @@ # # ######################################################## +# master IP for TDengine system +# masterIp 127.0.0.1 -# Internal IP address of the server, which can be acquired by using ifconfig command. -# internalIp 127.0.0.1 +# second IP for TDengine system, for cluster version only +# secondIp 127.0.0.1 + +# IP address of the server +# privateIp 127.0.0.1 + +# public IP of server, on which the tdengine are deployed +# this IP is assigned by cloud service provider, for cluster version only +# publicIp 127.0.0.1 + +# network is bound to 0.0.0.0 +# anyIp 1 + +# set socket type ("udp" and "tcp") +# the server and client should have the same socket type. Otherwise, connect will fail +# sockettype udp # client local IP # localIp 127.0.0.1 -# data file's directory +# for the cluster version, data file's directory is configured this way +# option mount_path tier_level +# dataDir /mnt/disk1/taos 0 +# dataDir /mnt/disk2/taos 0 +# dataDir /mnt/disk3/taos 0 +# dataDir /mnt/disk4/taos 0 +# dataDir /mnt/disk5/taos 0 +# dataDir /mnt/disk6/taos 1 +# dataDir /mnt/disk7/taos 1 +# for the stand-alone version, data file's directory is configured this way # dataDir /var/lib/taos # log file's directory @@ -27,6 +52,18 @@ # port for DNode connect to Client, default udp[6035-6039] tcp[6035] # vnodeShellPort 6035 +# port for MNode connect to VNode, default udp[6040-6044] tcp[6040], for cluster version only +# mgmtVnodePort 6040 + +# port for DNode connect to DNode, default tcp[6045], for cluster version only +# vnodeVnodePort 6045 + +# port for MNode connect to MNode, default udp[6050], for cluster version only +# mgmtMgmtPort 6050 + +# port sync file MNode and MNode, default tcp[6050], for cluster version only +# mgmtSyncPort 6050 + # number of threads per CPU core # numOfThreadsPerCore 1 @@ -54,11 +91,7 @@ # interval of system monitor # monitorInterval 60 -# set socket type("udp" and "tcp"). -# The server and client should have the same socket type. Otherwise, connect will fail. -# sockettype udp - -# The compressed rpc message, option: +# the compressed rpc message, option: # -1 (no compression) # 0 (all message compressed), # > 0 (rpc message body which larger than this value will be compressed) @@ -73,12 +106,18 @@ # commit interval,unit is second # ctime 3600 -# interval of DNode report status to MNode, unit is Second +# interval of DNode report status to MNode, unit is Second, for cluster version only # statusInterval 1 # interval of Shell send HB to MNode, unit is Second # shellActivityTimer 3 +# interval of DNode send HB to DNode, unit is Second, for cluster version only +# vnodePeerHBTimer 1 + +# interval of MNode send HB to MNode, unit is Second, for cluster version only +# mgmtPeerHBTimer 1 + # time to keep MeterMeta in Cache, seconds # meterMetaKeepTimer 7200 @@ -94,6 +133,12 @@ # max number of tables # maxTables 650000 +# max number of Dnodes, for cluster version only +# maxDnodes 1000 + +# Max number of VGroups, for cluster version only +# maxVGroups 1000 + # system locale # locale en_US.UTF-8 @@ -118,6 +163,9 @@ # number of days to keep DB file # keep 3650 +# number of replications, for cluster version only +# replications 1 + # client default database(database should be created) # defaultDB @@ -139,18 +187,30 @@ # max connection to Vnode # maxVnodeConnections 10000 -# start http service in the cluster +# mnode take into account while balance, for cluster version only +# mgmtEqualVnodeNum 4 + +# number of seconds allowed for a dnode to be offline, for cluster version only +# offlineThreshold 864000 + +# start http service # http 1 -# start system monitor module in the cluster +# start system monitor module # monitor 1 +# maximum number of rows returned by the restful interface +# restfulRowLimit 10240 + # number of threads used to process http requests # httpMaxThreads 2 # pre-allocated number of http sessions # httpCacheSessions 100 +# whether to enable HTTP compression transmission +# httpEnableCompress 0 + # whether the telegraf table name contains the number of tags and the number of fields # telegrafUseFieldNum 0 diff --git a/packaging/deb/makedeb.sh b/packaging/deb/makedeb.sh index 5c2df734faf3195d783be9f337e3bd5f58cb1f64..8c55269bb9ac87112d19a120f57898b0e462cfd6 100755 --- a/packaging/deb/makedeb.sh +++ b/packaging/deb/makedeb.sh @@ -1,16 +1,20 @@ #!/bin/bash # # Generate deb package for ubuntu -# set -x +set -e +#set -x #curr_dir=$(pwd) compile_dir=$1 output_dir=$2 tdengine_ver=$3 -armver=$4 +cpuType=$4 +osType=$5 +verMode=$6 +verType=$7 script_dir="$(dirname $(readlink -f $0))" -top_dir="$(readlink -m ${script_dir}/../..)" +top_dir="$(readlink -f ${script_dir}/../..)" pkg_dir="${top_dir}/debworkroom" #echo "curr_dir: ${curr_dir}" @@ -64,15 +68,24 @@ debver="Version: "$tdengine_ver sed -i "2c$debver" ${pkg_dir}/DEBIAN/control #get taos version, then set deb name -if [ -z "$armver" ]; then - debname="TDengine-"${tdengine_ver}".deb" -elif [ "$armver" == "arm64" ]; then - debname="TDengine-"${tdengine_ver}"-arm64.deb" -elif [ "$armver" == "arm32" ]; then - debname="TDengine-"${tdengine_ver}"-arm32.deb" + + +if [ "$verMode" == "cluster" ]; then + debname="TDengine-server-"${tdengine_ver}-${osType}-${cpuType} +elif [ "$verMode" == "lite" ]; then + debname="TDengine-server-edge"-${tdengine_ver}-${osType}-${cpuType} +else + echo "unknow verMode, nor cluster or lite" + exit 1 +fi + +if [ "$verType" == "beta" ]; then + debname=${debname}-${verType}".deb" +elif [ "$verType" == "stable" ]; then + debname=${debname}".deb" else - echo "input parameter error!!!" - return + echo "unknow verType, nor stabel or beta" + exit 1 fi # make deb package diff --git a/packaging/release.sh b/packaging/release.sh index 70f7af652f172b096ff734d65b2049d4d4e77ea2..bdb18dde4cb366f7a520f67daf595d4ecb0ddf0c 100755 --- a/packaging/release.sh +++ b/packaging/release.sh @@ -5,11 +5,49 @@ set -e # set -x -armver=$1 +# releash.sh -v [cluster | lite] -c [aarch32 | aarch64 | x64 | x86 | mips64 ...] -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | ...] -V [stable | beta] + +# set parameters by default value +verMode=lite # [cluster, lite] +verType=stable # [stable, beta] +cpuType=x64 # [aarch32 | aarch64 | x64 | x86 | mips64 ...] +osType=Linux # [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | ...] + +while getopts "hv:V:c:o:" arg +do + case $arg in + v) + #echo "verMode=$OPTARG" + verMode=$( echo $OPTARG ) + ;; + V) + #echo "verType=$OPTARG" + verType=$(echo $OPTARG) + ;; + c) + #echo "cpuType=$OPTARG" + cpuType=$(echo $OPTARG) + ;; + o) + #echo "osType=$OPTARG" + osType=$(echo $OPTARG) + ;; + h) + echo "Usage: `basename $0` -v [cluster | lite] -c [aarch32 | aarch64 | x64 | x86 | mips64 ...] -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | ...] -V [stable | beta]" + exit 0 + ;; + ?) #unknow option + echo "unkonw argument" + exit 1 + ;; + esac +done + +echo "verMode=${verMode} verType=${verType} cpuType=${cpuType} osType=${osType}" curr_dir=$(pwd) script_dir="$(dirname $(readlink -f $0))" -top_dir="$(readlink -m ${script_dir}/..)" +top_dir="$(readlink -f ${script_dir}/..)" versioninfo="${top_dir}/src/util/src/version.c" csudo="" @@ -106,14 +144,24 @@ done # output the version info to the buildinfo file. build_time=$(date +"%F %R") -echo "char version[64] = \"${version}\";" > ${versioninfo} -echo "char compatible_version[64] = \"${compatible_version}\";" >> ${versioninfo} -echo "char gitinfo[128] = \"$(git rev-parse --verify HEAD)\";" >> ${versioninfo} -echo "char gitinfoOfInternal[128] = \"\";" >> ${versioninfo} +echo "char version[64] = \"${version}\";" > ${versioninfo} +echo "char compatible_version[64] = \"${compatible_version}\";" >> ${versioninfo} +echo "char gitinfo[128] = \"$(git rev-parse --verify HEAD)\";" >> ${versioninfo} +echo "char gitinfoOfInternal[128] = \"\";" >> ${versioninfo} echo "char buildinfo[512] = \"Built by ${USER} at ${build_time}\";" >> ${versioninfo} +echo "" >> ${versioninfo} +tmp_version=$(echo $version | tr -s "." "_") +if [ "$verMode" == "cluster" ]; then + libtaos_info=${tmp_version}_${osType}_${cpuType} +else + libtaos_info=edge_${tmp_version}_${osType}_${cpuType} +fi +if [ "$verType" == "beta" ]; then + libtaos_info=${libtaos_info}_${verType} +fi +echo "void libtaos_${libtaos_info}() {};" >> ${versioninfo} # 2. cmake executable file - compile_dir="${top_dir}/debug" if [ -d ${compile_dir} ]; then ${csudo} rm -rf ${compile_dir} @@ -122,16 +170,12 @@ fi ${csudo} mkdir -p ${compile_dir} cd ${compile_dir} -# arm only support lite ver -if [ -z "$armver" ]; then - cmake ../ -elif [ "$armver" == "arm64" ]; then - cmake ../ -DARMVER=arm64 -elif [ "$armver" == "arm32" ]; then - cmake ../ -DARMVER=arm32 +# check support cpu type +if [[ "$cpuType" == "x64" ]] || [[ "$cpuType" == "aarch64" ]] || [[ "$cpuType" == "aarch32" ]] || [[ "$cpuType" == "mips64" ]] ; then + cmake ../ -DCPUTYPE=${cpuType} else - echo "input parameter error!!!" - return + echo "input cpuType=${cpuType} error!!!" + exit 1 fi make @@ -143,28 +187,28 @@ cd ${curr_dir} #osinfo=$(cat /etc/os-release | grep "NAME" | cut -d '"' -f2) #echo "osinfo: ${osinfo}" -echo "do deb package for the ubuntu system" +echo "====do deb package for the ubuntu system====" output_dir="${top_dir}/debs" if [ -d ${output_dir} ]; then ${csudo} rm -rf ${output_dir} fi ${csudo} mkdir -p ${output_dir} cd ${script_dir}/deb -${csudo} ./makedeb.sh ${compile_dir} ${output_dir} ${version} ${armver} +${csudo} ./makedeb.sh ${compile_dir} ${output_dir} ${version} ${cpuType} ${osType} ${verMode} ${verType} -echo "do rpm package for the centos system" +echo "====do rpm package for the centos system====" output_dir="${top_dir}/rpms" if [ -d ${output_dir} ]; then ${csudo} rm -rf ${output_dir} fi ${csudo} mkdir -p ${output_dir} cd ${script_dir}/rpm -${csudo} ./makerpm.sh ${compile_dir} ${output_dir} ${version} ${armver} +${csudo} ./makerpm.sh ${compile_dir} ${output_dir} ${version} ${cpuType} ${osType} ${verMode} ${verType} -echo "do tar.gz package for all systems" +echo "====do tar.gz package for all systems====" cd ${script_dir}/tools -${csudo} ./makepkg.sh ${compile_dir} ${version} "${build_time}" ${armver} -${csudo} ./makeclient.sh ${compile_dir} ${version} "${build_time}" ${armver} +${csudo} ./makepkg.sh ${compile_dir} ${version} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} +${csudo} ./makeclient.sh ${compile_dir} ${version} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} # 4. Clean up temporary compile directories #${csudo} rm -rf ${compile_dir} diff --git a/packaging/rpm/makerpm.sh b/packaging/rpm/makerpm.sh index aef01875cbb15963f9289983c8e42649707b10bf..e76e16084386026f44be89f6d242cccc7bf9b605 100755 --- a/packaging/rpm/makerpm.sh +++ b/packaging/rpm/makerpm.sh @@ -9,10 +9,13 @@ compile_dir=$1 output_dir=$2 tdengine_ver=$3 -armver=$4 +cpuType=$4 +osType=$5 +verMode=$6 +verType=$7 script_dir="$(dirname $(readlink -f $0))" -top_dir="$(readlink -m ${script_dir}/../..)" +top_dir="$(readlink -f ${script_dir}/../..)" pkg_dir="${top_dir}/rpmworkroom" spec_file="${script_dir}/tdengine.spec" @@ -55,15 +58,30 @@ ${csudo} mkdir -p BUILD BUILDROOT RPMS SOURCES SPECS SRPMS ${csudo} rpmbuild --define="_version ${tdengine_ver}" --define="_topdir ${pkg_dir}" --define="_compiledir ${compile_dir}" -bb ${spec_file} -# copy rpm package to output_dir, then clean temp dir +# copy rpm package to output_dir, and modify package name, then clean temp dir #${csudo} cp -rf RPMS/* ${output_dir} cp_rpm_package ${pkg_dir}/RPMS -if [ "$armver" == "arm64" ]; then - mv ${output_dir}/TDengine-${tdengine_ver}.rpm ${output_dir}/TDengine-${tdengine_ver}-arm64.rpm -elif [ "$armver" == "arm32" ]; then - mv ${output_dir}/TDengine-${tdengine_ver}.rpm ${output_dir}/TDengine-${tdengine_ver}-arm32.rpm + +if [ "$verMode" == "cluster" ]; then + rpmname="TDengine-server-"${tdengine_ver}-${osType}-${cpuType} +elif [ "$verMode" == "lite" ]; then + rpmname="TDengine-server-edge"-${tdengine_ver}-${osType}-${cpuType} +else + echo "unknow verMode, nor cluster or lite" + exit 1 +fi + +if [ "$verType" == "beta" ]; then + rpmname=${rpmname}-${verType}".rpm" +elif [ "$verType" == "stable" ]; then + rpmname=${rpmname}".rpm" +else + echo "unknow verType, nor stabel or beta" + exit 1 fi +mv ${output_dir}/TDengine-${tdengine_ver}.rpm ${output_dir}/${rpmname} + cd .. ${csudo} rm -rf ${pkg_dir} diff --git a/packaging/tools/get_os.sh b/packaging/tools/get_os.sh new file mode 100755 index 0000000000000000000000000000000000000000..f74b63f9805e937933000d097c24bc6b85663288 --- /dev/null +++ b/packaging/tools/get_os.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# +# This file is used to install TAOS time-series database on linux systems. The operating system +# is required to use systemd to manage services at boot + +set -e +# set -x + +# -----------------------Variables definition--------------------- +OS=$(cat /etc/*-release | grep "^NAME=" | cut -d= -f2) +len=$(echo ${#OS}) +len=$((len-2)) +retval=$(echo -ne ${OS:1:${len}} | cut -d" " -f1) +echo -ne $retval diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index e1bcce401d419ce7a97c4110161777cfeea4f0e5..ea3e16d345ed427d2f81abb14d66673d4df5cfbb 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -7,7 +7,7 @@ set -e #set -x # -----------------------Variables definition--------------------- -script_dir=$(dirname $(readlink -m "$0")) +script_dir=$(dirname $(readlink -f "$0")) # Dynamic directory data_dir="/var/lib/taos" log_dir="/var/log/taos" diff --git a/packaging/tools/install_client.sh b/packaging/tools/install_client.sh index 7560ebca4140688dbbee461e58ddcfef9a4b2391..78d7b750458d7b777119315237efe574b330af6d 100755 --- a/packaging/tools/install_client.sh +++ b/packaging/tools/install_client.sh @@ -7,7 +7,7 @@ set -e #set -x # -----------------------Variables definition--------------------- -script_dir=$(dirname $(readlink -m "$0")) +script_dir=$(dirname $(readlink -f "$0")) # Dynamic directory data_dir="/var/lib/taos" log_dir="/var/log/taos" diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index b461d5c46da502651823562ae5a7af011a7f8a93..25ab39777583e7e45934c4fd1c0606095890a11c 100755 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -9,7 +9,7 @@ set -e # -----------------------Variables definition--------------------- source_dir=$1 binary_dir=$2 -script_dir=$(dirname $(readlink -m "$0")) +script_dir=$(dirname $(readlink -f "$0")) # Dynamic directory data_dir="/var/lib/taos" log_dir="/var/log/taos" diff --git a/packaging/tools/makeclient.sh b/packaging/tools/makeclient.sh index f8d21e202b8649c03d40d33d1c43c6338b12f790..d206359160100a217b3f6f4be87f1274f80b2187 100755 --- a/packaging/tools/makeclient.sh +++ b/packaging/tools/makeclient.sh @@ -1,17 +1,20 @@ #!/bin/bash # -# Generate tar.gz package for linux client +# Generate tar.gz package for linux client in all os system set -e -set -x +#set -x curr_dir=$(pwd) compile_dir=$1 version=$2 build_time=$3 -armver=$4 +cpuType=$4 +osType=$5 +verMode=$6 +verType=$7 script_dir="$(dirname $(readlink -f $0))" -top_dir="$(readlink -m ${script_dir}/../..)" +top_dir="$(readlink -f ${script_dir}/../..)" # create compressed install file. build_dir="${compile_dir}/build" @@ -19,7 +22,7 @@ code_dir="${top_dir}/src" release_dir="${top_dir}/release" #package_name='linux' -install_dir="${release_dir}/TDengine-client-${version}" +install_dir="${release_dir}/TDengine-client" # Directories and files. bin_files="${build_dir}/bin/taos ${build_dir}/bin/taosdump ${script_dir}/remove_client.sh" @@ -42,12 +45,13 @@ cp ${install_files} ${install_dir} && chmod a+x ${install_dir}/install* # Copy example code mkdir -p ${install_dir}/examples -cp -r ${top_dir}/tests/examples/c ${install_dir}/examples -cp -r ${top_dir}/tests/examples/JDBC ${install_dir}/examples -cp -r ${top_dir}/tests/examples/matlab ${install_dir}/examples -cp -r ${top_dir}/tests/examples/python ${install_dir}/examples -cp -r ${top_dir}/tests/examples/R ${install_dir}/examples -cp -r ${top_dir}/tests/examples/go ${install_dir}/examples +examples_dir="${top_dir}/tests/examples" +cp -r ${examples_dir}/c ${install_dir}/examples +cp -r ${examples_dir}/JDBC ${install_dir}/examples +cp -r ${examples_dir}/matlab ${install_dir}/examples +cp -r ${examples_dir}/python ${install_dir}/examples +cp -r ${examples_dir}/R ${install_dir}/examples +cp -r ${examples_dir}/go ${install_dir}/examples # Copy driver mkdir -p ${install_dir}/driver @@ -66,13 +70,26 @@ cp -r ${connector_dir}/go ${install_dir}/connector # exit 1 -cd ${release_dir} -if [ -z "$armver" ]; then - tar -zcv -f "$(basename ${install_dir}).tar.gz" $(basename ${install_dir}) --remove-files -elif [ "$armver" == "arm64" ]; then - tar -zcv -f "$(basename ${install_dir})-arm64.tar.gz" $(basename ${install_dir}) --remove-files -elif [ "$armver" == "arm32" ]; then - tar -zcv -f "$(basename ${install_dir})-arm32.tar.gz" $(basename ${install_dir}) --remove-files +cd ${release_dir} + +if [ "$verMode" == "cluster" ]; then + pkg_name=${install_dir}-${version}-${osType}-${cpuType} +elif [ "$verMode" == "lite" ]; then + pkg_name=${install_dir}-edge-${version}-${osType}-${cpuType} +else + echo "unknow verMode, nor cluster or lite" + exit 1 +fi + +if [ "$verType" == "beta" ]; then + pkg_name=${pkg_name}-${verType} +elif [ "$verType" == "stable" ]; then + pkg_name=${pkg_name} +else + echo "unknow verType, nor stable or beta" + exit 1 fi +tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) --remove-files + cd ${curr_dir} diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 714b74dbe6952a5ef9387e9709551fb67cf441bf..a16da7f6c3d297ef3d348ce14ba95072caca5027 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -1,15 +1,21 @@ #!/bin/bash # -# Generate deb package for other os system (no unbutu or centos) +# Generate tar.gz package for all os system + +set -e +#set -x curr_dir=$(pwd) compile_dir=$1 version=$2 build_time=$3 -armver=$4 +cpuType=$4 +osType=$5 +verMode=$6 +verType=$7 script_dir="$(dirname $(readlink -f $0))" -top_dir="$(readlink -m ${script_dir}/../..)" +top_dir="$(readlink -f ${script_dir}/../..)" # create compressed install file. build_dir="${compile_dir}/build" @@ -17,7 +23,7 @@ code_dir="${top_dir}/src" release_dir="${top_dir}/release" #package_name='linux' -install_dir="${release_dir}/TDengine-${version}" +install_dir="${release_dir}/TDengine-server" # Directories and files. bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${build_dir}/bin/taosdemo ${build_dir}/bin/taosdump ${script_dir}/remove.sh" @@ -77,13 +83,26 @@ cp -r ${connector_dir}/go ${install_dir}/connector # exit 1 -cd ${release_dir} -if [ -z "$armver" ]; then - tar -zcv -f "$(basename ${install_dir}).tar.gz" $(basename ${install_dir}) --remove-files -elif [ "$armver" == "arm64" ]; then - tar -zcv -f "$(basename ${install_dir})-arm64.tar.gz" $(basename ${install_dir}) --remove-files -elif [ "$armver" == "arm32" ]; then - tar -zcv -f "$(basename ${install_dir})-arm32.tar.gz" $(basename ${install_dir}) --remove-files +cd ${release_dir} + +if [ "$verMode" == "cluster" ]; then + pkg_name=${install_dir}-${version}-${osType}-${cpuType} +elif [ "$verMode" == "lite" ]; then + pkg_name=${install_dir}-edge-${version}-${osType}-${cpuType} +else + echo "unknow verMode, nor cluster or lite" + exit 1 fi +if [ "$verType" == "beta" ]; then + pkg_name=${pkg_name}-${verType} +elif [ "$verType" == "stable" ]; then + pkg_name=${pkg_name} +else + echo "unknow verType, nor stabel or beta" + exit 1 +fi + +tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) --remove-files + cd ${curr_dir} diff --git a/packaging/tools/post.sh b/packaging/tools/post.sh index a62f7a5eeb44730f4d68d5f018eeea49b807da3a..eea36f4484707e8ae1a0a18b5296f7aa1d899ee0 100755 --- a/packaging/tools/post.sh +++ b/packaging/tools/post.sh @@ -4,7 +4,7 @@ # is required to use systemd to manage services at boot #set -x # -----------------------Variables definition--------------------- -script_dir=$(dirname $(readlink -m "$0")) +script_dir=$(dirname $(readlink -f "$0")) # Dynamic directory data_dir="/var/lib/taos" log_dir="/var/log/taos" diff --git a/packaging/tools/repair_link.sh b/packaging/tools/repair_link.sh index 42b1082a9e848cfbf3320e62fdab3b1d3b48c616..7fd503f27013a9fce7208ece4335a1f427e05c9d 100755 --- a/packaging/tools/repair_link.sh +++ b/packaging/tools/repair_link.sh @@ -17,7 +17,7 @@ done declare -A dirHash for linkFile in $(find -L $linkDir -xtype l); do - targetFile=$(readlink -m $linkFile) + targetFile=$(readlink -f $linkFile) echo "targetFile: ${targetFile}" # TODO : Extract directory part and basename part dirName=$(dirname $(dirname ${targetFile})) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index d3baf84d6754ad2edcf1ac193cd46020760553ea..12c01ba75ae6ba56cd54fd7c5d54ee3c5081430f 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -51,7 +51,9 @@ ELSEIF (TD_WINDOWS_64) # generate dynamic library (*.dll) ADD_LIBRARY(taos SHARED ${SRC}) - SET_TARGET_PROPERTIES(taos PROPERTIES LINK_FLAGS /DEF:${TD_COMMUNITY_DIR}/src/client/src/taos.def) + IF (NOT TD_GODLL) + SET_TARGET_PROPERTIES(taos PROPERTIES LINK_FLAGS /DEF:${TD_COMMUNITY_DIR}/src/client/src/taos.def) + ENDIF () TARGET_LINK_LIBRARIES(taos trpc) ELSEIF (TD_DARWIN_64) diff --git a/src/client/src/TSDBJNIConnector.c b/src/client/src/TSDBJNIConnector.c index 2f1bcc522a1e98db303873ac8323a64c8deccf81..9cec4f4b0f2e4f67448f35afddaec14e92bce7cf 100644 --- a/src/client/src/TSDBJNIConnector.c +++ b/src/client/src/TSDBJNIConnector.c @@ -466,11 +466,17 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn case TSDB_DATA_TYPE_BIGINT: (*env)->CallVoidMethod(env, rowobj, g_rowdataSetLongFp, i, (jlong) * ((int64_t *)row[i])); break; - case TSDB_DATA_TYPE_FLOAT: - (*env)->CallVoidMethod(env, rowobj, g_rowdataSetFloatFp, i, (jfloat) * ((float *)row[i])); + case TSDB_DATA_TYPE_FLOAT: { + float fv = 0; + fv = GET_FLOAT_VAL(row[i]); + (*env)->CallVoidMethod(env, rowobj, g_rowdataSetFloatFp, i, (jfloat)fv); + } break; - case TSDB_DATA_TYPE_DOUBLE: - (*env)->CallVoidMethod(env, rowobj, g_rowdataSetDoubleFp, i, (jdouble) * ((double *)row[i])); + case TSDB_DATA_TYPE_DOUBLE: { + double dv = 0; + dv = GET_DOUBLE_VAL(row[i]); + (*env)->CallVoidMethod(env, rowobj, g_rowdataSetDoubleFp, i, (jdouble)dv); + } break; case TSDB_DATA_TYPE_BINARY: { strncpy(tmp, row[i], (size_t) fields[i].bytes); // handle the case that terminated does not exist @@ -615,11 +621,17 @@ JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_consumeImp(JNI case TSDB_DATA_TYPE_BIGINT: (*env)->CallVoidMethod(env, rowobj, g_rowdataSetLongFp, i, (jlong) * ((int64_t *)row[i])); break; - case TSDB_DATA_TYPE_FLOAT: - (*env)->CallVoidMethod(env, rowobj, g_rowdataSetFloatFp, i, (jfloat) * ((float *)row[i])); + case TSDB_DATA_TYPE_FLOAT: { + float fv = 0; + fv = GET_FLOAT_VAL(row[i]); + (*env)->CallVoidMethod(env, rowobj, g_rowdataSetFloatFp, i, (jfloat)fv); + } break; - case TSDB_DATA_TYPE_DOUBLE: - (*env)->CallVoidMethod(env, rowobj, g_rowdataSetDoubleFp, i, (jdouble) * ((double *)row[i])); + case TSDB_DATA_TYPE_DOUBLE:{ + double dv = 0; + dv = GET_DOUBLE_VAL(row[i]); + (*env)->CallVoidMethod(env, rowobj, g_rowdataSetDoubleFp, i, (jdouble)dv); + } break; case TSDB_DATA_TYPE_BINARY: { strncpy(tmp, row[i], (size_t) fields[i].bytes); // handle the case that terminated does not exist diff --git a/src/client/src/sql.c b/src/client/src/sql.c index 331c27a474668644108f57ff4a38f43d1f15ff11..f391dc21cdaa32621774f34127d0a707a3168027 100644 --- a/src/client/src/sql.c +++ b/src/client/src/sql.c @@ -122,17 +122,17 @@ typedef union { #define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo #define ParseARG_STORE yypParser->pInfo = pInfo #define YYFALLBACK 1 -#define YYNSTATE 246 -#define YYNRULE 215 +#define YYNSTATE 247 +#define YYNRULE 216 #define YYNTOKEN 197 -#define YY_MAX_SHIFT 245 -#define YY_MIN_SHIFTREDUCE 398 -#define YY_MAX_SHIFTREDUCE 612 -#define YY_ERROR_ACTION 613 -#define YY_ACCEPT_ACTION 614 -#define YY_NO_ACTION 615 -#define YY_MIN_REDUCE 616 -#define YY_MAX_REDUCE 830 +#define YY_MAX_SHIFT 246 +#define YY_MIN_SHIFTREDUCE 399 +#define YY_MAX_SHIFTREDUCE 614 +#define YY_ERROR_ACTION 615 +#define YY_ACCEPT_ACTION 616 +#define YY_NO_ACTION 617 +#define YY_MIN_REDUCE 618 +#define YY_MAX_REDUCE 833 /************* End control #defines *******************************************/ /* Define the yytestcase() macro to be a no-op if is not already defined @@ -198,61 +198,61 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (528) +#define YY_ACTTAB_COUNT (529) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 749, 438, 131, 149, 243, 10, 614, 245, 131, 439, - /* 10 */ 131, 154, 818, 41, 43, 20, 35, 36, 817, 153, - /* 20 */ 818, 29, 738, 438, 199, 39, 37, 40, 38, 130, - /* 30 */ 497, 439, 95, 34, 33, 99, 150, 32, 31, 30, - /* 40 */ 41, 43, 738, 35, 36, 151, 135, 162, 29, 724, - /* 50 */ 746, 199, 39, 37, 40, 38, 184, 99, 224, 223, - /* 60 */ 34, 33, 161, 727, 32, 31, 30, 399, 400, 401, - /* 70 */ 402, 403, 404, 405, 406, 407, 408, 409, 410, 244, - /* 80 */ 727, 41, 43, 187, 35, 36, 214, 814, 196, 29, - /* 90 */ 58, 20, 199, 39, 37, 40, 38, 32, 31, 30, - /* 100 */ 56, 34, 33, 75, 727, 32, 31, 30, 43, 235, - /* 110 */ 35, 36, 773, 235, 194, 29, 20, 20, 199, 39, - /* 120 */ 37, 40, 38, 163, 568, 724, 226, 34, 33, 438, - /* 130 */ 166, 32, 31, 30, 237, 35, 36, 439, 7, 813, - /* 140 */ 29, 61, 109, 199, 39, 37, 40, 38, 222, 227, - /* 150 */ 724, 724, 34, 33, 50, 725, 32, 31, 30, 15, - /* 160 */ 213, 236, 212, 211, 210, 209, 208, 207, 206, 205, - /* 170 */ 709, 51, 698, 699, 700, 701, 702, 703, 704, 705, - /* 180 */ 706, 707, 708, 158, 581, 11, 812, 572, 99, 575, - /* 190 */ 99, 578, 167, 158, 581, 221, 220, 572, 16, 575, - /* 200 */ 20, 578, 34, 33, 144, 26, 32, 31, 30, 237, - /* 210 */ 86, 85, 138, 173, 654, 155, 156, 122, 143, 198, - /* 220 */ 181, 712, 178, 711, 147, 155, 156, 158, 581, 529, - /* 230 */ 60, 572, 148, 575, 723, 578, 236, 16, 39, 37, - /* 240 */ 40, 38, 27, 772, 26, 59, 34, 33, 549, 550, - /* 250 */ 32, 31, 30, 136, 112, 113, 218, 64, 67, 155, - /* 260 */ 156, 94, 513, 663, 183, 510, 122, 511, 26, 512, - /* 270 */ 521, 146, 126, 124, 239, 88, 87, 186, 42, 157, - /* 280 */ 73, 77, 238, 84, 76, 570, 526, 137, 42, 580, - /* 290 */ 79, 17, 655, 164, 165, 122, 242, 241, 421, 580, - /* 300 */ 47, 540, 541, 598, 579, 45, 13, 12, 582, 574, - /* 310 */ 783, 577, 12, 573, 579, 576, 2, 72, 71, 48, - /* 320 */ 503, 571, 42, 139, 45, 502, 203, 9, 8, 21, - /* 330 */ 21, 140, 517, 580, 518, 515, 141, 516, 83, 82, - /* 340 */ 142, 133, 129, 134, 726, 132, 827, 782, 579, 159, - /* 350 */ 108, 779, 778, 160, 748, 718, 225, 96, 740, 110, - /* 360 */ 765, 764, 514, 111, 665, 204, 26, 127, 24, 217, - /* 370 */ 185, 219, 826, 69, 90, 825, 823, 114, 683, 25, - /* 380 */ 22, 128, 652, 536, 78, 650, 188, 80, 648, 647, - /* 390 */ 168, 192, 52, 737, 123, 645, 644, 643, 641, 634, - /* 400 */ 49, 125, 44, 638, 636, 100, 101, 197, 195, 752, - /* 410 */ 193, 753, 766, 28, 191, 189, 216, 74, 228, 229, - /* 420 */ 230, 231, 232, 201, 233, 234, 53, 240, 612, 169, - /* 430 */ 170, 62, 145, 65, 171, 172, 611, 646, 174, 175, - /* 440 */ 177, 176, 610, 89, 117, 640, 116, 684, 115, 119, - /* 450 */ 118, 120, 722, 121, 91, 106, 102, 103, 23, 104, - /* 460 */ 105, 107, 1, 179, 180, 603, 182, 186, 523, 55, - /* 470 */ 537, 97, 152, 57, 190, 18, 63, 542, 4, 98, - /* 480 */ 5, 583, 19, 3, 14, 478, 6, 200, 477, 202, - /* 490 */ 476, 475, 474, 473, 472, 471, 469, 45, 442, 215, - /* 500 */ 66, 444, 21, 68, 46, 499, 498, 496, 54, 463, - /* 510 */ 461, 453, 70, 459, 455, 457, 451, 449, 470, 468, - /* 520 */ 81, 424, 440, 92, 93, 414, 412, 616, + /* 0 */ 752, 440, 132, 150, 244, 10, 616, 246, 132, 441, + /* 10 */ 132, 155, 821, 41, 43, 20, 35, 36, 820, 154, + /* 20 */ 821, 29, 741, 440, 200, 39, 37, 40, 38, 131, + /* 30 */ 499, 441, 96, 34, 33, 100, 151, 32, 31, 30, + /* 40 */ 41, 43, 741, 35, 36, 152, 136, 163, 29, 727, + /* 50 */ 749, 200, 39, 37, 40, 38, 185, 100, 225, 224, + /* 60 */ 34, 33, 162, 730, 32, 31, 30, 400, 401, 402, + /* 70 */ 403, 404, 405, 406, 407, 408, 409, 410, 411, 245, + /* 80 */ 730, 41, 43, 188, 35, 36, 215, 817, 197, 29, + /* 90 */ 58, 20, 200, 39, 37, 40, 38, 32, 31, 30, + /* 100 */ 56, 34, 33, 75, 730, 32, 31, 30, 43, 236, + /* 110 */ 35, 36, 776, 236, 195, 29, 20, 20, 200, 39, + /* 120 */ 37, 40, 38, 164, 570, 727, 227, 34, 33, 440, + /* 130 */ 167, 32, 31, 30, 238, 35, 36, 441, 7, 816, + /* 140 */ 29, 61, 110, 200, 39, 37, 40, 38, 223, 228, + /* 150 */ 727, 727, 34, 33, 50, 728, 32, 31, 30, 15, + /* 160 */ 214, 237, 213, 212, 211, 210, 209, 208, 207, 206, + /* 170 */ 712, 51, 701, 702, 703, 704, 705, 706, 707, 708, + /* 180 */ 709, 710, 711, 159, 583, 11, 815, 574, 100, 577, + /* 190 */ 100, 580, 168, 159, 583, 222, 221, 574, 16, 577, + /* 200 */ 20, 580, 34, 33, 145, 26, 32, 31, 30, 238, + /* 210 */ 86, 85, 139, 174, 657, 156, 157, 123, 144, 199, + /* 220 */ 182, 715, 179, 714, 148, 156, 157, 159, 583, 531, + /* 230 */ 60, 574, 149, 577, 726, 580, 237, 16, 39, 37, + /* 240 */ 40, 38, 27, 775, 26, 59, 34, 33, 551, 552, + /* 250 */ 32, 31, 30, 137, 113, 114, 219, 64, 67, 156, + /* 260 */ 157, 95, 515, 666, 184, 512, 123, 513, 26, 514, + /* 270 */ 523, 147, 127, 125, 240, 88, 87, 187, 42, 158, + /* 280 */ 73, 77, 239, 84, 76, 572, 528, 138, 42, 582, + /* 290 */ 79, 17, 658, 165, 166, 123, 243, 242, 92, 582, + /* 300 */ 47, 542, 543, 600, 581, 45, 13, 12, 584, 576, + /* 310 */ 786, 579, 12, 575, 581, 578, 2, 72, 71, 48, + /* 320 */ 505, 573, 42, 140, 45, 504, 204, 9, 8, 21, + /* 330 */ 21, 141, 519, 582, 520, 517, 142, 518, 83, 82, + /* 340 */ 143, 134, 130, 135, 729, 133, 830, 785, 581, 160, + /* 350 */ 109, 782, 781, 161, 751, 721, 226, 97, 743, 111, + /* 360 */ 768, 767, 516, 112, 668, 205, 26, 128, 24, 218, + /* 370 */ 186, 220, 829, 69, 90, 828, 826, 115, 686, 25, + /* 380 */ 22, 129, 655, 538, 78, 653, 189, 80, 651, 650, + /* 390 */ 169, 193, 52, 740, 124, 648, 647, 646, 644, 636, + /* 400 */ 49, 126, 44, 642, 640, 101, 102, 198, 638, 196, + /* 410 */ 194, 755, 756, 190, 769, 192, 28, 217, 74, 229, + /* 420 */ 230, 231, 232, 233, 202, 234, 235, 53, 241, 614, + /* 430 */ 170, 171, 173, 62, 146, 172, 65, 613, 176, 175, + /* 440 */ 649, 177, 89, 643, 118, 178, 612, 687, 116, 117, + /* 450 */ 119, 120, 122, 725, 121, 91, 1, 105, 103, 106, + /* 460 */ 104, 107, 23, 108, 180, 181, 605, 183, 187, 525, + /* 470 */ 55, 153, 539, 98, 57, 191, 201, 18, 544, 99, + /* 480 */ 4, 5, 585, 19, 3, 14, 6, 63, 480, 203, + /* 490 */ 479, 478, 477, 476, 475, 474, 473, 471, 45, 444, + /* 500 */ 66, 446, 21, 501, 216, 500, 498, 54, 465, 463, + /* 510 */ 46, 68, 455, 70, 461, 457, 459, 453, 451, 472, + /* 520 */ 470, 81, 426, 442, 415, 413, 93, 94, 618, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 201, 1, 250, 200, 201, 250, 198, 199, 250, 9, @@ -295,19 +295,19 @@ static const YYCODETYPE yy_lookahead[] = { /* 370 */ 234, 201, 201, 201, 59, 201, 201, 201, 201, 201, /* 380 */ 201, 201, 201, 107, 201, 201, 253, 201, 201, 201, /* 390 */ 201, 253, 117, 247, 201, 201, 201, 201, 201, 201, - /* 400 */ 119, 201, 116, 201, 201, 246, 245, 111, 115, 202, - /* 410 */ 110, 202, 202, 121, 109, 108, 75, 84, 83, 49, - /* 420 */ 80, 82, 53, 202, 81, 79, 202, 75, 5, 132, - /* 430 */ 5, 206, 202, 206, 132, 58, 5, 202, 132, 5, - /* 440 */ 58, 132, 5, 203, 210, 202, 214, 216, 215, 211, - /* 450 */ 213, 212, 234, 209, 203, 240, 244, 243, 204, 242, - /* 460 */ 241, 239, 207, 132, 58, 86, 124, 104, 97, 105, - /* 470 */ 97, 96, 1, 101, 96, 101, 72, 97, 112, 96, - /* 480 */ 112, 97, 101, 96, 96, 9, 96, 98, 5, 98, - /* 490 */ 5, 5, 5, 1, 5, 5, 5, 101, 76, 15, - /* 500 */ 72, 58, 101, 127, 16, 5, 5, 97, 96, 5, - /* 510 */ 5, 5, 127, 5, 5, 5, 5, 5, 5, 5, - /* 520 */ 58, 58, 76, 21, 21, 59, 58, 0, 261, 261, + /* 400 */ 119, 201, 116, 201, 201, 246, 245, 111, 201, 115, + /* 410 */ 110, 202, 202, 108, 202, 109, 121, 75, 84, 83, + /* 420 */ 49, 80, 82, 53, 202, 81, 79, 202, 75, 5, + /* 430 */ 132, 5, 58, 206, 202, 132, 206, 5, 5, 132, + /* 440 */ 202, 132, 203, 202, 210, 58, 5, 216, 215, 214, + /* 450 */ 213, 211, 209, 234, 212, 203, 207, 242, 244, 241, + /* 460 */ 243, 240, 204, 239, 132, 58, 86, 124, 104, 97, + /* 470 */ 105, 1, 97, 96, 101, 96, 98, 101, 97, 96, + /* 480 */ 112, 112, 97, 101, 96, 96, 96, 72, 9, 98, + /* 490 */ 5, 5, 5, 5, 1, 5, 5, 5, 101, 76, + /* 500 */ 72, 58, 101, 5, 15, 5, 97, 96, 5, 5, + /* 510 */ 16, 127, 5, 127, 5, 5, 5, 5, 5, 5, + /* 520 */ 5, 58, 58, 76, 59, 58, 21, 21, 0, 261, /* 530 */ 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, /* 540 */ 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, /* 550 */ 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, @@ -327,41 +327,41 @@ static const YYCODETYPE yy_lookahead[] = { /* 690 */ 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, /* 700 */ 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, /* 710 */ 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, - /* 720 */ 261, 261, 261, 261, 261, + /* 720 */ 261, 261, 261, 261, 261, 261, }; -#define YY_SHIFT_COUNT (245) +#define YY_SHIFT_COUNT (246) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (527) +#define YY_SHIFT_MAX (528) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 141, 74, 182, 226, 128, 128, 128, 128, 128, 128, /* 10 */ 0, 22, 226, 260, 260, 260, 102, 128, 128, 128, - /* 20 */ 128, 128, 31, 149, 35, 35, 528, 192, 226, 226, + /* 20 */ 128, 128, 31, 149, 35, 35, 529, 192, 226, 226, /* 30 */ 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, /* 40 */ 226, 226, 226, 226, 226, 260, 260, 25, 25, 25, /* 50 */ 25, 25, 25, 42, 25, 165, 128, 128, 135, 135, /* 60 */ 185, 128, 128, 128, 128, 128, 128, 128, 128, 128, /* 70 */ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, /* 80 */ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - /* 90 */ 128, 128, 128, 128, 263, 315, 315, 276, 276, 315, - /* 100 */ 275, 281, 286, 296, 293, 300, 305, 307, 292, 263, - /* 110 */ 315, 315, 341, 341, 315, 333, 335, 370, 340, 339, - /* 120 */ 369, 343, 346, 315, 352, 315, 352, 528, 528, 27, - /* 130 */ 68, 68, 68, 94, 119, 213, 213, 213, 216, 169, - /* 140 */ 169, 169, 169, 190, 208, 67, 89, 60, 60, 236, - /* 150 */ 173, 204, 205, 206, 211, 304, 308, 284, 220, 199, - /* 160 */ 53, 223, 228, 229, 327, 330, 191, 201, 266, 423, - /* 170 */ 297, 425, 302, 377, 431, 306, 434, 309, 382, 437, - /* 180 */ 331, 406, 379, 342, 363, 371, 364, 372, 373, 375, - /* 190 */ 471, 378, 380, 383, 374, 366, 381, 368, 384, 387, - /* 200 */ 388, 389, 390, 391, 404, 476, 483, 485, 486, 487, - /* 210 */ 492, 489, 490, 491, 396, 422, 484, 428, 443, 488, - /* 220 */ 376, 385, 401, 500, 501, 410, 412, 401, 504, 505, - /* 230 */ 506, 508, 509, 510, 511, 512, 513, 514, 462, 463, - /* 240 */ 446, 502, 503, 466, 468, 527, + /* 90 */ 128, 128, 128, 128, 128, 263, 315, 315, 276, 276, + /* 100 */ 315, 275, 281, 286, 296, 294, 300, 306, 305, 295, + /* 110 */ 263, 315, 315, 342, 342, 315, 334, 336, 371, 341, + /* 120 */ 340, 370, 344, 347, 315, 353, 315, 353, 529, 529, + /* 130 */ 27, 68, 68, 68, 94, 119, 213, 213, 213, 216, + /* 140 */ 169, 169, 169, 169, 190, 208, 67, 89, 60, 60, + /* 150 */ 236, 173, 204, 205, 206, 211, 304, 308, 284, 220, + /* 160 */ 199, 53, 223, 228, 229, 327, 330, 191, 201, 266, + /* 170 */ 424, 298, 426, 303, 374, 432, 307, 433, 309, 387, + /* 180 */ 441, 332, 407, 380, 343, 364, 372, 365, 373, 375, + /* 190 */ 377, 470, 379, 381, 383, 376, 368, 382, 369, 385, + /* 200 */ 388, 389, 378, 390, 391, 415, 479, 485, 486, 487, + /* 210 */ 488, 493, 490, 491, 492, 397, 423, 489, 428, 443, + /* 220 */ 494, 384, 386, 401, 498, 500, 409, 411, 401, 503, + /* 230 */ 504, 507, 509, 510, 511, 512, 513, 514, 515, 463, + /* 240 */ 464, 447, 505, 506, 465, 467, 528, }; -#define YY_REDUCE_COUNT (128) +#define YY_REDUCE_COUNT (129) #define YY_REDUCE_MIN (-248) -#define YY_REDUCE_MAX (255) +#define YY_REDUCE_MAX (258) static const short yy_reduce_ofst[] = { /* 0 */ -192, -47, -248, -240, -144, -166, -186, -110, -85, -84, /* 10 */ -201, -197, -242, -173, -156, -132, -212, -169, -13, -11, @@ -372,37 +372,37 @@ static const short yy_reduce_ofst[] = { /* 60 */ 112, 158, 162, 163, 164, 166, 167, 168, 170, 171, /* 70 */ 172, 174, 175, 176, 177, 178, 179, 180, 181, 183, /* 80 */ 184, 186, 187, 188, 189, 193, 194, 195, 196, 197, - /* 90 */ 198, 200, 202, 203, 136, 207, 209, 133, 138, 210, - /* 100 */ 146, 159, 161, 212, 214, 217, 219, 215, 222, 218, - /* 110 */ 221, 224, 225, 227, 230, 231, 233, 232, 234, 237, - /* 120 */ 238, 239, 244, 235, 240, 243, 251, 255, 254, + /* 90 */ 198, 200, 202, 203, 207, 136, 209, 210, 133, 138, + /* 100 */ 212, 146, 159, 161, 214, 217, 215, 218, 221, 224, + /* 110 */ 219, 222, 225, 227, 230, 232, 231, 233, 235, 234, + /* 120 */ 237, 240, 242, 243, 238, 239, 241, 252, 249, 258, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 613, 664, 820, 820, 613, 613, 613, 613, 613, 613, - /* 10 */ 750, 631, 820, 613, 613, 613, 613, 613, 613, 613, - /* 20 */ 613, 613, 666, 653, 666, 666, 745, 613, 613, 613, - /* 30 */ 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, - /* 40 */ 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, - /* 50 */ 613, 613, 613, 613, 613, 613, 613, 613, 769, 769, - /* 60 */ 743, 613, 613, 613, 613, 613, 613, 613, 613, 613, - /* 70 */ 613, 613, 613, 613, 613, 613, 613, 613, 651, 613, - /* 80 */ 649, 613, 613, 613, 613, 613, 613, 613, 613, 613, - /* 90 */ 613, 613, 613, 613, 613, 633, 633, 613, 613, 633, - /* 100 */ 776, 780, 774, 762, 770, 761, 757, 756, 784, 613, - /* 110 */ 633, 633, 661, 661, 633, 682, 680, 678, 670, 676, - /* 120 */ 672, 674, 668, 633, 659, 633, 659, 697, 710, 613, - /* 130 */ 785, 819, 775, 803, 802, 815, 809, 808, 613, 807, - /* 140 */ 806, 805, 804, 613, 613, 613, 613, 811, 810, 613, - /* 150 */ 613, 613, 613, 613, 613, 613, 613, 613, 787, 781, - /* 160 */ 777, 613, 613, 613, 613, 613, 613, 613, 613, 613, - /* 170 */ 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, - /* 180 */ 613, 613, 613, 613, 742, 613, 613, 751, 613, 613, - /* 190 */ 613, 613, 613, 613, 771, 613, 763, 613, 613, 613, - /* 200 */ 613, 613, 613, 719, 613, 613, 613, 613, 613, 613, - /* 210 */ 613, 613, 613, 613, 685, 613, 613, 613, 613, 613, - /* 220 */ 613, 613, 824, 613, 613, 613, 713, 822, 613, 613, - /* 230 */ 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, - /* 240 */ 613, 637, 635, 613, 629, 613, + /* 0 */ 615, 667, 823, 823, 615, 615, 615, 615, 615, 615, + /* 10 */ 753, 633, 823, 615, 615, 615, 615, 615, 615, 615, + /* 20 */ 615, 615, 669, 656, 669, 669, 748, 615, 615, 615, + /* 30 */ 615, 615, 615, 615, 615, 615, 615, 615, 615, 615, + /* 40 */ 615, 615, 615, 615, 615, 615, 615, 615, 615, 615, + /* 50 */ 615, 615, 615, 615, 615, 615, 615, 615, 772, 772, + /* 60 */ 746, 615, 615, 615, 615, 615, 615, 615, 615, 615, + /* 70 */ 615, 615, 615, 615, 615, 615, 615, 615, 654, 615, + /* 80 */ 652, 615, 615, 615, 615, 615, 615, 615, 615, 615, + /* 90 */ 615, 615, 641, 615, 615, 615, 635, 635, 615, 615, + /* 100 */ 635, 779, 783, 777, 765, 773, 764, 760, 759, 787, + /* 110 */ 615, 635, 635, 664, 664, 635, 685, 683, 681, 673, + /* 120 */ 679, 675, 677, 671, 635, 662, 635, 662, 700, 713, + /* 130 */ 615, 788, 822, 778, 806, 805, 818, 812, 811, 615, + /* 140 */ 810, 809, 808, 807, 615, 615, 615, 615, 814, 813, + /* 150 */ 615, 615, 615, 615, 615, 615, 615, 615, 615, 790, + /* 160 */ 784, 780, 615, 615, 615, 615, 615, 615, 615, 615, + /* 170 */ 615, 615, 615, 615, 615, 615, 615, 615, 615, 615, + /* 180 */ 615, 615, 615, 615, 615, 745, 615, 615, 754, 615, + /* 190 */ 615, 615, 615, 615, 615, 774, 615, 766, 615, 615, + /* 200 */ 615, 615, 615, 615, 722, 615, 615, 615, 615, 615, + /* 210 */ 615, 615, 615, 615, 615, 688, 615, 615, 615, 615, + /* 220 */ 615, 615, 615, 827, 615, 615, 615, 716, 825, 615, + /* 230 */ 615, 615, 615, 615, 615, 615, 615, 615, 615, 615, + /* 240 */ 615, 615, 639, 637, 615, 631, 615, }; /********** End of lemon-generated parsing tables *****************************/ @@ -997,197 +997,198 @@ static const char *const yyRuleName[] = { /* 21 */ "cmd ::= SHOW dbPrefix STABLES", /* 22 */ "cmd ::= SHOW dbPrefix STABLES LIKE ids", /* 23 */ "cmd ::= SHOW dbPrefix VGROUPS", - /* 24 */ "cmd ::= DROP TABLE ifexists ids cpxName", - /* 25 */ "cmd ::= DROP DATABASE ifexists ids", - /* 26 */ "cmd ::= DROP DNODE IPTOKEN", - /* 27 */ "cmd ::= DROP USER ids", - /* 28 */ "cmd ::= DROP ACCOUNT ids", - /* 29 */ "cmd ::= USE ids", - /* 30 */ "cmd ::= DESCRIBE ids cpxName", - /* 31 */ "cmd ::= ALTER USER ids PASS ids", - /* 32 */ "cmd ::= ALTER USER ids PRIVILEGE ids", - /* 33 */ "cmd ::= ALTER DNODE IPTOKEN ids", - /* 34 */ "cmd ::= ALTER DNODE IPTOKEN ids ids", - /* 35 */ "cmd ::= ALTER LOCAL ids", - /* 36 */ "cmd ::= ALTER LOCAL ids ids", - /* 37 */ "cmd ::= ALTER DATABASE ids alter_db_optr", - /* 38 */ "cmd ::= ALTER ACCOUNT ids acct_optr", - /* 39 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr", - /* 40 */ "ids ::= ID", - /* 41 */ "ids ::= STRING", - /* 42 */ "ifexists ::= IF EXISTS", - /* 43 */ "ifexists ::=", - /* 44 */ "ifnotexists ::= IF NOT EXISTS", - /* 45 */ "ifnotexists ::=", - /* 46 */ "cmd ::= CREATE DNODE IPTOKEN", - /* 47 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr", - /* 48 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr", - /* 49 */ "cmd ::= CREATE USER ids PASS ids", - /* 50 */ "pps ::=", - /* 51 */ "pps ::= PPS INTEGER", - /* 52 */ "tseries ::=", - /* 53 */ "tseries ::= TSERIES INTEGER", - /* 54 */ "dbs ::=", - /* 55 */ "dbs ::= DBS INTEGER", - /* 56 */ "streams ::=", - /* 57 */ "streams ::= STREAMS INTEGER", - /* 58 */ "storage ::=", - /* 59 */ "storage ::= STORAGE INTEGER", - /* 60 */ "qtime ::=", - /* 61 */ "qtime ::= QTIME INTEGER", - /* 62 */ "users ::=", - /* 63 */ "users ::= USERS INTEGER", - /* 64 */ "conns ::=", - /* 65 */ "conns ::= CONNS INTEGER", - /* 66 */ "state ::=", - /* 67 */ "state ::= STATE ids", - /* 68 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state", - /* 69 */ "keep ::= KEEP tagitemlist", - /* 70 */ "tables ::= TABLES INTEGER", - /* 71 */ "cache ::= CACHE INTEGER", - /* 72 */ "replica ::= REPLICA INTEGER", - /* 73 */ "days ::= DAYS INTEGER", - /* 74 */ "rows ::= ROWS INTEGER", - /* 75 */ "ablocks ::= ABLOCKS ID", - /* 76 */ "tblocks ::= TBLOCKS INTEGER", - /* 77 */ "ctime ::= CTIME INTEGER", - /* 78 */ "clog ::= CLOG INTEGER", - /* 79 */ "comp ::= COMP INTEGER", - /* 80 */ "prec ::= PRECISION STRING", - /* 81 */ "db_optr ::=", - /* 82 */ "db_optr ::= db_optr tables", - /* 83 */ "db_optr ::= db_optr cache", - /* 84 */ "db_optr ::= db_optr replica", - /* 85 */ "db_optr ::= db_optr days", - /* 86 */ "db_optr ::= db_optr rows", - /* 87 */ "db_optr ::= db_optr ablocks", - /* 88 */ "db_optr ::= db_optr tblocks", - /* 89 */ "db_optr ::= db_optr ctime", - /* 90 */ "db_optr ::= db_optr clog", - /* 91 */ "db_optr ::= db_optr comp", - /* 92 */ "db_optr ::= db_optr prec", - /* 93 */ "db_optr ::= db_optr keep", - /* 94 */ "alter_db_optr ::=", - /* 95 */ "alter_db_optr ::= alter_db_optr replica", - /* 96 */ "alter_db_optr ::= alter_db_optr tables", - /* 97 */ "typename ::= ids", - /* 98 */ "typename ::= ids LP signed RP", - /* 99 */ "signed ::= INTEGER", - /* 100 */ "signed ::= PLUS INTEGER", - /* 101 */ "signed ::= MINUS INTEGER", - /* 102 */ "cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args", - /* 103 */ "create_table_args ::= LP columnlist RP", - /* 104 */ "create_table_args ::= LP columnlist RP TAGS LP columnlist RP", - /* 105 */ "create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP", - /* 106 */ "create_table_args ::= AS select", - /* 107 */ "columnlist ::= columnlist COMMA column", - /* 108 */ "columnlist ::= column", - /* 109 */ "column ::= ids typename", - /* 110 */ "tagitemlist ::= tagitemlist COMMA tagitem", - /* 111 */ "tagitemlist ::= tagitem", - /* 112 */ "tagitem ::= INTEGER", - /* 113 */ "tagitem ::= FLOAT", - /* 114 */ "tagitem ::= STRING", - /* 115 */ "tagitem ::= BOOL", - /* 116 */ "tagitem ::= NULL", - /* 117 */ "tagitem ::= MINUS INTEGER", - /* 118 */ "tagitem ::= MINUS FLOAT", - /* 119 */ "tagitem ::= PLUS INTEGER", - /* 120 */ "tagitem ::= PLUS FLOAT", - /* 121 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", - /* 122 */ "union ::= select", - /* 123 */ "union ::= LP union RP", - /* 124 */ "union ::= union UNION ALL select", - /* 125 */ "union ::= union UNION ALL LP select RP", - /* 126 */ "cmd ::= union", - /* 127 */ "select ::= SELECT selcollist", - /* 128 */ "sclp ::= selcollist COMMA", - /* 129 */ "sclp ::=", - /* 130 */ "selcollist ::= sclp expr as", - /* 131 */ "selcollist ::= sclp STAR", - /* 132 */ "as ::= AS ids", - /* 133 */ "as ::= ids", - /* 134 */ "as ::=", - /* 135 */ "from ::= FROM tablelist", - /* 136 */ "tablelist ::= ids cpxName", - /* 137 */ "tablelist ::= tablelist COMMA ids cpxName", - /* 138 */ "tmvar ::= VARIABLE", - /* 139 */ "interval_opt ::= INTERVAL LP tmvar RP", - /* 140 */ "interval_opt ::=", - /* 141 */ "fill_opt ::=", - /* 142 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", - /* 143 */ "fill_opt ::= FILL LP ID RP", - /* 144 */ "sliding_opt ::= SLIDING LP tmvar RP", - /* 145 */ "sliding_opt ::=", - /* 146 */ "orderby_opt ::=", - /* 147 */ "orderby_opt ::= ORDER BY sortlist", - /* 148 */ "sortlist ::= sortlist COMMA item sortorder", - /* 149 */ "sortlist ::= item sortorder", - /* 150 */ "item ::= ids cpxName", - /* 151 */ "sortorder ::= ASC", - /* 152 */ "sortorder ::= DESC", - /* 153 */ "sortorder ::=", - /* 154 */ "groupby_opt ::=", - /* 155 */ "groupby_opt ::= GROUP BY grouplist", - /* 156 */ "grouplist ::= grouplist COMMA item", - /* 157 */ "grouplist ::= item", - /* 158 */ "having_opt ::=", - /* 159 */ "having_opt ::= HAVING expr", - /* 160 */ "limit_opt ::=", - /* 161 */ "limit_opt ::= LIMIT signed", - /* 162 */ "limit_opt ::= LIMIT signed OFFSET signed", - /* 163 */ "limit_opt ::= LIMIT signed COMMA signed", - /* 164 */ "slimit_opt ::=", - /* 165 */ "slimit_opt ::= SLIMIT signed", - /* 166 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", - /* 167 */ "slimit_opt ::= SLIMIT signed COMMA signed", - /* 168 */ "where_opt ::=", - /* 169 */ "where_opt ::= WHERE expr", - /* 170 */ "expr ::= LP expr RP", - /* 171 */ "expr ::= ID", - /* 172 */ "expr ::= ID DOT ID", - /* 173 */ "expr ::= ID DOT STAR", - /* 174 */ "expr ::= INTEGER", - /* 175 */ "expr ::= MINUS INTEGER", - /* 176 */ "expr ::= PLUS INTEGER", - /* 177 */ "expr ::= FLOAT", - /* 178 */ "expr ::= MINUS FLOAT", - /* 179 */ "expr ::= PLUS FLOAT", - /* 180 */ "expr ::= STRING", - /* 181 */ "expr ::= NOW", - /* 182 */ "expr ::= VARIABLE", - /* 183 */ "expr ::= BOOL", - /* 184 */ "expr ::= ID LP exprlist RP", - /* 185 */ "expr ::= ID LP STAR RP", - /* 186 */ "expr ::= expr AND expr", - /* 187 */ "expr ::= expr OR expr", - /* 188 */ "expr ::= expr LT expr", - /* 189 */ "expr ::= expr GT expr", - /* 190 */ "expr ::= expr LE expr", - /* 191 */ "expr ::= expr GE expr", - /* 192 */ "expr ::= expr NE expr", - /* 193 */ "expr ::= expr EQ expr", - /* 194 */ "expr ::= expr PLUS expr", - /* 195 */ "expr ::= expr MINUS expr", - /* 196 */ "expr ::= expr STAR expr", - /* 197 */ "expr ::= expr SLASH expr", - /* 198 */ "expr ::= expr REM expr", - /* 199 */ "expr ::= expr LIKE expr", - /* 200 */ "expr ::= expr IN LP exprlist RP", - /* 201 */ "exprlist ::= exprlist COMMA expritem", - /* 202 */ "exprlist ::= expritem", - /* 203 */ "expritem ::= expr", - /* 204 */ "expritem ::=", - /* 205 */ "cmd ::= RESET QUERY CACHE", - /* 206 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", - /* 207 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 208 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", - /* 209 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", - /* 210 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", - /* 211 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 212 */ "cmd ::= KILL CONNECTION IPTOKEN COLON INTEGER", - /* 213 */ "cmd ::= KILL STREAM IPTOKEN COLON INTEGER COLON INTEGER", - /* 214 */ "cmd ::= KILL QUERY IPTOKEN COLON INTEGER COLON INTEGER", + /* 24 */ "cmd ::= SHOW dbPrefix VGROUPS ids", + /* 25 */ "cmd ::= DROP TABLE ifexists ids cpxName", + /* 26 */ "cmd ::= DROP DATABASE ifexists ids", + /* 27 */ "cmd ::= DROP DNODE IPTOKEN", + /* 28 */ "cmd ::= DROP USER ids", + /* 29 */ "cmd ::= DROP ACCOUNT ids", + /* 30 */ "cmd ::= USE ids", + /* 31 */ "cmd ::= DESCRIBE ids cpxName", + /* 32 */ "cmd ::= ALTER USER ids PASS ids", + /* 33 */ "cmd ::= ALTER USER ids PRIVILEGE ids", + /* 34 */ "cmd ::= ALTER DNODE IPTOKEN ids", + /* 35 */ "cmd ::= ALTER DNODE IPTOKEN ids ids", + /* 36 */ "cmd ::= ALTER LOCAL ids", + /* 37 */ "cmd ::= ALTER LOCAL ids ids", + /* 38 */ "cmd ::= ALTER DATABASE ids alter_db_optr", + /* 39 */ "cmd ::= ALTER ACCOUNT ids acct_optr", + /* 40 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr", + /* 41 */ "ids ::= ID", + /* 42 */ "ids ::= STRING", + /* 43 */ "ifexists ::= IF EXISTS", + /* 44 */ "ifexists ::=", + /* 45 */ "ifnotexists ::= IF NOT EXISTS", + /* 46 */ "ifnotexists ::=", + /* 47 */ "cmd ::= CREATE DNODE IPTOKEN", + /* 48 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr", + /* 49 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr", + /* 50 */ "cmd ::= CREATE USER ids PASS ids", + /* 51 */ "pps ::=", + /* 52 */ "pps ::= PPS INTEGER", + /* 53 */ "tseries ::=", + /* 54 */ "tseries ::= TSERIES INTEGER", + /* 55 */ "dbs ::=", + /* 56 */ "dbs ::= DBS INTEGER", + /* 57 */ "streams ::=", + /* 58 */ "streams ::= STREAMS INTEGER", + /* 59 */ "storage ::=", + /* 60 */ "storage ::= STORAGE INTEGER", + /* 61 */ "qtime ::=", + /* 62 */ "qtime ::= QTIME INTEGER", + /* 63 */ "users ::=", + /* 64 */ "users ::= USERS INTEGER", + /* 65 */ "conns ::=", + /* 66 */ "conns ::= CONNS INTEGER", + /* 67 */ "state ::=", + /* 68 */ "state ::= STATE ids", + /* 69 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state", + /* 70 */ "keep ::= KEEP tagitemlist", + /* 71 */ "tables ::= TABLES INTEGER", + /* 72 */ "cache ::= CACHE INTEGER", + /* 73 */ "replica ::= REPLICA INTEGER", + /* 74 */ "days ::= DAYS INTEGER", + /* 75 */ "rows ::= ROWS INTEGER", + /* 76 */ "ablocks ::= ABLOCKS ID", + /* 77 */ "tblocks ::= TBLOCKS INTEGER", + /* 78 */ "ctime ::= CTIME INTEGER", + /* 79 */ "clog ::= CLOG INTEGER", + /* 80 */ "comp ::= COMP INTEGER", + /* 81 */ "prec ::= PRECISION STRING", + /* 82 */ "db_optr ::=", + /* 83 */ "db_optr ::= db_optr tables", + /* 84 */ "db_optr ::= db_optr cache", + /* 85 */ "db_optr ::= db_optr replica", + /* 86 */ "db_optr ::= db_optr days", + /* 87 */ "db_optr ::= db_optr rows", + /* 88 */ "db_optr ::= db_optr ablocks", + /* 89 */ "db_optr ::= db_optr tblocks", + /* 90 */ "db_optr ::= db_optr ctime", + /* 91 */ "db_optr ::= db_optr clog", + /* 92 */ "db_optr ::= db_optr comp", + /* 93 */ "db_optr ::= db_optr prec", + /* 94 */ "db_optr ::= db_optr keep", + /* 95 */ "alter_db_optr ::=", + /* 96 */ "alter_db_optr ::= alter_db_optr replica", + /* 97 */ "alter_db_optr ::= alter_db_optr tables", + /* 98 */ "typename ::= ids", + /* 99 */ "typename ::= ids LP signed RP", + /* 100 */ "signed ::= INTEGER", + /* 101 */ "signed ::= PLUS INTEGER", + /* 102 */ "signed ::= MINUS INTEGER", + /* 103 */ "cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args", + /* 104 */ "create_table_args ::= LP columnlist RP", + /* 105 */ "create_table_args ::= LP columnlist RP TAGS LP columnlist RP", + /* 106 */ "create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP", + /* 107 */ "create_table_args ::= AS select", + /* 108 */ "columnlist ::= columnlist COMMA column", + /* 109 */ "columnlist ::= column", + /* 110 */ "column ::= ids typename", + /* 111 */ "tagitemlist ::= tagitemlist COMMA tagitem", + /* 112 */ "tagitemlist ::= tagitem", + /* 113 */ "tagitem ::= INTEGER", + /* 114 */ "tagitem ::= FLOAT", + /* 115 */ "tagitem ::= STRING", + /* 116 */ "tagitem ::= BOOL", + /* 117 */ "tagitem ::= NULL", + /* 118 */ "tagitem ::= MINUS INTEGER", + /* 119 */ "tagitem ::= MINUS FLOAT", + /* 120 */ "tagitem ::= PLUS INTEGER", + /* 121 */ "tagitem ::= PLUS FLOAT", + /* 122 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", + /* 123 */ "union ::= select", + /* 124 */ "union ::= LP union RP", + /* 125 */ "union ::= union UNION ALL select", + /* 126 */ "union ::= union UNION ALL LP select RP", + /* 127 */ "cmd ::= union", + /* 128 */ "select ::= SELECT selcollist", + /* 129 */ "sclp ::= selcollist COMMA", + /* 130 */ "sclp ::=", + /* 131 */ "selcollist ::= sclp expr as", + /* 132 */ "selcollist ::= sclp STAR", + /* 133 */ "as ::= AS ids", + /* 134 */ "as ::= ids", + /* 135 */ "as ::=", + /* 136 */ "from ::= FROM tablelist", + /* 137 */ "tablelist ::= ids cpxName", + /* 138 */ "tablelist ::= tablelist COMMA ids cpxName", + /* 139 */ "tmvar ::= VARIABLE", + /* 140 */ "interval_opt ::= INTERVAL LP tmvar RP", + /* 141 */ "interval_opt ::=", + /* 142 */ "fill_opt ::=", + /* 143 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", + /* 144 */ "fill_opt ::= FILL LP ID RP", + /* 145 */ "sliding_opt ::= SLIDING LP tmvar RP", + /* 146 */ "sliding_opt ::=", + /* 147 */ "orderby_opt ::=", + /* 148 */ "orderby_opt ::= ORDER BY sortlist", + /* 149 */ "sortlist ::= sortlist COMMA item sortorder", + /* 150 */ "sortlist ::= item sortorder", + /* 151 */ "item ::= ids cpxName", + /* 152 */ "sortorder ::= ASC", + /* 153 */ "sortorder ::= DESC", + /* 154 */ "sortorder ::=", + /* 155 */ "groupby_opt ::=", + /* 156 */ "groupby_opt ::= GROUP BY grouplist", + /* 157 */ "grouplist ::= grouplist COMMA item", + /* 158 */ "grouplist ::= item", + /* 159 */ "having_opt ::=", + /* 160 */ "having_opt ::= HAVING expr", + /* 161 */ "limit_opt ::=", + /* 162 */ "limit_opt ::= LIMIT signed", + /* 163 */ "limit_opt ::= LIMIT signed OFFSET signed", + /* 164 */ "limit_opt ::= LIMIT signed COMMA signed", + /* 165 */ "slimit_opt ::=", + /* 166 */ "slimit_opt ::= SLIMIT signed", + /* 167 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", + /* 168 */ "slimit_opt ::= SLIMIT signed COMMA signed", + /* 169 */ "where_opt ::=", + /* 170 */ "where_opt ::= WHERE expr", + /* 171 */ "expr ::= LP expr RP", + /* 172 */ "expr ::= ID", + /* 173 */ "expr ::= ID DOT ID", + /* 174 */ "expr ::= ID DOT STAR", + /* 175 */ "expr ::= INTEGER", + /* 176 */ "expr ::= MINUS INTEGER", + /* 177 */ "expr ::= PLUS INTEGER", + /* 178 */ "expr ::= FLOAT", + /* 179 */ "expr ::= MINUS FLOAT", + /* 180 */ "expr ::= PLUS FLOAT", + /* 181 */ "expr ::= STRING", + /* 182 */ "expr ::= NOW", + /* 183 */ "expr ::= VARIABLE", + /* 184 */ "expr ::= BOOL", + /* 185 */ "expr ::= ID LP exprlist RP", + /* 186 */ "expr ::= ID LP STAR RP", + /* 187 */ "expr ::= expr AND expr", + /* 188 */ "expr ::= expr OR expr", + /* 189 */ "expr ::= expr LT expr", + /* 190 */ "expr ::= expr GT expr", + /* 191 */ "expr ::= expr LE expr", + /* 192 */ "expr ::= expr GE expr", + /* 193 */ "expr ::= expr NE expr", + /* 194 */ "expr ::= expr EQ expr", + /* 195 */ "expr ::= expr PLUS expr", + /* 196 */ "expr ::= expr MINUS expr", + /* 197 */ "expr ::= expr STAR expr", + /* 198 */ "expr ::= expr SLASH expr", + /* 199 */ "expr ::= expr REM expr", + /* 200 */ "expr ::= expr LIKE expr", + /* 201 */ "expr ::= expr IN LP exprlist RP", + /* 202 */ "exprlist ::= exprlist COMMA expritem", + /* 203 */ "exprlist ::= expritem", + /* 204 */ "expritem ::= expr", + /* 205 */ "expritem ::=", + /* 206 */ "cmd ::= RESET QUERY CACHE", + /* 207 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", + /* 208 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", + /* 209 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", + /* 210 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", + /* 211 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", + /* 212 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", + /* 213 */ "cmd ::= KILL CONNECTION IPTOKEN COLON INTEGER", + /* 214 */ "cmd ::= KILL STREAM IPTOKEN COLON INTEGER COLON INTEGER", + /* 215 */ "cmd ::= KILL QUERY IPTOKEN COLON INTEGER COLON INTEGER", }; #endif /* NDEBUG */ @@ -1669,197 +1670,198 @@ static const struct { { 199, -3 }, /* (21) cmd ::= SHOW dbPrefix STABLES */ { 199, -5 }, /* (22) cmd ::= SHOW dbPrefix STABLES LIKE ids */ { 199, -3 }, /* (23) cmd ::= SHOW dbPrefix VGROUPS */ - { 199, -5 }, /* (24) cmd ::= DROP TABLE ifexists ids cpxName */ - { 199, -4 }, /* (25) cmd ::= DROP DATABASE ifexists ids */ - { 199, -3 }, /* (26) cmd ::= DROP DNODE IPTOKEN */ - { 199, -3 }, /* (27) cmd ::= DROP USER ids */ - { 199, -3 }, /* (28) cmd ::= DROP ACCOUNT ids */ - { 199, -2 }, /* (29) cmd ::= USE ids */ - { 199, -3 }, /* (30) cmd ::= DESCRIBE ids cpxName */ - { 199, -5 }, /* (31) cmd ::= ALTER USER ids PASS ids */ - { 199, -5 }, /* (32) cmd ::= ALTER USER ids PRIVILEGE ids */ - { 199, -4 }, /* (33) cmd ::= ALTER DNODE IPTOKEN ids */ - { 199, -5 }, /* (34) cmd ::= ALTER DNODE IPTOKEN ids ids */ - { 199, -3 }, /* (35) cmd ::= ALTER LOCAL ids */ - { 199, -4 }, /* (36) cmd ::= ALTER LOCAL ids ids */ - { 199, -4 }, /* (37) cmd ::= ALTER DATABASE ids alter_db_optr */ - { 199, -4 }, /* (38) cmd ::= ALTER ACCOUNT ids acct_optr */ - { 199, -6 }, /* (39) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ - { 201, -1 }, /* (40) ids ::= ID */ - { 201, -1 }, /* (41) ids ::= STRING */ - { 203, -2 }, /* (42) ifexists ::= IF EXISTS */ - { 203, 0 }, /* (43) ifexists ::= */ - { 206, -3 }, /* (44) ifnotexists ::= IF NOT EXISTS */ - { 206, 0 }, /* (45) ifnotexists ::= */ - { 199, -3 }, /* (46) cmd ::= CREATE DNODE IPTOKEN */ - { 199, -6 }, /* (47) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ - { 199, -5 }, /* (48) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - { 199, -5 }, /* (49) cmd ::= CREATE USER ids PASS ids */ - { 208, 0 }, /* (50) pps ::= */ - { 208, -2 }, /* (51) pps ::= PPS INTEGER */ - { 209, 0 }, /* (52) tseries ::= */ - { 209, -2 }, /* (53) tseries ::= TSERIES INTEGER */ - { 210, 0 }, /* (54) dbs ::= */ - { 210, -2 }, /* (55) dbs ::= DBS INTEGER */ - { 211, 0 }, /* (56) streams ::= */ - { 211, -2 }, /* (57) streams ::= STREAMS INTEGER */ - { 212, 0 }, /* (58) storage ::= */ - { 212, -2 }, /* (59) storage ::= STORAGE INTEGER */ - { 213, 0 }, /* (60) qtime ::= */ - { 213, -2 }, /* (61) qtime ::= QTIME INTEGER */ - { 214, 0 }, /* (62) users ::= */ - { 214, -2 }, /* (63) users ::= USERS INTEGER */ - { 215, 0 }, /* (64) conns ::= */ - { 215, -2 }, /* (65) conns ::= CONNS INTEGER */ - { 216, 0 }, /* (66) state ::= */ - { 216, -2 }, /* (67) state ::= STATE ids */ - { 205, -9 }, /* (68) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ - { 217, -2 }, /* (69) keep ::= KEEP tagitemlist */ - { 219, -2 }, /* (70) tables ::= TABLES INTEGER */ - { 220, -2 }, /* (71) cache ::= CACHE INTEGER */ - { 221, -2 }, /* (72) replica ::= REPLICA INTEGER */ - { 222, -2 }, /* (73) days ::= DAYS INTEGER */ - { 223, -2 }, /* (74) rows ::= ROWS INTEGER */ - { 224, -2 }, /* (75) ablocks ::= ABLOCKS ID */ - { 225, -2 }, /* (76) tblocks ::= TBLOCKS INTEGER */ - { 226, -2 }, /* (77) ctime ::= CTIME INTEGER */ - { 227, -2 }, /* (78) clog ::= CLOG INTEGER */ - { 228, -2 }, /* (79) comp ::= COMP INTEGER */ - { 229, -2 }, /* (80) prec ::= PRECISION STRING */ - { 207, 0 }, /* (81) db_optr ::= */ - { 207, -2 }, /* (82) db_optr ::= db_optr tables */ - { 207, -2 }, /* (83) db_optr ::= db_optr cache */ - { 207, -2 }, /* (84) db_optr ::= db_optr replica */ - { 207, -2 }, /* (85) db_optr ::= db_optr days */ - { 207, -2 }, /* (86) db_optr ::= db_optr rows */ - { 207, -2 }, /* (87) db_optr ::= db_optr ablocks */ - { 207, -2 }, /* (88) db_optr ::= db_optr tblocks */ - { 207, -2 }, /* (89) db_optr ::= db_optr ctime */ - { 207, -2 }, /* (90) db_optr ::= db_optr clog */ - { 207, -2 }, /* (91) db_optr ::= db_optr comp */ - { 207, -2 }, /* (92) db_optr ::= db_optr prec */ - { 207, -2 }, /* (93) db_optr ::= db_optr keep */ - { 204, 0 }, /* (94) alter_db_optr ::= */ - { 204, -2 }, /* (95) alter_db_optr ::= alter_db_optr replica */ - { 204, -2 }, /* (96) alter_db_optr ::= alter_db_optr tables */ - { 230, -1 }, /* (97) typename ::= ids */ - { 230, -4 }, /* (98) typename ::= ids LP signed RP */ - { 231, -1 }, /* (99) signed ::= INTEGER */ - { 231, -2 }, /* (100) signed ::= PLUS INTEGER */ - { 231, -2 }, /* (101) signed ::= MINUS INTEGER */ - { 199, -6 }, /* (102) cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */ - { 232, -3 }, /* (103) create_table_args ::= LP columnlist RP */ - { 232, -7 }, /* (104) create_table_args ::= LP columnlist RP TAGS LP columnlist RP */ - { 232, -7 }, /* (105) create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */ - { 232, -2 }, /* (106) create_table_args ::= AS select */ - { 233, -3 }, /* (107) columnlist ::= columnlist COMMA column */ - { 233, -1 }, /* (108) columnlist ::= column */ - { 235, -2 }, /* (109) column ::= ids typename */ - { 218, -3 }, /* (110) tagitemlist ::= tagitemlist COMMA tagitem */ - { 218, -1 }, /* (111) tagitemlist ::= tagitem */ - { 236, -1 }, /* (112) tagitem ::= INTEGER */ - { 236, -1 }, /* (113) tagitem ::= FLOAT */ - { 236, -1 }, /* (114) tagitem ::= STRING */ - { 236, -1 }, /* (115) tagitem ::= BOOL */ - { 236, -1 }, /* (116) tagitem ::= NULL */ - { 236, -2 }, /* (117) tagitem ::= MINUS INTEGER */ - { 236, -2 }, /* (118) tagitem ::= MINUS FLOAT */ - { 236, -2 }, /* (119) tagitem ::= PLUS INTEGER */ - { 236, -2 }, /* (120) tagitem ::= PLUS FLOAT */ - { 234, -12 }, /* (121) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ - { 248, -1 }, /* (122) union ::= select */ - { 248, -3 }, /* (123) union ::= LP union RP */ - { 248, -4 }, /* (124) union ::= union UNION ALL select */ - { 248, -6 }, /* (125) union ::= union UNION ALL LP select RP */ - { 199, -1 }, /* (126) cmd ::= union */ - { 234, -2 }, /* (127) select ::= SELECT selcollist */ - { 249, -2 }, /* (128) sclp ::= selcollist COMMA */ - { 249, 0 }, /* (129) sclp ::= */ - { 237, -3 }, /* (130) selcollist ::= sclp expr as */ - { 237, -2 }, /* (131) selcollist ::= sclp STAR */ - { 251, -2 }, /* (132) as ::= AS ids */ - { 251, -1 }, /* (133) as ::= ids */ - { 251, 0 }, /* (134) as ::= */ - { 238, -2 }, /* (135) from ::= FROM tablelist */ - { 252, -2 }, /* (136) tablelist ::= ids cpxName */ - { 252, -4 }, /* (137) tablelist ::= tablelist COMMA ids cpxName */ - { 253, -1 }, /* (138) tmvar ::= VARIABLE */ - { 240, -4 }, /* (139) interval_opt ::= INTERVAL LP tmvar RP */ - { 240, 0 }, /* (140) interval_opt ::= */ - { 241, 0 }, /* (141) fill_opt ::= */ - { 241, -6 }, /* (142) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - { 241, -4 }, /* (143) fill_opt ::= FILL LP ID RP */ - { 242, -4 }, /* (144) sliding_opt ::= SLIDING LP tmvar RP */ - { 242, 0 }, /* (145) sliding_opt ::= */ - { 244, 0 }, /* (146) orderby_opt ::= */ - { 244, -3 }, /* (147) orderby_opt ::= ORDER BY sortlist */ - { 254, -4 }, /* (148) sortlist ::= sortlist COMMA item sortorder */ - { 254, -2 }, /* (149) sortlist ::= item sortorder */ - { 256, -2 }, /* (150) item ::= ids cpxName */ - { 257, -1 }, /* (151) sortorder ::= ASC */ - { 257, -1 }, /* (152) sortorder ::= DESC */ - { 257, 0 }, /* (153) sortorder ::= */ - { 243, 0 }, /* (154) groupby_opt ::= */ - { 243, -3 }, /* (155) groupby_opt ::= GROUP BY grouplist */ - { 258, -3 }, /* (156) grouplist ::= grouplist COMMA item */ - { 258, -1 }, /* (157) grouplist ::= item */ - { 245, 0 }, /* (158) having_opt ::= */ - { 245, -2 }, /* (159) having_opt ::= HAVING expr */ - { 247, 0 }, /* (160) limit_opt ::= */ - { 247, -2 }, /* (161) limit_opt ::= LIMIT signed */ - { 247, -4 }, /* (162) limit_opt ::= LIMIT signed OFFSET signed */ - { 247, -4 }, /* (163) limit_opt ::= LIMIT signed COMMA signed */ - { 246, 0 }, /* (164) slimit_opt ::= */ - { 246, -2 }, /* (165) slimit_opt ::= SLIMIT signed */ - { 246, -4 }, /* (166) slimit_opt ::= SLIMIT signed SOFFSET signed */ - { 246, -4 }, /* (167) slimit_opt ::= SLIMIT signed COMMA signed */ - { 239, 0 }, /* (168) where_opt ::= */ - { 239, -2 }, /* (169) where_opt ::= WHERE expr */ - { 250, -3 }, /* (170) expr ::= LP expr RP */ - { 250, -1 }, /* (171) expr ::= ID */ - { 250, -3 }, /* (172) expr ::= ID DOT ID */ - { 250, -3 }, /* (173) expr ::= ID DOT STAR */ - { 250, -1 }, /* (174) expr ::= INTEGER */ - { 250, -2 }, /* (175) expr ::= MINUS INTEGER */ - { 250, -2 }, /* (176) expr ::= PLUS INTEGER */ - { 250, -1 }, /* (177) expr ::= FLOAT */ - { 250, -2 }, /* (178) expr ::= MINUS FLOAT */ - { 250, -2 }, /* (179) expr ::= PLUS FLOAT */ - { 250, -1 }, /* (180) expr ::= STRING */ - { 250, -1 }, /* (181) expr ::= NOW */ - { 250, -1 }, /* (182) expr ::= VARIABLE */ - { 250, -1 }, /* (183) expr ::= BOOL */ - { 250, -4 }, /* (184) expr ::= ID LP exprlist RP */ - { 250, -4 }, /* (185) expr ::= ID LP STAR RP */ - { 250, -3 }, /* (186) expr ::= expr AND expr */ - { 250, -3 }, /* (187) expr ::= expr OR expr */ - { 250, -3 }, /* (188) expr ::= expr LT expr */ - { 250, -3 }, /* (189) expr ::= expr GT expr */ - { 250, -3 }, /* (190) expr ::= expr LE expr */ - { 250, -3 }, /* (191) expr ::= expr GE expr */ - { 250, -3 }, /* (192) expr ::= expr NE expr */ - { 250, -3 }, /* (193) expr ::= expr EQ expr */ - { 250, -3 }, /* (194) expr ::= expr PLUS expr */ - { 250, -3 }, /* (195) expr ::= expr MINUS expr */ - { 250, -3 }, /* (196) expr ::= expr STAR expr */ - { 250, -3 }, /* (197) expr ::= expr SLASH expr */ - { 250, -3 }, /* (198) expr ::= expr REM expr */ - { 250, -3 }, /* (199) expr ::= expr LIKE expr */ - { 250, -5 }, /* (200) expr ::= expr IN LP exprlist RP */ - { 259, -3 }, /* (201) exprlist ::= exprlist COMMA expritem */ - { 259, -1 }, /* (202) exprlist ::= expritem */ - { 260, -1 }, /* (203) expritem ::= expr */ - { 260, 0 }, /* (204) expritem ::= */ - { 199, -3 }, /* (205) cmd ::= RESET QUERY CACHE */ - { 199, -7 }, /* (206) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - { 199, -7 }, /* (207) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - { 199, -7 }, /* (208) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - { 199, -7 }, /* (209) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - { 199, -8 }, /* (210) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - { 199, -9 }, /* (211) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - { 199, -5 }, /* (212) cmd ::= KILL CONNECTION IPTOKEN COLON INTEGER */ - { 199, -7 }, /* (213) cmd ::= KILL STREAM IPTOKEN COLON INTEGER COLON INTEGER */ - { 199, -7 }, /* (214) cmd ::= KILL QUERY IPTOKEN COLON INTEGER COLON INTEGER */ + { 199, -4 }, /* (24) cmd ::= SHOW dbPrefix VGROUPS ids */ + { 199, -5 }, /* (25) cmd ::= DROP TABLE ifexists ids cpxName */ + { 199, -4 }, /* (26) cmd ::= DROP DATABASE ifexists ids */ + { 199, -3 }, /* (27) cmd ::= DROP DNODE IPTOKEN */ + { 199, -3 }, /* (28) cmd ::= DROP USER ids */ + { 199, -3 }, /* (29) cmd ::= DROP ACCOUNT ids */ + { 199, -2 }, /* (30) cmd ::= USE ids */ + { 199, -3 }, /* (31) cmd ::= DESCRIBE ids cpxName */ + { 199, -5 }, /* (32) cmd ::= ALTER USER ids PASS ids */ + { 199, -5 }, /* (33) cmd ::= ALTER USER ids PRIVILEGE ids */ + { 199, -4 }, /* (34) cmd ::= ALTER DNODE IPTOKEN ids */ + { 199, -5 }, /* (35) cmd ::= ALTER DNODE IPTOKEN ids ids */ + { 199, -3 }, /* (36) cmd ::= ALTER LOCAL ids */ + { 199, -4 }, /* (37) cmd ::= ALTER LOCAL ids ids */ + { 199, -4 }, /* (38) cmd ::= ALTER DATABASE ids alter_db_optr */ + { 199, -4 }, /* (39) cmd ::= ALTER ACCOUNT ids acct_optr */ + { 199, -6 }, /* (40) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + { 201, -1 }, /* (41) ids ::= ID */ + { 201, -1 }, /* (42) ids ::= STRING */ + { 203, -2 }, /* (43) ifexists ::= IF EXISTS */ + { 203, 0 }, /* (44) ifexists ::= */ + { 206, -3 }, /* (45) ifnotexists ::= IF NOT EXISTS */ + { 206, 0 }, /* (46) ifnotexists ::= */ + { 199, -3 }, /* (47) cmd ::= CREATE DNODE IPTOKEN */ + { 199, -6 }, /* (48) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + { 199, -5 }, /* (49) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + { 199, -5 }, /* (50) cmd ::= CREATE USER ids PASS ids */ + { 208, 0 }, /* (51) pps ::= */ + { 208, -2 }, /* (52) pps ::= PPS INTEGER */ + { 209, 0 }, /* (53) tseries ::= */ + { 209, -2 }, /* (54) tseries ::= TSERIES INTEGER */ + { 210, 0 }, /* (55) dbs ::= */ + { 210, -2 }, /* (56) dbs ::= DBS INTEGER */ + { 211, 0 }, /* (57) streams ::= */ + { 211, -2 }, /* (58) streams ::= STREAMS INTEGER */ + { 212, 0 }, /* (59) storage ::= */ + { 212, -2 }, /* (60) storage ::= STORAGE INTEGER */ + { 213, 0 }, /* (61) qtime ::= */ + { 213, -2 }, /* (62) qtime ::= QTIME INTEGER */ + { 214, 0 }, /* (63) users ::= */ + { 214, -2 }, /* (64) users ::= USERS INTEGER */ + { 215, 0 }, /* (65) conns ::= */ + { 215, -2 }, /* (66) conns ::= CONNS INTEGER */ + { 216, 0 }, /* (67) state ::= */ + { 216, -2 }, /* (68) state ::= STATE ids */ + { 205, -9 }, /* (69) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + { 217, -2 }, /* (70) keep ::= KEEP tagitemlist */ + { 219, -2 }, /* (71) tables ::= TABLES INTEGER */ + { 220, -2 }, /* (72) cache ::= CACHE INTEGER */ + { 221, -2 }, /* (73) replica ::= REPLICA INTEGER */ + { 222, -2 }, /* (74) days ::= DAYS INTEGER */ + { 223, -2 }, /* (75) rows ::= ROWS INTEGER */ + { 224, -2 }, /* (76) ablocks ::= ABLOCKS ID */ + { 225, -2 }, /* (77) tblocks ::= TBLOCKS INTEGER */ + { 226, -2 }, /* (78) ctime ::= CTIME INTEGER */ + { 227, -2 }, /* (79) clog ::= CLOG INTEGER */ + { 228, -2 }, /* (80) comp ::= COMP INTEGER */ + { 229, -2 }, /* (81) prec ::= PRECISION STRING */ + { 207, 0 }, /* (82) db_optr ::= */ + { 207, -2 }, /* (83) db_optr ::= db_optr tables */ + { 207, -2 }, /* (84) db_optr ::= db_optr cache */ + { 207, -2 }, /* (85) db_optr ::= db_optr replica */ + { 207, -2 }, /* (86) db_optr ::= db_optr days */ + { 207, -2 }, /* (87) db_optr ::= db_optr rows */ + { 207, -2 }, /* (88) db_optr ::= db_optr ablocks */ + { 207, -2 }, /* (89) db_optr ::= db_optr tblocks */ + { 207, -2 }, /* (90) db_optr ::= db_optr ctime */ + { 207, -2 }, /* (91) db_optr ::= db_optr clog */ + { 207, -2 }, /* (92) db_optr ::= db_optr comp */ + { 207, -2 }, /* (93) db_optr ::= db_optr prec */ + { 207, -2 }, /* (94) db_optr ::= db_optr keep */ + { 204, 0 }, /* (95) alter_db_optr ::= */ + { 204, -2 }, /* (96) alter_db_optr ::= alter_db_optr replica */ + { 204, -2 }, /* (97) alter_db_optr ::= alter_db_optr tables */ + { 230, -1 }, /* (98) typename ::= ids */ + { 230, -4 }, /* (99) typename ::= ids LP signed RP */ + { 231, -1 }, /* (100) signed ::= INTEGER */ + { 231, -2 }, /* (101) signed ::= PLUS INTEGER */ + { 231, -2 }, /* (102) signed ::= MINUS INTEGER */ + { 199, -6 }, /* (103) cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */ + { 232, -3 }, /* (104) create_table_args ::= LP columnlist RP */ + { 232, -7 }, /* (105) create_table_args ::= LP columnlist RP TAGS LP columnlist RP */ + { 232, -7 }, /* (106) create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */ + { 232, -2 }, /* (107) create_table_args ::= AS select */ + { 233, -3 }, /* (108) columnlist ::= columnlist COMMA column */ + { 233, -1 }, /* (109) columnlist ::= column */ + { 235, -2 }, /* (110) column ::= ids typename */ + { 218, -3 }, /* (111) tagitemlist ::= tagitemlist COMMA tagitem */ + { 218, -1 }, /* (112) tagitemlist ::= tagitem */ + { 236, -1 }, /* (113) tagitem ::= INTEGER */ + { 236, -1 }, /* (114) tagitem ::= FLOAT */ + { 236, -1 }, /* (115) tagitem ::= STRING */ + { 236, -1 }, /* (116) tagitem ::= BOOL */ + { 236, -1 }, /* (117) tagitem ::= NULL */ + { 236, -2 }, /* (118) tagitem ::= MINUS INTEGER */ + { 236, -2 }, /* (119) tagitem ::= MINUS FLOAT */ + { 236, -2 }, /* (120) tagitem ::= PLUS INTEGER */ + { 236, -2 }, /* (121) tagitem ::= PLUS FLOAT */ + { 234, -12 }, /* (122) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ + { 248, -1 }, /* (123) union ::= select */ + { 248, -3 }, /* (124) union ::= LP union RP */ + { 248, -4 }, /* (125) union ::= union UNION ALL select */ + { 248, -6 }, /* (126) union ::= union UNION ALL LP select RP */ + { 199, -1 }, /* (127) cmd ::= union */ + { 234, -2 }, /* (128) select ::= SELECT selcollist */ + { 249, -2 }, /* (129) sclp ::= selcollist COMMA */ + { 249, 0 }, /* (130) sclp ::= */ + { 237, -3 }, /* (131) selcollist ::= sclp expr as */ + { 237, -2 }, /* (132) selcollist ::= sclp STAR */ + { 251, -2 }, /* (133) as ::= AS ids */ + { 251, -1 }, /* (134) as ::= ids */ + { 251, 0 }, /* (135) as ::= */ + { 238, -2 }, /* (136) from ::= FROM tablelist */ + { 252, -2 }, /* (137) tablelist ::= ids cpxName */ + { 252, -4 }, /* (138) tablelist ::= tablelist COMMA ids cpxName */ + { 253, -1 }, /* (139) tmvar ::= VARIABLE */ + { 240, -4 }, /* (140) interval_opt ::= INTERVAL LP tmvar RP */ + { 240, 0 }, /* (141) interval_opt ::= */ + { 241, 0 }, /* (142) fill_opt ::= */ + { 241, -6 }, /* (143) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + { 241, -4 }, /* (144) fill_opt ::= FILL LP ID RP */ + { 242, -4 }, /* (145) sliding_opt ::= SLIDING LP tmvar RP */ + { 242, 0 }, /* (146) sliding_opt ::= */ + { 244, 0 }, /* (147) orderby_opt ::= */ + { 244, -3 }, /* (148) orderby_opt ::= ORDER BY sortlist */ + { 254, -4 }, /* (149) sortlist ::= sortlist COMMA item sortorder */ + { 254, -2 }, /* (150) sortlist ::= item sortorder */ + { 256, -2 }, /* (151) item ::= ids cpxName */ + { 257, -1 }, /* (152) sortorder ::= ASC */ + { 257, -1 }, /* (153) sortorder ::= DESC */ + { 257, 0 }, /* (154) sortorder ::= */ + { 243, 0 }, /* (155) groupby_opt ::= */ + { 243, -3 }, /* (156) groupby_opt ::= GROUP BY grouplist */ + { 258, -3 }, /* (157) grouplist ::= grouplist COMMA item */ + { 258, -1 }, /* (158) grouplist ::= item */ + { 245, 0 }, /* (159) having_opt ::= */ + { 245, -2 }, /* (160) having_opt ::= HAVING expr */ + { 247, 0 }, /* (161) limit_opt ::= */ + { 247, -2 }, /* (162) limit_opt ::= LIMIT signed */ + { 247, -4 }, /* (163) limit_opt ::= LIMIT signed OFFSET signed */ + { 247, -4 }, /* (164) limit_opt ::= LIMIT signed COMMA signed */ + { 246, 0 }, /* (165) slimit_opt ::= */ + { 246, -2 }, /* (166) slimit_opt ::= SLIMIT signed */ + { 246, -4 }, /* (167) slimit_opt ::= SLIMIT signed SOFFSET signed */ + { 246, -4 }, /* (168) slimit_opt ::= SLIMIT signed COMMA signed */ + { 239, 0 }, /* (169) where_opt ::= */ + { 239, -2 }, /* (170) where_opt ::= WHERE expr */ + { 250, -3 }, /* (171) expr ::= LP expr RP */ + { 250, -1 }, /* (172) expr ::= ID */ + { 250, -3 }, /* (173) expr ::= ID DOT ID */ + { 250, -3 }, /* (174) expr ::= ID DOT STAR */ + { 250, -1 }, /* (175) expr ::= INTEGER */ + { 250, -2 }, /* (176) expr ::= MINUS INTEGER */ + { 250, -2 }, /* (177) expr ::= PLUS INTEGER */ + { 250, -1 }, /* (178) expr ::= FLOAT */ + { 250, -2 }, /* (179) expr ::= MINUS FLOAT */ + { 250, -2 }, /* (180) expr ::= PLUS FLOAT */ + { 250, -1 }, /* (181) expr ::= STRING */ + { 250, -1 }, /* (182) expr ::= NOW */ + { 250, -1 }, /* (183) expr ::= VARIABLE */ + { 250, -1 }, /* (184) expr ::= BOOL */ + { 250, -4 }, /* (185) expr ::= ID LP exprlist RP */ + { 250, -4 }, /* (186) expr ::= ID LP STAR RP */ + { 250, -3 }, /* (187) expr ::= expr AND expr */ + { 250, -3 }, /* (188) expr ::= expr OR expr */ + { 250, -3 }, /* (189) expr ::= expr LT expr */ + { 250, -3 }, /* (190) expr ::= expr GT expr */ + { 250, -3 }, /* (191) expr ::= expr LE expr */ + { 250, -3 }, /* (192) expr ::= expr GE expr */ + { 250, -3 }, /* (193) expr ::= expr NE expr */ + { 250, -3 }, /* (194) expr ::= expr EQ expr */ + { 250, -3 }, /* (195) expr ::= expr PLUS expr */ + { 250, -3 }, /* (196) expr ::= expr MINUS expr */ + { 250, -3 }, /* (197) expr ::= expr STAR expr */ + { 250, -3 }, /* (198) expr ::= expr SLASH expr */ + { 250, -3 }, /* (199) expr ::= expr REM expr */ + { 250, -3 }, /* (200) expr ::= expr LIKE expr */ + { 250, -5 }, /* (201) expr ::= expr IN LP exprlist RP */ + { 259, -3 }, /* (202) exprlist ::= exprlist COMMA expritem */ + { 259, -1 }, /* (203) exprlist ::= expritem */ + { 260, -1 }, /* (204) expritem ::= expr */ + { 260, 0 }, /* (205) expritem ::= */ + { 199, -3 }, /* (206) cmd ::= RESET QUERY CACHE */ + { 199, -7 }, /* (207) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + { 199, -7 }, /* (208) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + { 199, -7 }, /* (209) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + { 199, -7 }, /* (210) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + { 199, -8 }, /* (211) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + { 199, -9 }, /* (212) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + { 199, -5 }, /* (213) cmd ::= KILL CONNECTION IPTOKEN COLON INTEGER */ + { 199, -7 }, /* (214) cmd ::= KILL STREAM IPTOKEN COLON INTEGER COLON INTEGER */ + { 199, -7 }, /* (215) cmd ::= KILL QUERY IPTOKEN COLON INTEGER COLON INTEGER */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -2026,110 +2028,117 @@ static void yy_reduce( setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0); } break; - case 24: /* cmd ::= DROP TABLE ifexists ids cpxName */ + case 24: /* cmd ::= SHOW dbPrefix VGROUPS ids */ +{ + SSQLToken token; + setDBName(&token, &yymsp[-2].minor.yy0); + setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &yymsp[0].minor.yy0); +} + break; + case 25: /* cmd ::= DROP TABLE ifexists ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; setDropDBTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 25: /* cmd ::= DROP DATABASE ifexists ids */ + case 26: /* cmd ::= DROP DATABASE ifexists ids */ { setDropDBTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 26: /* cmd ::= DROP DNODE IPTOKEN */ + case 27: /* cmd ::= DROP DNODE IPTOKEN */ { setDCLSQLElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); } break; - case 27: /* cmd ::= DROP USER ids */ + case 28: /* cmd ::= DROP USER ids */ { setDCLSQLElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); } break; - case 28: /* cmd ::= DROP ACCOUNT ids */ + case 29: /* cmd ::= DROP ACCOUNT ids */ { setDCLSQLElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); } break; - case 29: /* cmd ::= USE ids */ + case 30: /* cmd ::= USE ids */ { setDCLSQLElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);} break; - case 30: /* cmd ::= DESCRIBE ids cpxName */ + case 31: /* cmd ::= DESCRIBE ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; setDCLSQLElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0); } break; - case 31: /* cmd ::= ALTER USER ids PASS ids */ + case 32: /* cmd ::= ALTER USER ids PASS ids */ { setAlterUserSQL(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); } break; - case 32: /* cmd ::= ALTER USER ids PRIVILEGE ids */ + case 33: /* cmd ::= ALTER USER ids PRIVILEGE ids */ { setAlterUserSQL(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);} break; - case 33: /* cmd ::= ALTER DNODE IPTOKEN ids */ + case 34: /* cmd ::= ALTER DNODE IPTOKEN ids */ { setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 34: /* cmd ::= ALTER DNODE IPTOKEN ids ids */ + case 35: /* cmd ::= ALTER DNODE IPTOKEN ids ids */ { setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 35: /* cmd ::= ALTER LOCAL ids */ + case 36: /* cmd ::= ALTER LOCAL ids */ { setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); } break; - case 36: /* cmd ::= ALTER LOCAL ids ids */ + case 37: /* cmd ::= ALTER LOCAL ids ids */ { setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 37: /* cmd ::= ALTER DATABASE ids alter_db_optr */ + case 38: /* cmd ::= ALTER DATABASE ids alter_db_optr */ { SSQLToken t = {0}; setCreateDBSQL(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy262, &t);} break; - case 38: /* cmd ::= ALTER ACCOUNT ids acct_optr */ + case 39: /* cmd ::= ALTER ACCOUNT ids acct_optr */ { setCreateAcctSQL(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy155);} break; - case 39: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + case 40: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ { setCreateAcctSQL(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy155);} break; - case 40: /* ids ::= ID */ - case 41: /* ids ::= STRING */ yytestcase(yyruleno==41); + case 41: /* ids ::= ID */ + case 42: /* ids ::= STRING */ yytestcase(yyruleno==42); {yylhsminor.yy0 = yymsp[0].minor.yy0; } yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 42: /* ifexists ::= IF EXISTS */ + case 43: /* ifexists ::= IF EXISTS */ {yymsp[-1].minor.yy0.n = 1;} break; - case 43: /* ifexists ::= */ - case 45: /* ifnotexists ::= */ yytestcase(yyruleno==45); + case 44: /* ifexists ::= */ + case 46: /* ifnotexists ::= */ yytestcase(yyruleno==46); {yymsp[1].minor.yy0.n = 0;} break; - case 44: /* ifnotexists ::= IF NOT EXISTS */ + case 45: /* ifnotexists ::= IF NOT EXISTS */ {yymsp[-2].minor.yy0.n = 1;} break; - case 46: /* cmd ::= CREATE DNODE IPTOKEN */ + case 47: /* cmd ::= CREATE DNODE IPTOKEN */ { setDCLSQLElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} break; - case 47: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + case 48: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ { setCreateAcctSQL(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy155);} break; - case 48: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + case 49: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ { setCreateDBSQL(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy262, &yymsp[-2].minor.yy0);} break; - case 49: /* cmd ::= CREATE USER ids PASS ids */ + case 50: /* cmd ::= CREATE USER ids PASS ids */ { setCreateUserSQL(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} break; - case 50: /* pps ::= */ - case 52: /* tseries ::= */ yytestcase(yyruleno==52); - case 54: /* dbs ::= */ yytestcase(yyruleno==54); - case 56: /* streams ::= */ yytestcase(yyruleno==56); - case 58: /* storage ::= */ yytestcase(yyruleno==58); - case 60: /* qtime ::= */ yytestcase(yyruleno==60); - case 62: /* users ::= */ yytestcase(yyruleno==62); - case 64: /* conns ::= */ yytestcase(yyruleno==64); - case 66: /* state ::= */ yytestcase(yyruleno==66); + case 51: /* pps ::= */ + case 53: /* tseries ::= */ yytestcase(yyruleno==53); + case 55: /* dbs ::= */ yytestcase(yyruleno==55); + case 57: /* streams ::= */ yytestcase(yyruleno==57); + case 59: /* storage ::= */ yytestcase(yyruleno==59); + case 61: /* qtime ::= */ yytestcase(yyruleno==61); + case 63: /* users ::= */ yytestcase(yyruleno==63); + case 65: /* conns ::= */ yytestcase(yyruleno==65); + case 67: /* state ::= */ yytestcase(yyruleno==67); {yymsp[1].minor.yy0.n = 0; } break; - case 51: /* pps ::= PPS INTEGER */ - case 53: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==53); - case 55: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==55); - case 57: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==57); - case 59: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==59); - case 61: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==61); - case 63: /* users ::= USERS INTEGER */ yytestcase(yyruleno==63); - case 65: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==65); - case 67: /* state ::= STATE ids */ yytestcase(yyruleno==67); + case 52: /* pps ::= PPS INTEGER */ + case 54: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==54); + case 56: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==56); + case 58: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==58); + case 60: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==60); + case 62: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==62); + case 64: /* users ::= USERS INTEGER */ yytestcase(yyruleno==64); + case 66: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==66); + case 68: /* state ::= STATE ids */ yytestcase(yyruleno==68); {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; - case 68: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + case 69: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ { yylhsminor.yy155.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; yylhsminor.yy155.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; @@ -2143,167 +2152,167 @@ static void yy_reduce( } yymsp[-8].minor.yy155 = yylhsminor.yy155; break; - case 69: /* keep ::= KEEP tagitemlist */ + case 70: /* keep ::= KEEP tagitemlist */ { yymsp[-1].minor.yy480 = yymsp[0].minor.yy480; } break; - case 70: /* tables ::= TABLES INTEGER */ - case 71: /* cache ::= CACHE INTEGER */ yytestcase(yyruleno==71); - case 72: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==72); - case 73: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==73); - case 74: /* rows ::= ROWS INTEGER */ yytestcase(yyruleno==74); - case 75: /* ablocks ::= ABLOCKS ID */ yytestcase(yyruleno==75); - case 76: /* tblocks ::= TBLOCKS INTEGER */ yytestcase(yyruleno==76); - case 77: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==77); - case 78: /* clog ::= CLOG INTEGER */ yytestcase(yyruleno==78); - case 79: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==79); - case 80: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==80); + case 71: /* tables ::= TABLES INTEGER */ + case 72: /* cache ::= CACHE INTEGER */ yytestcase(yyruleno==72); + case 73: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==73); + case 74: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==74); + case 75: /* rows ::= ROWS INTEGER */ yytestcase(yyruleno==75); + case 76: /* ablocks ::= ABLOCKS ID */ yytestcase(yyruleno==76); + case 77: /* tblocks ::= TBLOCKS INTEGER */ yytestcase(yyruleno==77); + case 78: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==78); + case 79: /* clog ::= CLOG INTEGER */ yytestcase(yyruleno==79); + case 80: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==80); + case 81: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==81); { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; - case 81: /* db_optr ::= */ + case 82: /* db_optr ::= */ {setDefaultCreateDbOption(&yymsp[1].minor.yy262);} break; - case 82: /* db_optr ::= db_optr tables */ - case 96: /* alter_db_optr ::= alter_db_optr tables */ yytestcase(yyruleno==96); + case 83: /* db_optr ::= db_optr tables */ + case 97: /* alter_db_optr ::= alter_db_optr tables */ yytestcase(yyruleno==97); { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.tablesPerVnode = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 83: /* db_optr ::= db_optr cache */ + case 84: /* db_optr ::= db_optr cache */ { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 84: /* db_optr ::= db_optr replica */ - case 95: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==95); + case 85: /* db_optr ::= db_optr replica */ + case 96: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==96); { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 85: /* db_optr ::= db_optr days */ + case 86: /* db_optr ::= db_optr days */ { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 86: /* db_optr ::= db_optr rows */ + case 87: /* db_optr ::= db_optr rows */ { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.rowPerFileBlock = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 87: /* db_optr ::= db_optr ablocks */ + case 88: /* db_optr ::= db_optr ablocks */ { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.numOfAvgCacheBlocks = strtod(yymsp[0].minor.yy0.z, NULL); } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 88: /* db_optr ::= db_optr tblocks */ + case 89: /* db_optr ::= db_optr tblocks */ { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.numOfBlocksPerTable = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 89: /* db_optr ::= db_optr ctime */ + case 90: /* db_optr ::= db_optr ctime */ { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 90: /* db_optr ::= db_optr clog */ + case 91: /* db_optr ::= db_optr clog */ { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.commitLog = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 91: /* db_optr ::= db_optr comp */ + case 92: /* db_optr ::= db_optr comp */ { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 92: /* db_optr ::= db_optr prec */ + case 93: /* db_optr ::= db_optr prec */ { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.precision = yymsp[0].minor.yy0; } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 93: /* db_optr ::= db_optr keep */ + case 94: /* db_optr ::= db_optr keep */ { yylhsminor.yy262 = yymsp[-1].minor.yy262; yylhsminor.yy262.keep = yymsp[0].minor.yy480; } yymsp[-1].minor.yy262 = yylhsminor.yy262; break; - case 94: /* alter_db_optr ::= */ + case 95: /* alter_db_optr ::= */ { setDefaultCreateDbOption(&yymsp[1].minor.yy262);} break; - case 97: /* typename ::= ids */ + case 98: /* typename ::= ids */ { tSQLSetColumnType (&yylhsminor.yy397, &yymsp[0].minor.yy0); } yymsp[0].minor.yy397 = yylhsminor.yy397; break; - case 98: /* typename ::= ids LP signed RP */ + case 99: /* typename ::= ids LP signed RP */ { yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy369; // negative value of name length tSQLSetColumnType(&yylhsminor.yy397, &yymsp[-3].minor.yy0); } yymsp[-3].minor.yy397 = yylhsminor.yy397; break; - case 99: /* signed ::= INTEGER */ + case 100: /* signed ::= INTEGER */ { yylhsminor.yy369 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[0].minor.yy369 = yylhsminor.yy369; break; - case 100: /* signed ::= PLUS INTEGER */ + case 101: /* signed ::= PLUS INTEGER */ { yymsp[-1].minor.yy369 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 101: /* signed ::= MINUS INTEGER */ + case 102: /* signed ::= MINUS INTEGER */ { yymsp[-1].minor.yy369 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} break; - case 102: /* cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */ + case 103: /* cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; setCreatedMeterName(pInfo, &yymsp[-2].minor.yy0, &yymsp[-3].minor.yy0); } break; - case 103: /* create_table_args ::= LP columnlist RP */ + case 104: /* create_table_args ::= LP columnlist RP */ { yymsp[-2].minor.yy344 = tSetCreateSQLElems(yymsp[-1].minor.yy421, NULL, NULL, NULL, NULL, TSQL_CREATE_TABLE); setSQLInfo(pInfo, yymsp[-2].minor.yy344, NULL, TSDB_SQL_CREATE_TABLE); } break; - case 104: /* create_table_args ::= LP columnlist RP TAGS LP columnlist RP */ + case 105: /* create_table_args ::= LP columnlist RP TAGS LP columnlist RP */ { yymsp[-6].minor.yy344 = tSetCreateSQLElems(yymsp[-5].minor.yy421, yymsp[-1].minor.yy421, NULL, NULL, NULL, TSQL_CREATE_STABLE); setSQLInfo(pInfo, yymsp[-6].minor.yy344, NULL, TSDB_SQL_CREATE_TABLE); } break; - case 105: /* create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */ + case 106: /* create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-6].minor.yy344 = tSetCreateSQLElems(NULL, NULL, &yymsp[-5].minor.yy0, yymsp[-1].minor.yy480, NULL, TSQL_CREATE_TABLE_FROM_STABLE); setSQLInfo(pInfo, yymsp[-6].minor.yy344, NULL, TSDB_SQL_CREATE_TABLE); } break; - case 106: /* create_table_args ::= AS select */ + case 107: /* create_table_args ::= AS select */ { yymsp[-1].minor.yy344 = tSetCreateSQLElems(NULL, NULL, NULL, NULL, yymsp[0].minor.yy138, TSQL_CREATE_STREAM); setSQLInfo(pInfo, yymsp[-1].minor.yy344, NULL, TSDB_SQL_CREATE_TABLE); } break; - case 107: /* columnlist ::= columnlist COMMA column */ + case 108: /* columnlist ::= columnlist COMMA column */ {yylhsminor.yy421 = tFieldListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy397); } yymsp[-2].minor.yy421 = yylhsminor.yy421; break; - case 108: /* columnlist ::= column */ + case 109: /* columnlist ::= column */ {yylhsminor.yy421 = tFieldListAppend(NULL, &yymsp[0].minor.yy397);} yymsp[0].minor.yy421 = yylhsminor.yy421; break; - case 109: /* column ::= ids typename */ + case 110: /* column ::= ids typename */ { tSQLSetColumnInfo(&yylhsminor.yy397, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy397); } yymsp[-1].minor.yy397 = yylhsminor.yy397; break; - case 110: /* tagitemlist ::= tagitemlist COMMA tagitem */ + case 111: /* tagitemlist ::= tagitemlist COMMA tagitem */ { yylhsminor.yy480 = tVariantListAppend(yymsp[-2].minor.yy480, &yymsp[0].minor.yy236, -1); } yymsp[-2].minor.yy480 = yylhsminor.yy480; break; - case 111: /* tagitemlist ::= tagitem */ + case 112: /* tagitemlist ::= tagitem */ { yylhsminor.yy480 = tVariantListAppend(NULL, &yymsp[0].minor.yy236, -1); } yymsp[0].minor.yy480 = yylhsminor.yy480; break; - case 112: /* tagitem ::= INTEGER */ - case 113: /* tagitem ::= FLOAT */ yytestcase(yyruleno==113); - case 114: /* tagitem ::= STRING */ yytestcase(yyruleno==114); - case 115: /* tagitem ::= BOOL */ yytestcase(yyruleno==115); + case 113: /* tagitem ::= INTEGER */ + case 114: /* tagitem ::= FLOAT */ yytestcase(yyruleno==114); + case 115: /* tagitem ::= STRING */ yytestcase(yyruleno==115); + case 116: /* tagitem ::= BOOL */ yytestcase(yyruleno==116); {toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy236, &yymsp[0].minor.yy0); } yymsp[0].minor.yy236 = yylhsminor.yy236; break; - case 116: /* tagitem ::= NULL */ + case 117: /* tagitem ::= NULL */ { yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy236, &yymsp[0].minor.yy0); } yymsp[0].minor.yy236 = yylhsminor.yy236; break; - case 117: /* tagitem ::= MINUS INTEGER */ - case 118: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==118); - case 119: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==119); - case 120: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==120); + case 118: /* tagitem ::= MINUS INTEGER */ + case 119: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==119); + case 120: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==120); + case 121: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==121); { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type; @@ -2312,93 +2321,93 @@ static void yy_reduce( } yymsp[-1].minor.yy236 = yylhsminor.yy236; break; - case 121: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ + case 122: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ { yylhsminor.yy138 = tSetQuerySQLElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy284, yymsp[-9].minor.yy480, yymsp[-8].minor.yy244, yymsp[-4].minor.yy480, yymsp[-3].minor.yy480, &yymsp[-7].minor.yy0, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy480, &yymsp[0].minor.yy162, &yymsp[-1].minor.yy162); } yymsp[-11].minor.yy138 = yylhsminor.yy138; break; - case 122: /* union ::= select */ + case 123: /* union ::= select */ { yylhsminor.yy117 = setSubclause(NULL, yymsp[0].minor.yy138); } yymsp[0].minor.yy117 = yylhsminor.yy117; break; - case 123: /* union ::= LP union RP */ + case 124: /* union ::= LP union RP */ { yymsp[-2].minor.yy117 = yymsp[-1].minor.yy117; } break; - case 124: /* union ::= union UNION ALL select */ + case 125: /* union ::= union UNION ALL select */ { yylhsminor.yy117 = appendSelectClause(yymsp[-3].minor.yy117, yymsp[0].minor.yy138); } yymsp[-3].minor.yy117 = yylhsminor.yy117; break; - case 125: /* union ::= union UNION ALL LP select RP */ + case 126: /* union ::= union UNION ALL LP select RP */ { yylhsminor.yy117 = appendSelectClause(yymsp[-5].minor.yy117, yymsp[-1].minor.yy138); } yymsp[-5].minor.yy117 = yylhsminor.yy117; break; - case 126: /* cmd ::= union */ + case 127: /* cmd ::= union */ { setSQLInfo(pInfo, yymsp[0].minor.yy117, NULL, TSDB_SQL_SELECT); } break; - case 127: /* select ::= SELECT selcollist */ + case 128: /* select ::= SELECT selcollist */ { yylhsminor.yy138 = tSetQuerySQLElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy284, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } yymsp[-1].minor.yy138 = yylhsminor.yy138; break; - case 128: /* sclp ::= selcollist COMMA */ + case 129: /* sclp ::= selcollist COMMA */ {yylhsminor.yy284 = yymsp[-1].minor.yy284;} yymsp[-1].minor.yy284 = yylhsminor.yy284; break; - case 129: /* sclp ::= */ + case 130: /* sclp ::= */ {yymsp[1].minor.yy284 = 0;} break; - case 130: /* selcollist ::= sclp expr as */ + case 131: /* selcollist ::= sclp expr as */ { yylhsminor.yy284 = tSQLExprListAppend(yymsp[-2].minor.yy284, yymsp[-1].minor.yy244, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); } yymsp[-2].minor.yy284 = yylhsminor.yy284; break; - case 131: /* selcollist ::= sclp STAR */ + case 132: /* selcollist ::= sclp STAR */ { tSQLExpr *pNode = tSQLExprIdValueCreate(NULL, TK_ALL); yylhsminor.yy284 = tSQLExprListAppend(yymsp[-1].minor.yy284, pNode, 0); } yymsp[-1].minor.yy284 = yylhsminor.yy284; break; - case 132: /* as ::= AS ids */ + case 133: /* as ::= AS ids */ { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; - case 133: /* as ::= ids */ + case 134: /* as ::= ids */ { yylhsminor.yy0 = yymsp[0].minor.yy0; } yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 134: /* as ::= */ + case 135: /* as ::= */ { yymsp[1].minor.yy0.n = 0; } break; - case 135: /* from ::= FROM tablelist */ + case 136: /* from ::= FROM tablelist */ {yymsp[-1].minor.yy480 = yymsp[0].minor.yy480;} break; - case 136: /* tablelist ::= ids cpxName */ + case 137: /* tablelist ::= ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yylhsminor.yy480 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);} yymsp[-1].minor.yy480 = yylhsminor.yy480; break; - case 137: /* tablelist ::= tablelist COMMA ids cpxName */ + case 138: /* tablelist ::= tablelist COMMA ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yylhsminor.yy480 = tVariantListAppendToken(yymsp[-3].minor.yy480, &yymsp[-1].minor.yy0, -1); } yymsp[-3].minor.yy480 = yylhsminor.yy480; break; - case 138: /* tmvar ::= VARIABLE */ + case 139: /* tmvar ::= VARIABLE */ {yylhsminor.yy0 = yymsp[0].minor.yy0;} yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 139: /* interval_opt ::= INTERVAL LP tmvar RP */ - case 144: /* sliding_opt ::= SLIDING LP tmvar RP */ yytestcase(yyruleno==144); + case 140: /* interval_opt ::= INTERVAL LP tmvar RP */ + case 145: /* sliding_opt ::= SLIDING LP tmvar RP */ yytestcase(yyruleno==145); {yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } break; - case 140: /* interval_opt ::= */ - case 145: /* sliding_opt ::= */ yytestcase(yyruleno==145); + case 141: /* interval_opt ::= */ + case 146: /* sliding_opt ::= */ yytestcase(yyruleno==146); {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } break; - case 141: /* fill_opt ::= */ + case 142: /* fill_opt ::= */ {yymsp[1].minor.yy480 = 0; } break; - case 142: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + case 143: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { tVariant A = {0}; toTSDBType(yymsp[-3].minor.yy0.type); @@ -2408,33 +2417,33 @@ static void yy_reduce( yymsp[-5].minor.yy480 = yymsp[-1].minor.yy480; } break; - case 143: /* fill_opt ::= FILL LP ID RP */ + case 144: /* fill_opt ::= FILL LP ID RP */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-3].minor.yy480 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); } break; - case 146: /* orderby_opt ::= */ - case 154: /* groupby_opt ::= */ yytestcase(yyruleno==154); + case 147: /* orderby_opt ::= */ + case 155: /* groupby_opt ::= */ yytestcase(yyruleno==155); {yymsp[1].minor.yy480 = 0;} break; - case 147: /* orderby_opt ::= ORDER BY sortlist */ - case 155: /* groupby_opt ::= GROUP BY grouplist */ yytestcase(yyruleno==155); + case 148: /* orderby_opt ::= ORDER BY sortlist */ + case 156: /* groupby_opt ::= GROUP BY grouplist */ yytestcase(yyruleno==156); {yymsp[-2].minor.yy480 = yymsp[0].minor.yy480;} break; - case 148: /* sortlist ::= sortlist COMMA item sortorder */ + case 149: /* sortlist ::= sortlist COMMA item sortorder */ { yylhsminor.yy480 = tVariantListAppend(yymsp[-3].minor.yy480, &yymsp[-1].minor.yy236, yymsp[0].minor.yy220); } yymsp[-3].minor.yy480 = yylhsminor.yy480; break; - case 149: /* sortlist ::= item sortorder */ + case 150: /* sortlist ::= item sortorder */ { yylhsminor.yy480 = tVariantListAppend(NULL, &yymsp[-1].minor.yy236, yymsp[0].minor.yy220); } yymsp[-1].minor.yy480 = yylhsminor.yy480; break; - case 150: /* item ::= ids cpxName */ + case 151: /* item ::= ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; @@ -2443,196 +2452,196 @@ static void yy_reduce( } yymsp[-1].minor.yy236 = yylhsminor.yy236; break; - case 151: /* sortorder ::= ASC */ + case 152: /* sortorder ::= ASC */ {yymsp[0].minor.yy220 = TSQL_SO_ASC; } break; - case 152: /* sortorder ::= DESC */ + case 153: /* sortorder ::= DESC */ {yymsp[0].minor.yy220 = TSQL_SO_DESC;} break; - case 153: /* sortorder ::= */ + case 154: /* sortorder ::= */ {yymsp[1].minor.yy220 = TSQL_SO_ASC;} break; - case 156: /* grouplist ::= grouplist COMMA item */ + case 157: /* grouplist ::= grouplist COMMA item */ { yylhsminor.yy480 = tVariantListAppend(yymsp[-2].minor.yy480, &yymsp[0].minor.yy236, -1); } yymsp[-2].minor.yy480 = yylhsminor.yy480; break; - case 157: /* grouplist ::= item */ + case 158: /* grouplist ::= item */ { yylhsminor.yy480 = tVariantListAppend(NULL, &yymsp[0].minor.yy236, -1); } yymsp[0].minor.yy480 = yylhsminor.yy480; break; - case 158: /* having_opt ::= */ - case 168: /* where_opt ::= */ yytestcase(yyruleno==168); - case 204: /* expritem ::= */ yytestcase(yyruleno==204); + case 159: /* having_opt ::= */ + case 169: /* where_opt ::= */ yytestcase(yyruleno==169); + case 205: /* expritem ::= */ yytestcase(yyruleno==205); {yymsp[1].minor.yy244 = 0;} break; - case 159: /* having_opt ::= HAVING expr */ - case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169); + case 160: /* having_opt ::= HAVING expr */ + case 170: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==170); {yymsp[-1].minor.yy244 = yymsp[0].minor.yy244;} break; - case 160: /* limit_opt ::= */ - case 164: /* slimit_opt ::= */ yytestcase(yyruleno==164); + case 161: /* limit_opt ::= */ + case 165: /* slimit_opt ::= */ yytestcase(yyruleno==165); {yymsp[1].minor.yy162.limit = -1; yymsp[1].minor.yy162.offset = 0;} break; - case 161: /* limit_opt ::= LIMIT signed */ - case 165: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==165); + case 162: /* limit_opt ::= LIMIT signed */ + case 166: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==166); {yymsp[-1].minor.yy162.limit = yymsp[0].minor.yy369; yymsp[-1].minor.yy162.offset = 0;} break; - case 162: /* limit_opt ::= LIMIT signed OFFSET signed */ - case 166: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ yytestcase(yyruleno==166); + case 163: /* limit_opt ::= LIMIT signed OFFSET signed */ + case 167: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ yytestcase(yyruleno==167); {yymsp[-3].minor.yy162.limit = yymsp[-2].minor.yy369; yymsp[-3].minor.yy162.offset = yymsp[0].minor.yy369;} break; - case 163: /* limit_opt ::= LIMIT signed COMMA signed */ - case 167: /* slimit_opt ::= SLIMIT signed COMMA signed */ yytestcase(yyruleno==167); + case 164: /* limit_opt ::= LIMIT signed COMMA signed */ + case 168: /* slimit_opt ::= SLIMIT signed COMMA signed */ yytestcase(yyruleno==168); {yymsp[-3].minor.yy162.limit = yymsp[0].minor.yy369; yymsp[-3].minor.yy162.offset = yymsp[-2].minor.yy369;} break; - case 170: /* expr ::= LP expr RP */ + case 171: /* expr ::= LP expr RP */ {yymsp[-2].minor.yy244 = yymsp[-1].minor.yy244; } break; - case 171: /* expr ::= ID */ + case 172: /* expr ::= ID */ {yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);} yymsp[0].minor.yy244 = yylhsminor.yy244; break; - case 172: /* expr ::= ID DOT ID */ + case 173: /* expr ::= ID DOT ID */ {yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);} yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 173: /* expr ::= ID DOT STAR */ + case 174: /* expr ::= ID DOT STAR */ {yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);} yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 174: /* expr ::= INTEGER */ + case 175: /* expr ::= INTEGER */ {yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);} yymsp[0].minor.yy244 = yylhsminor.yy244; break; - case 175: /* expr ::= MINUS INTEGER */ - case 176: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==176); + case 176: /* expr ::= MINUS INTEGER */ + case 177: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==177); {yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);} yymsp[-1].minor.yy244 = yylhsminor.yy244; break; - case 177: /* expr ::= FLOAT */ + case 178: /* expr ::= FLOAT */ {yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);} yymsp[0].minor.yy244 = yylhsminor.yy244; break; - case 178: /* expr ::= MINUS FLOAT */ - case 179: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==179); + case 179: /* expr ::= MINUS FLOAT */ + case 180: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==180); {yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);} yymsp[-1].minor.yy244 = yylhsminor.yy244; break; - case 180: /* expr ::= STRING */ + case 181: /* expr ::= STRING */ {yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);} yymsp[0].minor.yy244 = yylhsminor.yy244; break; - case 181: /* expr ::= NOW */ + case 182: /* expr ::= NOW */ {yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); } yymsp[0].minor.yy244 = yylhsminor.yy244; break; - case 182: /* expr ::= VARIABLE */ + case 183: /* expr ::= VARIABLE */ {yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);} yymsp[0].minor.yy244 = yylhsminor.yy244; break; - case 183: /* expr ::= BOOL */ + case 184: /* expr ::= BOOL */ {yylhsminor.yy244 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);} yymsp[0].minor.yy244 = yylhsminor.yy244; break; - case 184: /* expr ::= ID LP exprlist RP */ + case 185: /* expr ::= ID LP exprlist RP */ { yylhsminor.yy244 = tSQLExprCreateFunction(yymsp[-1].minor.yy284, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } yymsp[-3].minor.yy244 = yylhsminor.yy244; break; - case 185: /* expr ::= ID LP STAR RP */ + case 186: /* expr ::= ID LP STAR RP */ { yylhsminor.yy244 = tSQLExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } yymsp[-3].minor.yy244 = yylhsminor.yy244; break; - case 186: /* expr ::= expr AND expr */ + case 187: /* expr ::= expr AND expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_AND);} yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 187: /* expr ::= expr OR expr */ + case 188: /* expr ::= expr OR expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_OR); } yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 188: /* expr ::= expr LT expr */ + case 189: /* expr ::= expr LT expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_LT);} yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 189: /* expr ::= expr GT expr */ + case 190: /* expr ::= expr GT expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_GT);} yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 190: /* expr ::= expr LE expr */ + case 191: /* expr ::= expr LE expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_LE);} yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 191: /* expr ::= expr GE expr */ + case 192: /* expr ::= expr GE expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_GE);} yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 192: /* expr ::= expr NE expr */ + case 193: /* expr ::= expr NE expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_NE);} yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 193: /* expr ::= expr EQ expr */ + case 194: /* expr ::= expr EQ expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_EQ);} yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 194: /* expr ::= expr PLUS expr */ + case 195: /* expr ::= expr PLUS expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_PLUS); } yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 195: /* expr ::= expr MINUS expr */ + case 196: /* expr ::= expr MINUS expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_MINUS); } yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 196: /* expr ::= expr STAR expr */ + case 197: /* expr ::= expr STAR expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_STAR); } yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 197: /* expr ::= expr SLASH expr */ + case 198: /* expr ::= expr SLASH expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_DIVIDE);} yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 198: /* expr ::= expr REM expr */ + case 199: /* expr ::= expr REM expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_REM); } yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 199: /* expr ::= expr LIKE expr */ + case 200: /* expr ::= expr LIKE expr */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-2].minor.yy244, yymsp[0].minor.yy244, TK_LIKE); } yymsp[-2].minor.yy244 = yylhsminor.yy244; break; - case 200: /* expr ::= expr IN LP exprlist RP */ + case 201: /* expr ::= expr IN LP exprlist RP */ {yylhsminor.yy244 = tSQLExprCreate(yymsp[-4].minor.yy244, (tSQLExpr*)yymsp[-1].minor.yy284, TK_IN); } yymsp[-4].minor.yy244 = yylhsminor.yy244; break; - case 201: /* exprlist ::= exprlist COMMA expritem */ + case 202: /* exprlist ::= exprlist COMMA expritem */ {yylhsminor.yy284 = tSQLExprListAppend(yymsp[-2].minor.yy284,yymsp[0].minor.yy244,0);} yymsp[-2].minor.yy284 = yylhsminor.yy284; break; - case 202: /* exprlist ::= expritem */ + case 203: /* exprlist ::= expritem */ {yylhsminor.yy284 = tSQLExprListAppend(0,yymsp[0].minor.yy244,0);} yymsp[0].minor.yy284 = yylhsminor.yy284; break; - case 203: /* expritem ::= expr */ + case 204: /* expritem ::= expr */ {yylhsminor.yy244 = yymsp[0].minor.yy244;} yymsp[0].minor.yy244 = yylhsminor.yy244; break; - case 205: /* cmd ::= RESET QUERY CACHE */ + case 206: /* cmd ::= RESET QUERY CACHE */ { setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} break; - case 206: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + case 207: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN); setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 207: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + case 208: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -2643,14 +2652,14 @@ static void yy_reduce( setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 208: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + case 209: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN); setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 209: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + case 210: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -2661,7 +2670,7 @@ static void yy_reduce( setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 210: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + case 211: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -2675,7 +2684,7 @@ static void yy_reduce( setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 211: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + case 212: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; @@ -2687,13 +2696,13 @@ static void yy_reduce( setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 212: /* cmd ::= KILL CONNECTION IPTOKEN COLON INTEGER */ + case 213: /* cmd ::= KILL CONNECTION IPTOKEN COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSQL(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[-2].minor.yy0);} break; - case 213: /* cmd ::= KILL STREAM IPTOKEN COLON INTEGER COLON INTEGER */ + case 214: /* cmd ::= KILL STREAM IPTOKEN COLON INTEGER COLON INTEGER */ {yymsp[-4].minor.yy0.n += (yymsp[-3].minor.yy0.n + yymsp[-2].minor.yy0.n + yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSQL(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-4].minor.yy0);} break; - case 214: /* cmd ::= KILL QUERY IPTOKEN COLON INTEGER COLON INTEGER */ + case 215: /* cmd ::= KILL QUERY IPTOKEN COLON INTEGER COLON INTEGER */ {yymsp[-4].minor.yy0.n += (yymsp[-3].minor.yy0.n + yymsp[-2].minor.yy0.n + yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSQL(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-4].minor.yy0);} break; default: diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index 5aba5294bf1bed6e571e5d46ad73ce62919fa2f2..d317006e48faef6f05b70c9624e6e14c723abf3a 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -3817,9 +3817,9 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou int16_t *minIndex, int16_t *maxIndex, int32_t *numOfNull) { float fmin = DBL_MAX; float fmax = -DBL_MAX; - float fminIndex = 0; - float fmaxIndex = 0; double dsum = 0; + *minIndex = 0; + *maxIndex = 0; assert(numOfRow <= INT16_MAX); @@ -3830,18 +3830,16 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou } float fv = 0; - *(int32_t*)(&fv) = *(int32_t*)(&(data[i])); - - //*sum += data[i]; + fv = GET_FLOAT_VAL(&(data[i])); dsum += fv; if (fmin > fv) { fmin = fv; - fminIndex = i; + *minIndex = i; } if (fmax < fv) { fmax = fv; - fmaxIndex = i; + *maxIndex = i; } // if (isNull(&lastVal, TSDB_DATA_TYPE_FLOAT)) { @@ -3855,24 +3853,26 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou } double csum = 0; - *(int64_t*)(&csum) = *(int64_t*)sum; + csum = GET_DOUBLE_VAL(sum); csum += dsum; - *(int64_t*)(sum) = *(int64_t*)(&csum); - - *(int32_t*)max = *(int32_t*)(&fmax); - *(int32_t*)min = *(int32_t*)(&fmin); - *(int32_t*)minIndex = *(int32_t*)(&fminIndex); - *(int32_t*)maxIndex = *(int32_t*)(&fmaxIndex); - +#ifdef _TD_ARM_32_ + SET_DOUBLE_VAL_ALIGN(sum, &csum); + SET_DOUBLE_VAL_ALIGN(max, &fmax); + SET_DOUBLE_VAL_ALIGN(min, &fmin); +#else + *sum = csum; + *max = fmax; + *min = fmin; +#endif } static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, double *min, double *max, double *sum, int16_t *minIndex, int16_t *maxIndex, int32_t *numOfNull) { double dmin = DBL_MAX; double dmax = -DBL_MAX; - double dminIndex = 0; - double dmaxIndex = 0; double dsum = 0; + *minIndex = 0; + *maxIndex = 0; assert(numOfRow <= INT16_MAX); @@ -3883,18 +3883,16 @@ static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, do } double dv = 0; - *(int64_t*)(&dv) = *(int64_t*)(&(data[i])); - - //*sum += data[i]; + dv = GET_DOUBLE_VAL(&(data[i])); dsum += dv; if (dmin > dv) { dmin = dv; - dminIndex = i; + *minIndex = i; } if (dmax < dv) { dmax = dv; - dmaxIndex = i; + *maxIndex = i; } // if (isNull(&lastVal, TSDB_DATA_TYPE_DOUBLE)) { @@ -3908,14 +3906,19 @@ static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, do } double csum = 0; - *(int64_t*)(&csum) = *(int64_t*)sum; + csum = GET_DOUBLE_VAL(sum); csum += dsum; - *(int64_t*)(sum) = *(int64_t*)(&csum); - *(int64_t*)max = *(int64_t*)(&dmax); - *(int64_t*)min = *(int64_t*)(&dmin); - *(int64_t*)minIndex = *(int64_t*)(&dminIndex); - *(int64_t*)maxIndex = *(int64_t*)(&dmaxIndex); + +#ifdef _TD_ARM_32_ + SET_DOUBLE_VAL_ALIGN(sum, &csum); + SET_DOUBLE_VAL_ALIGN(max, &dmax); + SET_DOUBLE_VAL_ALIGN(min, &dmin); +#else + *sum = csum; + *max = dmax; + *min = dmin; +#endif } void getStatistics(char *priData, char *data, int32_t size, int32_t numOfRow, int32_t type, int64_t *min, int64_t *max, diff --git a/src/client/src/tscLocal.c b/src/client/src/tscLocal.c index 4d5a5421235067334d2891aa9b440d365e979773..068745859942c8b55dc00c3687e5a12b509e079c 100644 --- a/src/client/src/tscLocal.c +++ b/src/client/src/tscLocal.c @@ -39,25 +39,17 @@ static int32_t getToStringLength(const char *pData, int32_t length, int32_t type case TSDB_DATA_TYPE_NCHAR: return length; case TSDB_DATA_TYPE_DOUBLE: { -#ifdef _TD_ARM_32_ double dv = 0; - *(int64_t *)(&dv) = *(int64_t *)pData; - len = sprintf(buf, "%f", dv); -#else - len = sprintf(buf, "%lf", *(double *)pData); -#endif + dv = GET_DOUBLE_VAL(pData); + len = sprintf(buf, "%lf", dv); if (strncasecmp("nan", buf, 3) == 0) { len = 4; } } break; case TSDB_DATA_TYPE_FLOAT: { -#ifdef _TD_ARM_32_ float fv = 0; - *(int32_t *)(&fv) = *(int32_t *)pData; + fv = GET_FLOAT_VAL(pData); len = sprintf(buf, "%f", fv); -#else - len = sprintf(buf, "%f", *(float *)pData); -#endif if (strncasecmp("nan", buf, 3) == 0) { len = 4; } @@ -202,22 +194,14 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) { taosUcs4ToMbs(pTagValue, pSchema[i].bytes, target); break; case TSDB_DATA_TYPE_FLOAT: { -#ifdef _TD_ARM_32_ float fv = 0; - *(int32_t *)(&fv) = *(int32_t *)pTagValue; + fv = GET_FLOAT_VAL(pTagValue); sprintf(target, "%f", fv); -#else - sprintf(target, "%f", *(float *)pTagValue); -#endif } break; case TSDB_DATA_TYPE_DOUBLE: { -#ifdef _TD_ARM_32_ double dv = 0; - *(int64_t *)(&dv) = *(int64_t *)pTagValue; + dv = GET_DOUBLE_VAL(pTagValue); sprintf(target, "%lf", dv); -#else - sprintf(target, "%lf", *(double *)pTagValue); -#endif } break; case TSDB_DATA_TYPE_TINYINT: sprintf(target, "%d", *(int8_t *)pTagValue); diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index c5d5e488f77456005384a106469aabf362316cbe..7af27aa386e76322e90a70d04e8a656a192b6a8e 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -36,7 +36,7 @@ enum { TSDB_USE_CLI_TS = 1, }; -static int32_t tscAllocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize); +static int32_t tscAllocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize, int32_t * numOfRows); static int32_t tscToInteger(SSQLToken *pToken, int64_t *value, char **endPtr) { int32_t numType = isValidNumber(pToken); @@ -309,6 +309,10 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload, } strncpy(payload, pToken->z, pToken->n); + + if (pToken->n < pSchema->bytes) { + payload[pToken->n] = 0; // add the null-terminated char if the length of the string is shorter than the available space + } } break; @@ -515,14 +519,16 @@ int tsParseValues(char **str, STableDataBlocks *pDataBlock, SMeterMeta *pMeterMe *str += index; if (numOfRows >= maxRows || pDataBlock->size + pMeterMeta->rowSize >= pDataBlock->nAllocSize) { - int32_t tSize = tscAllocateMemIfNeed(pDataBlock, pMeterMeta->rowSize); - if (0 == tSize) { // TODO pass the correct error code to client + int32_t tSize; + int32_t retcode = tscAllocateMemIfNeed(pDataBlock, pMeterMeta->rowSize, &tSize); + if (retcode != TSDB_CODE_SUCCESS) { //TODO pass the correct error code to client strcpy(error, "client out of memory"); - *code = TSDB_CODE_CLI_OUT_OF_MEMORY; + *code = retcode; return -1; } - - maxRows += tSize; + + assert(tSize > maxRows); + maxRows = tSize; } int32_t len = tsParseOneRowData(str, pDataBlock, pSchema, spd, error, precision, code, tmpTokenBuf); @@ -567,7 +573,7 @@ static void tscSetAssignedColumnInfo(SParsedDataColInfo *spd, SSchema *pSchema, } } -int32_t tscAllocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize) { +int32_t tscAllocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize, int32_t * numOfRows) { size_t remain = pDataBlock->nAllocSize - pDataBlock->size; const int factor = 5; uint32_t nAllocSizeOld = pDataBlock->nAllocSize; @@ -587,11 +593,13 @@ int32_t tscAllocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize) { // assert(false); // do nothing pDataBlock->nAllocSize = nAllocSizeOld; - return 0; + *numOfRows = (int32_t)(pDataBlock->nAllocSize) / rowSize; + return TSDB_CODE_CLI_OUT_OF_MEMORY; } } - return (int32_t)(pDataBlock->nAllocSize - pDataBlock->size) / rowSize; + *numOfRows = (int32_t)(pDataBlock->nAllocSize) / rowSize; + return TSDB_CODE_SUCCESS; } static void tsSetBlockInfo(SShellSubmitBlock *pBlocks, const SMeterMeta *pMeterMeta, int32_t numOfRows) { @@ -657,9 +665,10 @@ static int32_t doParseInsertStatement(SSqlObj *pSql, void *pTableHashList, char if (ret != TSDB_CODE_SUCCESS) { return ret; } - - int32_t maxNumOfRows = tscAllocateMemIfNeed(dataBuf, pMeterMeta->rowSize); - if (0 == maxNumOfRows) { + + int32_t maxNumOfRows; + ret = tscAllocateMemIfNeed(dataBuf, pMeterMeta->rowSize, &maxNumOfRows); + if (TSDB_CODE_SUCCESS != ret) { return TSDB_CODE_CLI_OUT_OF_MEMORY; } @@ -987,6 +996,9 @@ int doParseInsertSql(SSqlObj *pSql, char *str) { return code; } + ASSERT(((NULL == pSql->asyncTblPos) && (NULL == pSql->pTableHashList)) + || ((NULL != pSql->asyncTblPos) && (NULL != pSql->pTableHashList))); + if ((NULL == pSql->asyncTblPos) && (NULL == pSql->pTableHashList)) { pSql->pTableHashList = taosInitHashTable(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false); @@ -996,6 +1008,7 @@ int doParseInsertSql(SSqlObj *pSql, char *str) { goto _error_clean; } } else { + ASSERT((NULL != pSql->asyncTblPos) && (NULL != pSql->pTableHashList)); str = pSql->asyncTblPos; } @@ -1048,10 +1061,16 @@ int doParseInsertSql(SSqlObj *pSql, char *str) { * interrupted position. */ if (fp != NULL) { - return code; - } else { - goto _error_clean; + if (TSDB_CODE_ACTION_IN_PROGRESS == code) { + tscTrace("async insert and waiting to get meter meta, then continue parse sql: %s", pSql->asyncTblPos); + return code; + } + + tscTrace("async insert parse error, code:%d, %s", code, tsError[code]); + pSql->asyncTblPos = NULL; } + + goto _error_clean; // TODO: should _clean or _error_clean to async flow ???? } if (UTIL_METER_IS_SUPERTABLE(pMeterMetaInfo)) { @@ -1281,6 +1300,7 @@ int tsParseSql(SSqlObj *pSql, bool multiVnodeInsertion) { } else { tscTrace("continue parse sql: %s", pSql->asyncTblPos); } + if (tscIsInsertOrImportData(pSql->sqlstr)) { /* @@ -1350,7 +1370,7 @@ static int tscInsertDataFromFile(SSqlObj *pSql, FILE *fp, char *tmpTokenBuf) { char * line = NULL; size_t n = 0; int len = 0; - uint32_t maxRows = 0; + int32_t maxRows = 0; SSqlCmd * pCmd = &pSql->cmd; int numOfRows = 0; int32_t code = 0; @@ -1369,8 +1389,8 @@ static int tscInsertDataFromFile(SSqlObj *pSql, FILE *fp, char *tmpTokenBuf) { tscAppendDataBlock(pCmd->pDataBlocks, pTableDataBlock); - maxRows = tscAllocateMemIfNeed(pTableDataBlock, rowSize); - if (maxRows < 1) return -1; + code = tscAllocateMemIfNeed(pTableDataBlock, rowSize, &maxRows); + if (TSDB_CODE_SUCCESS != code) return -1; int count = 0; SParsedDataColInfo spd = {.numOfCols = pMeterMeta->numOfColumns}; @@ -1385,15 +1405,8 @@ static int tscInsertDataFromFile(SSqlObj *pSql, FILE *fp, char *tmpTokenBuf) { char *lineptr = line; strtolower(line, line); - - if (numOfRows >= maxRows || pTableDataBlock->size + rowSize >= pTableDataBlock->nAllocSize) { - uint32_t tSize = tscAllocateMemIfNeed(pTableDataBlock, rowSize); - if (0 == tSize) return (-TSDB_CODE_CLI_OUT_OF_MEMORY); - maxRows += tSize; - } - - len = tsParseOneRowData(&lineptr, pTableDataBlock, pSchema, &spd, pCmd->payload, pMeterMeta->precision, &code, - tmpTokenBuf); + + len = tsParseOneRowData(&lineptr, pTableDataBlock, pSchema, &spd, pCmd->payload, pMeterMeta->precision, &code, tmpTokenBuf); if (len <= 0 || pTableDataBlock->numOfParams > 0) { pSql->res.code = code; return (-code); diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index 14a8778ba32371e8fd9ab0452305449c01d4702b..51c43fd3f798f36bcf3ca4a8760abe39a7f149af 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -121,11 +121,11 @@ static int normalStmtBindParam(STscStmt* stmt, TAOS_BIND* bind) { break; case TSDB_DATA_TYPE_FLOAT: - var->dKey = *(float*)tb->buffer; + var->dKey = GET_FLOAT_VAL(tb->buffer); break; case TSDB_DATA_TYPE_DOUBLE: - var->dKey = *(double*)tb->buffer; + var->dKey = GET_DOUBLE_VAL(tb->buffer); break; case TSDB_DATA_TYPE_BINARY: diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index d042effb9327d30372ffadbc8107409f9909e8f8..f6ef076b2776732326b27dbd12a023be7712123f 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -1698,7 +1698,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIdx, tSQLExprIt if (optr == TK_PERCENTILE || optr == TK_APERCENTILE) { tVariantDump(pVariant, val, TSDB_DATA_TYPE_DOUBLE); - double dp = *((double*)val); + double dp = GET_DOUBLE_VAL(val); if (dp < 0 || dp > TOP_BOTTOM_QUERY_LIMIT) { return invalidSqlErrMsg(pQueryInfo->msg, msg5); } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 7b5e800100b83a097b47912f72a7b3be9aa75c17..358c7d4692062562930af9297b194b125fde990b 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -188,7 +188,7 @@ void tscGetConnToMgmt(SSqlObj *pSql, uint8_t *pCode) { #ifdef CLUSTER connInit.peerIp = tscMgmtIpList.ipstr[pSql->index]; #else - connInit.peerIp = tsServerIpStr; + connInit.peerIp = tsMasterIp; #endif thandle = taosOpenRpcConn(&connInit, pCode); } @@ -296,7 +296,7 @@ void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) { connInit.peerId = htonl((pVPeersDesc[0].vnode << TSDB_SHELL_VNODE_BITS)); connInit.shandle = pVnodeConn; connInit.ahandle = pSql; - connInit.peerIp = tsServerIpStr; + connInit.peerIp = tsMasterIp; connInit.peerPort = tsVnodeShellPort; thandle = taosOpenRpcConn(&connInit, pCode); vidIndex = (vidIndex + 1) % tscNumOfThreads; @@ -485,8 +485,19 @@ void *tscProcessMsgFromServer(char *msg, void *ahandle, void *thandle) { if (code == 0) return pSql; msg = NULL; } else if (rspCode == TSDB_CODE_NOT_ACTIVE_TABLE || rspCode == TSDB_CODE_INVALID_TABLE_ID || - rspCode == TSDB_CODE_NOT_ACTIVE_VNODE || rspCode == TSDB_CODE_INVALID_VNODE_ID || - rspCode == TSDB_CODE_TABLE_ID_MISMATCH || rspCode == TSDB_CODE_NETWORK_UNAVAIL) { + rspCode == TSDB_CODE_INVALID_VNODE_ID || rspCode == TSDB_CODE_NOT_ACTIVE_VNODE || + rspCode == TSDB_CODE_NETWORK_UNAVAIL || rspCode == TSDB_CODE_NOT_ACTIVE_SESSION || + rspCode == TSDB_CODE_TABLE_ID_MISMATCH) { + /* + * not_active_table: 1. the virtual node may fail to create table, since the procedure of create table is asynchronized, + * the virtual node may have not create table till now, so try again by using the new metermeta. + * 2. this requested table may have been removed by other client, so we need to renew the + * metermeta here. + * + * not_active_vnode: current vnode is move to other node due to node balance procedure or virtual node have been + * removed. So, renew metermeta and try again. + * not_active_session: db has been move to other node, the vnode does not exist on this dnode anymore. + */ #else if (rspCode == TSDB_CODE_NOT_ACTIVE_TABLE || rspCode == TSDB_CODE_INVALID_TABLE_ID || rspCode == TSDB_CODE_NOT_ACTIVE_VNODE || rspCode == TSDB_CODE_INVALID_VNODE_ID || @@ -881,28 +892,26 @@ int tscProcessSql(SSqlObj *pSql) { return doProcessSql(pSql); } -static void doCleanupSubqueries(SSqlObj *pSql, int32_t vnodeIndex, int32_t numOfVnodes, SRetrieveSupport *pTrs, - tOrderDescriptor *pDesc, tColModel *pModel, tExtMemBuffer **pMemoryBuf, - SSubqueryState *pState) { - pSql->cmd.command = TSDB_SQL_RETRIEVE_METRIC; - pSql->res.code = TSDB_CODE_CLI_OUT_OF_MEMORY; - - /* - * if i > 0, at least one sub query is issued, the allocated resource is - * freed by it when subquery completed. - */ - if (vnodeIndex == 0) { - tscLocalReducerEnvDestroy(pMemoryBuf, pDesc, pModel, numOfVnodes); - tfree(pState); - - if (pTrs != NULL) { - tfree(pTrs->localBuffer); - - pthread_mutex_unlock(&pTrs->queryMutex); - pthread_mutex_destroy(&pTrs->queryMutex); - tfree(pTrs); - } +static void doCleanupSubqueries(SSqlObj *pSql, int32_t numOfSubs, SSubqueryState* pState) { + assert(numOfSubs <= pSql->numOfSubs && numOfSubs >= 0 && pState != NULL); + + for(int32_t i = 0; i < numOfSubs; ++i) { + SSqlObj* pSub = pSql->pSubs[i]; + assert(pSub != NULL); + + SRetrieveSupport* pSupport = pSub->param; + + tfree(pSupport->localBuffer); + + pthread_mutex_unlock(&pSupport->queryMutex); + pthread_mutex_destroy(&pSupport->queryMutex); + + tfree(pSupport); + + tscFreeSqlObj(pSub); } + + free(pState); } int tscLaunchMetricSubQueries(SSqlObj *pSql) { @@ -925,8 +934,8 @@ int tscLaunchMetricSubQueries(SSqlObj *pSql) { SQueryInfo * pQueryInfo = tscGetQueryInfoDetail(pCmd, 0); SMeterMetaInfo *pMeterMetaInfo = tscGetMeterMetaInfoFromQueryInfo(pQueryInfo, 0); - int32_t numOfVnodes = pMeterMetaInfo->pMetricMeta->numOfVnodes; - assert(numOfVnodes > 0); + int32_t numOfSubQueries = pMeterMetaInfo->pMetricMeta->numOfVnodes; + assert(numOfSubQueries > 0); int32_t ret = tscLocalReducerEnvCreate(pSql, &pMemoryBuf, &pDesc, &pModel, nBufferSize); if (ret != 0) { @@ -937,36 +946,33 @@ int tscLaunchMetricSubQueries(SSqlObj *pSql) { return pRes->code; } - pSql->pSubs = malloc(POINTER_BYTES * numOfVnodes); - pSql->numOfSubs = numOfVnodes; + pSql->pSubs = calloc(numOfSubQueries, POINTER_BYTES); + pSql->numOfSubs = numOfSubQueries; - tscTrace("%p retrieved query data from %d vnode(s)", pSql, numOfVnodes); + tscTrace("%p retrieved query data from %d vnode(s)", pSql, numOfSubQueries); SSubqueryState *pState = calloc(1, sizeof(SSubqueryState)); - pState->numOfTotal = numOfVnodes; + pState->numOfTotal = numOfSubQueries; pRes->code = TSDB_CODE_SUCCESS; - for (int32_t i = 0; i < numOfVnodes; ++i) { - if (pRes->code == TSDB_CODE_QUERY_CANCELLED || pRes->code == TSDB_CODE_CLI_OUT_OF_MEMORY) { - /* - * during launch sub queries, if the master query is cancelled. the remain is ignored and set the retrieveDoneRec - * to the value of remaining not built sub-queries. So, the already issued sub queries can successfully free - * allocated resources. - */ - pState->numOfCompleted = (numOfVnodes - i); - doCleanupSubqueries(pSql, i, numOfVnodes, NULL, pDesc, pModel, pMemoryBuf, pState); - - if (i == 0) { - return pSql->res.code; - } - + int32_t i = 0; + for (; i < numOfSubQueries; ++i) { + SRetrieveSupport *trs = (SRetrieveSupport *)calloc(1, sizeof(SRetrieveSupport)); + if (trs == NULL) { + tscError("%p failed to malloc buffer for SRetrieveSupport, orderOfSub:%d, reason:%s", pSql, i, strerror(errno)); break; } - - SRetrieveSupport *trs = (SRetrieveSupport *)calloc(1, sizeof(SRetrieveSupport)); + trs->pExtMemBuffer = pMemoryBuf; trs->pOrderDescriptor = pDesc; trs->pState = pState; + trs->localBuffer = (tFilePage *)calloc(1, nBufferSize + sizeof(tFilePage)); + if (trs->localBuffer == NULL) { + tscError("%p failed to malloc buffer for local buffer, orderOfSub:%d, reason:%s", pSql, i, strerror(errno)); + tfree(trs); + break; + } + trs->subqueryIndex = i; trs->pParentSqlObj = pSql; trs->pFinalColModel = pModel; @@ -977,15 +983,10 @@ int tscLaunchMetricSubQueries(SSqlObj *pSql) { pthread_mutexattr_destroy(&mutexattr); SSqlObj *pNew = tscCreateSqlObjForSubquery(pSql, trs, NULL); - if (pNew == NULL) { - pState->numOfCompleted = (numOfVnodes - i); - doCleanupSubqueries(pSql, i, numOfVnodes, trs, pDesc, pModel, pMemoryBuf, pState); - - if (i == 0) { - return pRes->code; - } - + tscError("%p failed to malloc buffer for subObj, orderOfSub:%d, reason:%s", pSql, i, strerror(errno)); + tfree(trs->localBuffer); + tfree(trs); break; } @@ -994,9 +995,31 @@ int tscLaunchMetricSubQueries(SSqlObj *pSql) { SQueryInfo *pNewQueryInfo = tscGetQueryInfoDetail(&pNew->cmd, 0); pNewQueryInfo->tsBuf = tsBufClone(pQueryInfo->tsBuf); } - - tscTrace("%p sub:%p launch subquery.orderOfSub:%d", pSql, pNew, trs->subqueryIndex); - tscProcessSql(pNew); + + tscTrace("%p sub:%p create subquery success. orderOfSub:%d", pSql, pNew, trs->subqueryIndex); + } + + if (i < numOfSubQueries) { + tscError("%p failed to prepare subquery structure and launch subqueries", pSql); + pRes->code = TSDB_CODE_CLI_OUT_OF_MEMORY; + + tscLocalReducerEnvDestroy(pMemoryBuf, pDesc, pModel, numOfSubQueries); + doCleanupSubqueries(pSql, i, pState); + return pRes->code; // free all allocated resource + } + + if (pRes->code == TSDB_CODE_QUERY_CANCELLED) { + tscLocalReducerEnvDestroy(pMemoryBuf, pDesc, pModel, numOfSubQueries); + doCleanupSubqueries(pSql, i, pState); + return pRes->code; + } + + for(int32_t j = 0; j < numOfSubQueries; ++j) { + SSqlObj* pSub = pSql->pSubs[j]; + SRetrieveSupport* pSupport = pSub->param; + + tscTrace("%p sub:%p launch subquery, orderOfSub:%d.", pSql, pSub, pSupport->subqueryIndex); + tscProcessSql(pSub); } return TSDB_CODE_SUCCESS; @@ -1047,10 +1070,13 @@ static void tscHandleSubRetrievalError(SRetrieveSupport *trsupport, SSqlObj *pSq int32_t subqueryIndex = trsupport->subqueryIndex; assert(pSql != NULL); + SSubqueryState* pState = trsupport->pState; + assert(pState->numOfCompleted < pState->numOfTotal && pState->numOfCompleted >= 0 && + pPObj->numOfSubs == pState->numOfTotal); /* retrieved in subquery failed. OR query cancelled in retrieve phase. */ - if (trsupport->pState->code == TSDB_CODE_SUCCESS && pPObj->res.code != TSDB_CODE_SUCCESS) { - trsupport->pState->code = -(int)pPObj->res.code; + if (pState->code == TSDB_CODE_SUCCESS && pPObj->res.code != TSDB_CODE_SUCCESS) { + pState->code = -(int)pPObj->res.code; /* * kill current sub-query connection, which may retrieve data from vnodes; @@ -1059,15 +1085,15 @@ static void tscHandleSubRetrievalError(SRetrieveSupport *trsupport, SSqlObj *pSq pSql->res.numOfRows = 0; trsupport->numOfRetry = MAX_NUM_OF_SUBQUERY_RETRY; // disable retry efforts tscTrace("%p query is cancelled, sub:%p, orderOfSub:%d abort retrieve, code:%d", trsupport->pParentSqlObj, pSql, - subqueryIndex, trsupport->pState->code); + subqueryIndex, pState->code); } if (numOfRows >= 0) { // current query is successful, but other sub query failed, still abort current query. tscTrace("%p sub:%p retrieve numOfRows:%d,orderOfSub:%d", pPObj, pSql, numOfRows, subqueryIndex); tscError("%p sub:%p abort further retrieval due to other queries failure,orderOfSub:%d,code:%d", pPObj, pSql, - subqueryIndex, trsupport->pState->code); + subqueryIndex, pState->code); } else { - if (trsupport->numOfRetry++ < MAX_NUM_OF_SUBQUERY_RETRY && trsupport->pState->code == TSDB_CODE_SUCCESS) { + if (trsupport->numOfRetry++ < MAX_NUM_OF_SUBQUERY_RETRY && pState->code == TSDB_CODE_SUCCESS) { /* * current query failed, and the retry count is less than the available * count, retry query clear previous retrieved data, then launch a new sub query @@ -1086,7 +1112,7 @@ static void tscHandleSubRetrievalError(SRetrieveSupport *trsupport, SSqlObj *pSq tscError("%p sub:%p failed to create new subquery sqlobj due to out of memory, abort retry", trsupport->pParentSqlObj, pSql); - trsupport->pState->code = TSDB_CODE_CLI_OUT_OF_MEMORY; + pState->code = TSDB_CODE_CLI_OUT_OF_MEMORY; trsupport->numOfRetry = MAX_NUM_OF_SUBQUERY_RETRY; return; } @@ -1094,24 +1120,26 @@ static void tscHandleSubRetrievalError(SRetrieveSupport *trsupport, SSqlObj *pSq tscProcessSql(pNew); return; } else { // reach the maximum retry count, abort - atomic_val_compare_exchange_32(&trsupport->pState->code, TSDB_CODE_SUCCESS, numOfRows); + atomic_val_compare_exchange_32(&pState->code, TSDB_CODE_SUCCESS, numOfRows); tscError("%p sub:%p retrieve failed,code:%d,orderOfSub:%d failed.no more retry,set global code:%d", pPObj, pSql, - numOfRows, subqueryIndex, trsupport->pState->code); + numOfRows, subqueryIndex, pState->code); } } - if (atomic_add_fetch_32(&trsupport->pState->numOfCompleted, 1) < trsupport->pState->numOfTotal) { + int32_t finished = atomic_add_fetch_32(&pState->numOfCompleted, 1); + if (finished < pState->numOfTotal) { + tscTrace("%p sub:%p orderOfSub:%d freed, finished subqueries:%d", pPObj, pSql, trsupport->subqueryIndex, finished); return tscFreeSubSqlObj(trsupport, pSql); } // all subqueries are failed - tscError("%p retrieve from %d vnode(s) completed,code:%d.FAILED.", pPObj, trsupport->pState->numOfTotal, - trsupport->pState->code); - pPObj->res.code = -(trsupport->pState->code); + tscError("%p retrieve from %d vnode(s) completed,code:%d.FAILED.", pPObj, pState->numOfTotal, + pState->code); + pPObj->res.code = -(pState->code); // release allocated resource tscLocalReducerEnvDestroy(trsupport->pExtMemBuffer, trsupport->pOrderDescriptor, trsupport->pFinalColModel, - trsupport->pState->numOfTotal); + pState->numOfTotal); tfree(trsupport->pState); tscFreeSubSqlObj(trsupport, pSql); @@ -1151,10 +1179,14 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) { return; } + SSubqueryState* pState = trsupport->pState; + assert(pState->numOfCompleted < pState->numOfTotal && pState->numOfCompleted >= 0 && + pPObj->numOfSubs == pState->numOfTotal); + // query process and cancel query process may execute at the same time pthread_mutex_lock(&trsupport->queryMutex); - if (numOfRows < 0 || trsupport->pState->code < 0 || pPObj->res.code != TSDB_CODE_SUCCESS) { + if (numOfRows < 0 || pState->code < 0 || pPObj->res.code != TSDB_CODE_SUCCESS) { return tscHandleSubRetrievalError(trsupport, pSql, numOfRows); } @@ -1168,10 +1200,10 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) { if (numOfRows > 0) { assert(pRes->numOfRows == numOfRows); - atomic_add_fetch_64(&trsupport->pState->numOfRetrievedRows, numOfRows); + atomic_add_fetch_64(&pState->numOfRetrievedRows, numOfRows); tscTrace("%p sub:%p retrieve numOfRows:%d totalNumOfRows:%d from ip:%u,vid:%d,orderOfSub:%d", pPObj, pSql, - pRes->numOfRows, trsupport->pState->numOfRetrievedRows, pSvd->ip, pSvd->vnode, idx); + pRes->numOfRows, pState->numOfRetrievedRows, pSvd->ip, pSvd->vnode, idx); #ifdef _DEBUG_VIEW printf("received data from vnode: %d rows\n", pRes->numOfRows); @@ -1229,8 +1261,10 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) { /* set no disk space error info, and abort retry */ return tscAbortFurtherRetryRetrieval(trsupport, tres, TSDB_CODE_CLI_NO_DISKSPACE); } - - if (atomic_add_fetch_32(&trsupport->pState->numOfCompleted, 1) < trsupport->pState->numOfTotal) { + + int32_t finished = atomic_add_fetch_32(&pState->numOfCompleted, 1); + if (finished < pState->numOfTotal) { + tscTrace("%p sub:%p orderOfSub:%d freed, finished subqueries:%d", pPObj, pSql, trsupport->subqueryIndex, finished); return tscFreeSubSqlObj(trsupport, pSql); } @@ -1238,12 +1272,12 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) { pDesc->pSchema->maxCapacity = trsupport->pExtMemBuffer[idx]->numOfElemsPerPage; tscTrace("%p retrieve from %d vnodes completed.final NumOfRows:%d,start to build loser tree", pPObj, - trsupport->pState->numOfTotal, trsupport->pState->numOfCompleted); + pState->numOfTotal, pState->numOfCompleted); SQueryInfo *pPQueryInfo = tscGetQueryInfoDetail(&pPObj->cmd, 0); tscClearInterpInfo(pPQueryInfo); - tscCreateLocalReducer(trsupport->pExtMemBuffer, trsupport->pState->numOfTotal, pDesc, trsupport->pFinalColModel, + tscCreateLocalReducer(trsupport->pExtMemBuffer, pState->numOfTotal, pDesc, trsupport->pFinalColModel, &pPObj->cmd, &pPObj->res); tscTrace("%p build loser tree completed", pPObj); @@ -1252,7 +1286,8 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) { pPObj->res.row = 0; // only free once - free(trsupport->pState); + tfree(trsupport->pState); + tscFreeSubSqlObj(trsupport, pSql); if (pPObj->fp == NULL) { @@ -1346,13 +1381,17 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) { pSvd = &vnodeInfo->vpeerDesc[vnodeInfo->index]; } - if (trsupport->pParentSqlObj->res.code != TSDB_CODE_SUCCESS || trsupport->pState->code != TSDB_CODE_SUCCESS) { + SSubqueryState* pState = trsupport->pState; + assert(pState->numOfCompleted < pState->numOfTotal && pState->numOfCompleted >= 0 && + trsupport->pParentSqlObj->numOfSubs == pState->numOfTotal); + + if (trsupport->pParentSqlObj->res.code != TSDB_CODE_SUCCESS || pState->code != TSDB_CODE_SUCCESS) { // metric query is killed, Note: code must be less than 0 trsupport->numOfRetry = MAX_NUM_OF_SUBQUERY_RETRY; if (trsupport->pParentSqlObj->res.code != TSDB_CODE_SUCCESS) { code = -(int)(trsupport->pParentSqlObj->res.code); } else { - code = trsupport->pState->code; + code = pState->code; } tscTrace("%p query cancelled or failed, sub:%p, orderOfSub:%d abort, code:%d", trsupport->pParentSqlObj, pSql, trsupport->subqueryIndex, code); @@ -1368,7 +1407,7 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) { if (code != TSDB_CODE_SUCCESS) { if (trsupport->numOfRetry++ >= MAX_NUM_OF_SUBQUERY_RETRY) { tscTrace("%p sub:%p reach the max retry count,set global code:%d", trsupport->pParentSqlObj, pSql, code); - atomic_val_compare_exchange_32(&trsupport->pState->code, 0, code); + atomic_val_compare_exchange_32(&pState->code, 0, code); } else { // does not reach the maximum retry count, go on tscTrace("%p sub:%p failed code:%d, retry:%d", trsupport->pParentSqlObj, pSql, code, trsupport->numOfRetry); @@ -1377,7 +1416,7 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) { tscError("%p sub:%p failed to create new subquery due to out of memory, abort retry, vid:%d, orderOfSub:%d", trsupport->pParentSqlObj, pSql, pSvd->vnode, trsupport->subqueryIndex); - trsupport->pState->code = -TSDB_CODE_CLI_OUT_OF_MEMORY; + pState->code = -TSDB_CODE_CLI_OUT_OF_MEMORY; trsupport->numOfRetry = MAX_NUM_OF_SUBQUERY_RETRY; } else { SQueryInfo *pNewQueryInfo = tscGetQueryInfoDetail(&pNew->cmd, 0); @@ -1388,17 +1427,17 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) { } } - if (trsupport->pState->code != TSDB_CODE_SUCCESS) { // failed, abort + if (pState->code != TSDB_CODE_SUCCESS) { // failed, abort if (vnodeInfo != NULL) { tscTrace("%p sub:%p query failed,ip:%u,vid:%d,orderOfSub:%d,global code:%d", trsupport->pParentSqlObj, pSql, vnodeInfo->vpeerDesc[vnodeInfo->index].ip, vnodeInfo->vpeerDesc[vnodeInfo->index].vnode, - trsupport->subqueryIndex, trsupport->pState->code); + trsupport->subqueryIndex, pState->code); } else { tscTrace("%p sub:%p query failed,orderOfSub:%d,global code:%d", trsupport->pParentSqlObj, pSql, - trsupport->subqueryIndex, trsupport->pState->code); + trsupport->subqueryIndex, pState->code); } - tscRetrieveFromVnodeCallBack(param, tres, trsupport->pState->code); + tscRetrieveFromVnodeCallBack(param, tres, pState->code); } else { // success, proceed to retrieve data from dnode tscTrace("%p sub:%p query complete,ip:%u,vid:%d,orderOfSub:%d,retrieve data", trsupport->pParentSqlObj, pSql, vnodeInfo->vpeerDesc[vnodeInfo->index].ip, vnodeInfo->vpeerDesc[vnodeInfo->index].vnode, diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 93a5340818f23d8602097e0758cc974675e16ea6..6aa6cfaf5a996a03921a882b278e80bcaeacd9a1 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -70,8 +70,8 @@ TAOS *taos_connect_imp(const char *ip, const char *user, const char *pass, const } #else if (ip && ip[0]) { - if (ip != tsServerIpStr) { - strcpy(tsServerIpStr, ip); + if (ip != tsMasterIp) { + strcpy(tsMasterIp, ip); } tsServerIp = inet_addr(ip); } @@ -152,11 +152,7 @@ TAOS *taos_connect_imp(const char *ip, const char *user, const char *pass, const TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port) { if (ip == NULL || (ip != NULL && (strcmp("127.0.0.1", ip) == 0 || strcasecmp("localhost", ip) == 0))) { -#ifdef CLUSTER ip = tsMasterIp; -#else - ip = tsServerIpStr; -#endif } tscTrace("try to create a connection to %s", ip); @@ -180,7 +176,7 @@ TAOS *taos_connect_a(char *ip, char *user, char *pass, char *db, uint16_t port, void *param, void **taos) { #ifndef CLUSTER if (ip == NULL) { - ip = tsServerIpStr; + ip = tsMasterIp; } #endif return taos_connect_imp(ip, user, pass, db, port, fp, param, taos); @@ -613,9 +609,6 @@ TAOS_ROW taos_fetch_row(TAOS_RES *res) { TAOS_ROW rows = taos_fetch_row_impl(res); SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0); - if (rows == NULL) { - int32_t k = 1; - } while (rows == NULL && tscProjectionQueryOnSTable(pCmd, 0)) { SMeterMetaInfo *pMeterMetaInfo = tscGetMeterMetaInfoFromQueryInfo(pQueryInfo, 0); @@ -918,12 +911,18 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields) len += sprintf(str + len, "%" PRId64 " ", *((int64_t *)row[i])); break; - case TSDB_DATA_TYPE_FLOAT: - len += sprintf(str + len, "%f ", *((float *)row[i])); + case TSDB_DATA_TYPE_FLOAT: { + float fv = 0; + fv = GET_FLOAT_VAL(row[i]); + len += sprintf(str + len, "%f ", fv); + } break; - case TSDB_DATA_TYPE_DOUBLE: - len += sprintf(str + len, "%lf ", *((double *)row[i])); + case TSDB_DATA_TYPE_DOUBLE:{ + double dv = 0; + dv = GET_DOUBLE_VAL(row[i]); + len += sprintf(str + len, "%lf ", dv); + } break; case TSDB_DATA_TYPE_BINARY: diff --git a/src/connector/grafana/tdengine/dist/datasource.js b/src/connector/grafana/tdengine/dist/datasource.js index 160ba78948100a03332ee1987237381ab3e05d4a..8190394f9304dfc809b9c6c14dfcb1853fb15a72 100644 --- a/src/connector/grafana/tdengine/dist/datasource.js +++ b/src/connector/grafana/tdengine/dist/datasource.js @@ -71,7 +71,7 @@ var GenericDatasource = exports.GenericDatasource = function () { var targets = _lodash2.default.map(options.targets, function (target) { return { refId: target.refId, - alias: target.alias || "", + alias: _this.generateAlias(options, target), sql: _this.generateSql(options, target) }; }); @@ -112,6 +112,13 @@ var GenericDatasource = exports.GenericDatasource = function () { return "Basic " + this.encode(defaultUser + ":" + defaultPassword); } + }, { + key: 'generateAlias', + value: function generateAlias(options, target) { + var alias = target.alias || ""; + alias = this.templateSrv.replace(alias, options.scopedVars, 'csv'); + return alias; + } }, { key: 'generateSql', value: function generateSql(options, target) { diff --git a/src/connector/grafana/tdengine/dist/datasource.js.map b/src/connector/grafana/tdengine/dist/datasource.js.map index 092db743f47a0a414ba0c937ef3f3467335e8491..0065a5ae0e536992c9c19490b785daf6873a5407 100644 --- a/src/connector/grafana/tdengine/dist/datasource.js.map +++ b/src/connector/grafana/tdengine/dist/datasource.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/datasource.js"],"names":["GenericDatasource","instanceSettings","$q","backendSrv","templateSrv","type","url","name","q","headers","Authorization","getAuthorization","jsonData","options","targets","buildQueryParameters","length","when","data","doRequest","method","then","response","status","message","title","datasourceRequest","_","map","refId","target","alias","sql","generateSql","input","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","i","charCodeAt","isNaN","charAt","defaultUser","user","defaultPassword","password","encode","queryStart","range","from","toISOString","queryEnd","to","intervalMs","replace","scopedVars"],"mappings":";;;;;;;;;AAAA;;;;;;;;IAEaA,iB,WAAAA,iB;AAEX,6BAAYC,gBAAZ,EAA8BC,EAA9B,EAAkCC,UAAlC,EAA8CC,WAA9C,EAA2D;AAAA;;AACzD,SAAKC,IAAL,GAAYJ,iBAAiBI,IAA7B;AACA,SAAKC,GAAL,GAAWL,iBAAiBK,GAA5B;AACA,SAAKC,IAAL,GAAYN,iBAAiBM,IAA7B;AACA,SAAKC,CAAL,GAASN,EAAT;AACA,SAAKC,UAAL,GAAkBA,UAAlB;AACA,SAAKC,WAAL,GAAmBA,WAAnB;AACA,SAAKK,OAAL,GAAe,EAAC,gBAAgB,kBAAjB,EAAf;AACA,SAAKA,OAAL,CAAaC,aAAb,GAA6B,KAAKC,gBAAL,CAAsBV,iBAAiBW,QAAvC,CAA7B;AACD;;;;0BAEKC,O,EAAS;AACb,UAAIC,UAAU,KAAKC,oBAAL,CAA0BF,OAA1B,CAAd;;AAEA,UAAIC,QAAQE,MAAR,IAAkB,CAAtB,EAAyB;AACvB,eAAO,KAAKR,CAAL,CAAOS,IAAP,CAAY,EAACC,MAAM,EAAP,EAAZ,CAAP;AACD;;AAED,aAAO,KAAKC,SAAL,CAAe;AACpBb,aAAK,KAAKA,GAAL,GAAW,gBADI;AAEpBY,cAAMJ,OAFc;AAGpBM,gBAAQ;AAHY,OAAf,CAAP;AAKD;;;qCAEgB;AACf,aAAO,KAAKD,SAAL,CAAe;AACpBb,aAAK,KAAKA,GAAL,GAAW,oBADI;AAEpBc,gBAAQ;AAFY,OAAf,EAGJC,IAHI,CAGC,oBAAY;AAClB,YAAIC,SAASC,MAAT,KAAoB,GAAxB,EAA6B;AAC3B,iBAAO,EAAEA,QAAQ,SAAV,EAAqBC,SAAS,iCAA9B,EAAiEC,OAAO,SAAxE,EAAP;AACD;AACF,OAPM,CAAP;AAQD;;;8BAESZ,O,EAAS;AACjBA,cAAQJ,OAAR,GAAkB,KAAKA,OAAvB;;AAEA,aAAO,KAAKN,UAAL,CAAgBuB,iBAAhB,CAAkCb,OAAlC,CAAP;AACD;;;yCAEoBA,O,EAAS;AAAA;;AAE5B,UAAIC,UAAUa,iBAAEC,GAAF,CAAMf,QAAQC,OAAd,EAAuB,kBAAU;AAC7C,eAAO;AACLe,iBAAOC,OAAOD,KADT;AAELE,iBAAOD,OAAOC,KAAP,IAAgB,EAFlB;AAGLC,eAAK,MAAKC,WAAL,CAAiBpB,OAAjB,EAA0BiB,MAA1B;AAHA,SAAP;AAKD,OANa,CAAd;;AAQA,aAAOhB,OAAP;AACD;;;2BAEMoB,K,EAAO;AACZ,UAAIC,UAAU,mEAAd;AACA,UAAIC,SAAS,EAAb;AACA,UAAIC,IAAJ,EAAUC,IAAV,EAAgBC,IAAhB,EAAsBC,IAAtB,EAA4BC,IAA5B,EAAkCC,IAAlC,EAAwCC,IAAxC;AACA,UAAIC,IAAI,CAAR;AACA,aAAOA,IAAIV,MAAMlB,MAAjB,EAAyB;AACvBqB,eAAOH,MAAMW,UAAN,CAAiBD,GAAjB,CAAP;AACAN,eAAOJ,MAAMW,UAAN,CAAiBD,GAAjB,CAAP;AACAL,eAAOL,MAAMW,UAAN,CAAiBD,GAAjB,CAAP;AACAJ,eAAOH,QAAQ,CAAf;AACAI,eAAQ,CAACJ,OAAO,CAAR,KAAc,CAAf,GAAqBC,QAAQ,CAApC;AACAI,eAAQ,CAACJ,OAAO,EAAR,KAAe,CAAhB,GAAsBC,QAAQ,CAArC;AACAI,eAAOJ,OAAO,EAAd;AACA,YAAIO,MAAMR,IAAN,CAAJ,EAAiB;AACfI,iBAAOC,OAAO,EAAd;AACD,SAFD,MAEO,IAAIG,MAAMP,IAAN,CAAJ,EAAiB;AACtBI,iBAAO,EAAP;AACD;AACDP,iBAASA,SAASD,QAAQY,MAAR,CAAeP,IAAf,CAAT,GAAgCL,QAAQY,MAAR,CAAeN,IAAf,CAAhC,GAAuDN,QAAQY,MAAR,CAAeL,IAAf,CAAvD,GAA8EP,QAAQY,MAAR,CAAeJ,IAAf,CAAvF;AACD;;AAED,aAAOP,MAAP;AACD;;;qCAEgBxB,Q,EAAS;AACxBA,iBAAWA,YAAY,EAAvB;AACA,UAAIoC,cAAcpC,SAASqC,IAAT,IAAiB,MAAnC;AACA,UAAIC,kBAAkBtC,SAASuC,QAAT,IAAqB,UAA3C;;AAEA,aAAO,WAAW,KAAKC,MAAL,CAAYJ,cAAc,GAAd,GAAoBE,eAAhC,CAAlB;AACD;;;gCAEWrC,O,EAASiB,M,EAAQ;AAC3B,UAAIE,MAAMF,OAAOE,GAAjB;AACA,UAAIA,OAAO,IAAP,IAAeA,OAAO,EAA1B,EAA6B;AAC3B,eAAOA,GAAP;AACD;;AAED,UAAIqB,aAAa,QAAjB;AACA,UAAIxC,WAAW,IAAX,IAAmBA,QAAQyC,KAAR,IAAiB,IAApC,IAA4CzC,QAAQyC,KAAR,CAAcC,IAAd,IAAsB,IAAtE,EAA2E;AACzEF,qBAAaxC,QAAQyC,KAAR,CAAcC,IAAd,CAAmBC,WAAnB,EAAb;AACD;;AAED,UAAIC,WAAW,KAAf;AACA,UAAI5C,WAAW,IAAX,IAAmBA,QAAQyC,KAAR,IAAiB,IAApC,IAA4CzC,QAAQyC,KAAR,CAAcI,EAAd,IAAoB,IAApE,EAAyE;AACvED,mBAAW5C,QAAQyC,KAAR,CAAcI,EAAd,CAAiBF,WAAjB,EAAX;AACD;AACD,UAAIG,aAAa9C,QAAQ8C,UAAR,IAAsB,OAAvC;;AAEAA,oBAAc,GAAd;AACA3B,YAAMA,IAAI4B,OAAJ,CAAY,aAAZ,EAA2B,EAA3B,CAAN;AACA5B,YAAMA,IAAI4B,OAAJ,CAAY,OAAZ,EAAqB,MAAMP,UAAN,GAAmB,GAAxC,CAAN;AACArB,YAAMA,IAAI4B,OAAJ,CAAY,QAAZ,EAAsB,MAAMP,UAAN,GAAmB,GAAzC,CAAN;AACArB,YAAMA,IAAI4B,OAAJ,CAAY,KAAZ,EAAmB,MAAMH,QAAN,GAAiB,GAApC,CAAN;AACAzB,YAAMA,IAAI4B,OAAJ,CAAY,MAAZ,EAAoB,MAAMH,QAAN,GAAiB,GAArC,CAAN;AACAzB,YAAMA,IAAI4B,OAAJ,CAAY,WAAZ,EAAyBD,UAAzB,CAAN;;AAEA3B,YAAM,KAAK5B,WAAL,CAAiBwD,OAAjB,CAAyB5B,GAAzB,EAA8BnB,QAAQgD,UAAtC,EAAkD,KAAlD,CAAN;AACA,aAAO7B,GAAP;AACD","file":"datasource.js","sourcesContent":["import _ from \"lodash\";\n\nexport class GenericDatasource {\n\n constructor(instanceSettings, $q, backendSrv, templateSrv) {\n this.type = instanceSettings.type;\n this.url = instanceSettings.url;\n this.name = instanceSettings.name;\n this.q = $q;\n this.backendSrv = backendSrv;\n this.templateSrv = templateSrv;\n this.headers = {'Content-Type': 'application/json'};\n this.headers.Authorization = this.getAuthorization(instanceSettings.jsonData);\n }\n\n query(options) {\n var targets = this.buildQueryParameters(options);\n\n if (targets.length <= 0) {\n return this.q.when({data: []});\n }\n\n return this.doRequest({\n url: this.url + '/grafana/query',\n data: targets,\n method: 'POST'\n });\n }\n\n testDatasource() {\n return this.doRequest({\n url: this.url + '/grafana/heartbeat',\n method: 'GET',\n }).then(response => {\n if (response.status === 200) {\n return { status: \"success\", message: \"TDengine Data source is working\", title: \"Success\" };\n }\n });\n }\n\n doRequest(options) {\n options.headers = this.headers;\n\n return this.backendSrv.datasourceRequest(options);\n }\n\n buildQueryParameters(options) {\n\n var targets = _.map(options.targets, target => {\n return {\n refId: target.refId,\n alias: target.alias || \"\",\n sql: this.generateSql(options, target)\n };\n });\n\n return targets;\n }\n\n encode(input) {\n var _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var output = \"\";\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n while (i < input.length) {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n }\n\n return output;\n }\n\n getAuthorization(jsonData){\n jsonData = jsonData || {};\n var defaultUser = jsonData.user || \"root\";\n var defaultPassword = jsonData.password || \"taosdata\";\n\n return \"Basic \" + this.encode(defaultUser + \":\" + defaultPassword);\n }\n\n generateSql(options, target) {\n var sql = target.sql;\n if (sql == null || sql == \"\"){\n return sql;\n }\n\n var queryStart = \"now-1h\";\n if (options != null && options.range != null && options.range.from != null){\n queryStart = options.range.from.toISOString();\n }\n\n var queryEnd = \"now\";\n if (options != null && options.range != null && options.range.to != null){\n queryEnd = options.range.to.toISOString();\n }\n var intervalMs = options.intervalMs || \"20000\";\n\n intervalMs += \"a\";\n sql = sql.replace(/^\\s+|\\s+$/gm, '');\n sql = sql.replace(\"$from\", \"'\" + queryStart + \"'\");\n sql = sql.replace(\"$begin\", \"'\" + queryStart + \"'\");\n sql = sql.replace(\"$to\", \"'\" + queryEnd + \"'\");\n sql = sql.replace(\"$end\", \"'\" + queryEnd + \"'\");\n sql = sql.replace(\"$interval\", intervalMs);\n\n sql = this.templateSrv.replace(sql, options.scopedVars, 'csv');\n return sql;\n }\n\n}"]} \ No newline at end of file +{"version":3,"sources":["../src/datasource.js"],"names":["GenericDatasource","instanceSettings","$q","backendSrv","templateSrv","type","url","name","q","headers","Authorization","getAuthorization","jsonData","options","targets","buildQueryParameters","length","when","data","doRequest","method","then","response","status","message","title","datasourceRequest","_","map","refId","target","alias","generateAlias","sql","generateSql","input","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","i","charCodeAt","isNaN","charAt","defaultUser","user","defaultPassword","password","encode","replace","scopedVars","queryStart","range","from","toISOString","queryEnd","to","intervalMs"],"mappings":";;;;;;;;;AAAA;;;;;;;;IAEaA,iB,WAAAA,iB;AAEX,6BAAYC,gBAAZ,EAA8BC,EAA9B,EAAkCC,UAAlC,EAA8CC,WAA9C,EAA2D;AAAA;;AACzD,SAAKC,IAAL,GAAYJ,iBAAiBI,IAA7B;AACA,SAAKC,GAAL,GAAWL,iBAAiBK,GAA5B;AACA,SAAKC,IAAL,GAAYN,iBAAiBM,IAA7B;AACA,SAAKC,CAAL,GAASN,EAAT;AACA,SAAKC,UAAL,GAAkBA,UAAlB;AACA,SAAKC,WAAL,GAAmBA,WAAnB;AACA,SAAKK,OAAL,GAAe,EAAC,gBAAgB,kBAAjB,EAAf;AACA,SAAKA,OAAL,CAAaC,aAAb,GAA6B,KAAKC,gBAAL,CAAsBV,iBAAiBW,QAAvC,CAA7B;AACD;;;;0BAEKC,O,EAAS;AACb,UAAIC,UAAU,KAAKC,oBAAL,CAA0BF,OAA1B,CAAd;;AAEA,UAAIC,QAAQE,MAAR,IAAkB,CAAtB,EAAyB;AACvB,eAAO,KAAKR,CAAL,CAAOS,IAAP,CAAY,EAACC,MAAM,EAAP,EAAZ,CAAP;AACD;;AAED,aAAO,KAAKC,SAAL,CAAe;AACpBb,aAAK,KAAKA,GAAL,GAAW,gBADI;AAEpBY,cAAMJ,OAFc;AAGpBM,gBAAQ;AAHY,OAAf,CAAP;AAKD;;;qCAEgB;AACf,aAAO,KAAKD,SAAL,CAAe;AACpBb,aAAK,KAAKA,GAAL,GAAW,oBADI;AAEpBc,gBAAQ;AAFY,OAAf,EAGJC,IAHI,CAGC,oBAAY;AAClB,YAAIC,SAASC,MAAT,KAAoB,GAAxB,EAA6B;AAC3B,iBAAO,EAAEA,QAAQ,SAAV,EAAqBC,SAAS,iCAA9B,EAAiEC,OAAO,SAAxE,EAAP;AACD;AACF,OAPM,CAAP;AAQD;;;8BAESZ,O,EAAS;AACjBA,cAAQJ,OAAR,GAAkB,KAAKA,OAAvB;;AAEA,aAAO,KAAKN,UAAL,CAAgBuB,iBAAhB,CAAkCb,OAAlC,CAAP;AACD;;;yCAEoBA,O,EAAS;AAAA;;AAE5B,UAAIC,UAAUa,iBAAEC,GAAF,CAAMf,QAAQC,OAAd,EAAuB,kBAAU;AAC7C,eAAO;AACLe,iBAAOC,OAAOD,KADT;AAELE,iBAAO,MAAKC,aAAL,CAAmBnB,OAAnB,EAA4BiB,MAA5B,CAFF;AAGLG,eAAK,MAAKC,WAAL,CAAiBrB,OAAjB,EAA0BiB,MAA1B;AAHA,SAAP;AAKD,OANa,CAAd;;AAQA,aAAOhB,OAAP;AACD;;;2BAEMqB,K,EAAO;AACZ,UAAIC,UAAU,mEAAd;AACA,UAAIC,SAAS,EAAb;AACA,UAAIC,IAAJ,EAAUC,IAAV,EAAgBC,IAAhB,EAAsBC,IAAtB,EAA4BC,IAA5B,EAAkCC,IAAlC,EAAwCC,IAAxC;AACA,UAAIC,IAAI,CAAR;AACA,aAAOA,IAAIV,MAAMnB,MAAjB,EAAyB;AACvBsB,eAAOH,MAAMW,UAAN,CAAiBD,GAAjB,CAAP;AACAN,eAAOJ,MAAMW,UAAN,CAAiBD,GAAjB,CAAP;AACAL,eAAOL,MAAMW,UAAN,CAAiBD,GAAjB,CAAP;AACAJ,eAAOH,QAAQ,CAAf;AACAI,eAAQ,CAACJ,OAAO,CAAR,KAAc,CAAf,GAAqBC,QAAQ,CAApC;AACAI,eAAQ,CAACJ,OAAO,EAAR,KAAe,CAAhB,GAAsBC,QAAQ,CAArC;AACAI,eAAOJ,OAAO,EAAd;AACA,YAAIO,MAAMR,IAAN,CAAJ,EAAiB;AACfI,iBAAOC,OAAO,EAAd;AACD,SAFD,MAEO,IAAIG,MAAMP,IAAN,CAAJ,EAAiB;AACtBI,iBAAO,EAAP;AACD;AACDP,iBAASA,SAASD,QAAQY,MAAR,CAAeP,IAAf,CAAT,GAAgCL,QAAQY,MAAR,CAAeN,IAAf,CAAhC,GAAuDN,QAAQY,MAAR,CAAeL,IAAf,CAAvD,GAA8EP,QAAQY,MAAR,CAAeJ,IAAf,CAAvF;AACD;;AAED,aAAOP,MAAP;AACD;;;qCAEgBzB,Q,EAAS;AACxBA,iBAAWA,YAAY,EAAvB;AACA,UAAIqC,cAAcrC,SAASsC,IAAT,IAAiB,MAAnC;AACA,UAAIC,kBAAkBvC,SAASwC,QAAT,IAAqB,UAA3C;;AAEA,aAAO,WAAW,KAAKC,MAAL,CAAYJ,cAAc,GAAd,GAAoBE,eAAhC,CAAlB;AACD;;;kCAEatC,O,EAASiB,M,EAAO;AAC5B,UAAIC,QAAQD,OAAOC,KAAP,IAAgB,EAA5B;AACAA,cAAQ,KAAK3B,WAAL,CAAiBkD,OAAjB,CAAyBvB,KAAzB,EAAgClB,QAAQ0C,UAAxC,EAAoD,KAApD,CAAR;AACA,aAAOxB,KAAP;AACD;;;gCAEWlB,O,EAASiB,M,EAAQ;AAC3B,UAAIG,MAAMH,OAAOG,GAAjB;AACA,UAAIA,OAAO,IAAP,IAAeA,OAAO,EAA1B,EAA6B;AAC3B,eAAOA,GAAP;AACD;;AAED,UAAIuB,aAAa,QAAjB;AACA,UAAI3C,WAAW,IAAX,IAAmBA,QAAQ4C,KAAR,IAAiB,IAApC,IAA4C5C,QAAQ4C,KAAR,CAAcC,IAAd,IAAsB,IAAtE,EAA2E;AACzEF,qBAAa3C,QAAQ4C,KAAR,CAAcC,IAAd,CAAmBC,WAAnB,EAAb;AACD;;AAED,UAAIC,WAAW,KAAf;AACA,UAAI/C,WAAW,IAAX,IAAmBA,QAAQ4C,KAAR,IAAiB,IAApC,IAA4C5C,QAAQ4C,KAAR,CAAcI,EAAd,IAAoB,IAApE,EAAyE;AACvED,mBAAW/C,QAAQ4C,KAAR,CAAcI,EAAd,CAAiBF,WAAjB,EAAX;AACD;AACD,UAAIG,aAAajD,QAAQiD,UAAR,IAAsB,OAAvC;;AAEAA,oBAAc,GAAd;AACA7B,YAAMA,IAAIqB,OAAJ,CAAY,aAAZ,EAA2B,EAA3B,CAAN;AACArB,YAAMA,IAAIqB,OAAJ,CAAY,OAAZ,EAAqB,MAAME,UAAN,GAAmB,GAAxC,CAAN;AACAvB,YAAMA,IAAIqB,OAAJ,CAAY,QAAZ,EAAsB,MAAME,UAAN,GAAmB,GAAzC,CAAN;AACAvB,YAAMA,IAAIqB,OAAJ,CAAY,KAAZ,EAAmB,MAAMM,QAAN,GAAiB,GAApC,CAAN;AACA3B,YAAMA,IAAIqB,OAAJ,CAAY,MAAZ,EAAoB,MAAMM,QAAN,GAAiB,GAArC,CAAN;AACA3B,YAAMA,IAAIqB,OAAJ,CAAY,WAAZ,EAAyBQ,UAAzB,CAAN;;AAEA7B,YAAM,KAAK7B,WAAL,CAAiBkD,OAAjB,CAAyBrB,GAAzB,EAA8BpB,QAAQ0C,UAAtC,EAAkD,KAAlD,CAAN;AACA,aAAOtB,GAAP;AACD","file":"datasource.js","sourcesContent":["import _ from \"lodash\";\n\nexport class GenericDatasource {\n\n constructor(instanceSettings, $q, backendSrv, templateSrv) {\n this.type = instanceSettings.type;\n this.url = instanceSettings.url;\n this.name = instanceSettings.name;\n this.q = $q;\n this.backendSrv = backendSrv;\n this.templateSrv = templateSrv;\n this.headers = {'Content-Type': 'application/json'};\n this.headers.Authorization = this.getAuthorization(instanceSettings.jsonData);\n }\n\n query(options) {\n var targets = this.buildQueryParameters(options);\n\n if (targets.length <= 0) {\n return this.q.when({data: []});\n }\n\n return this.doRequest({\n url: this.url + '/grafana/query',\n data: targets,\n method: 'POST'\n });\n }\n\n testDatasource() {\n return this.doRequest({\n url: this.url + '/grafana/heartbeat',\n method: 'GET',\n }).then(response => {\n if (response.status === 200) {\n return { status: \"success\", message: \"TDengine Data source is working\", title: \"Success\" };\n }\n });\n }\n\n doRequest(options) {\n options.headers = this.headers;\n\n return this.backendSrv.datasourceRequest(options);\n }\n\n buildQueryParameters(options) {\n\n var targets = _.map(options.targets, target => {\n return {\n refId: target.refId,\n alias: this.generateAlias(options, target),\n sql: this.generateSql(options, target)\n };\n });\n\n return targets;\n }\n\n encode(input) {\n var _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var output = \"\";\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n while (i < input.length) {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n }\n\n return output;\n }\n\n getAuthorization(jsonData){\n jsonData = jsonData || {};\n var defaultUser = jsonData.user || \"root\";\n var defaultPassword = jsonData.password || \"taosdata\";\n\n return \"Basic \" + this.encode(defaultUser + \":\" + defaultPassword);\n }\n\n generateAlias(options, target){\n var alias = target.alias || \"\";\n alias = this.templateSrv.replace(alias, options.scopedVars, 'csv');\n return alias;\n }\n\n generateSql(options, target) {\n var sql = target.sql;\n if (sql == null || sql == \"\"){\n return sql;\n }\n\n var queryStart = \"now-1h\";\n if (options != null && options.range != null && options.range.from != null){\n queryStart = options.range.from.toISOString();\n }\n\n var queryEnd = \"now\";\n if (options != null && options.range != null && options.range.to != null){\n queryEnd = options.range.to.toISOString();\n }\n var intervalMs = options.intervalMs || \"20000\";\n\n intervalMs += \"a\";\n sql = sql.replace(/^\\s+|\\s+$/gm, '');\n sql = sql.replace(\"$from\", \"'\" + queryStart + \"'\");\n sql = sql.replace(\"$begin\", \"'\" + queryStart + \"'\");\n sql = sql.replace(\"$to\", \"'\" + queryEnd + \"'\");\n sql = sql.replace(\"$end\", \"'\" + queryEnd + \"'\");\n sql = sql.replace(\"$interval\", intervalMs);\n\n sql = this.templateSrv.replace(sql, options.scopedVars, 'csv');\n return sql;\n }\n\n}"]} \ No newline at end of file diff --git a/src/connector/grafana/tdengine/src/datasource.js b/src/connector/grafana/tdengine/src/datasource.js index 262b12c33dc71122cbbde2df6608ca85af474d2f..08426bb3df6a8a8d78f6289284f56ac83c4713c8 100644 --- a/src/connector/grafana/tdengine/src/datasource.js +++ b/src/connector/grafana/tdengine/src/datasource.js @@ -49,7 +49,7 @@ export class GenericDatasource { var targets = _.map(options.targets, target => { return { refId: target.refId, - alias: target.alias || "", + alias: this.generateAlias(options, target), sql: this.generateSql(options, target) }; }); @@ -89,6 +89,12 @@ export class GenericDatasource { return "Basic " + this.encode(defaultUser + ":" + defaultPassword); } + generateAlias(options, target){ + var alias = target.alias || ""; + alias = this.templateSrv.replace(alias, options.scopedVars, 'csv'); + return alias; + } + generateSql(options, target) { var sql = target.sql; if (sql == null || sql == ""){ diff --git a/src/inc/sql.y b/src/inc/sql.y index c113e21dfbde6311cb44ff0d908ba2d2864ab732..1c03bde01cf08236de8d339d46a5e72a3d6fca8f 100644 --- a/src/inc/sql.y +++ b/src/inc/sql.y @@ -108,6 +108,12 @@ cmd ::= SHOW dbPrefix(X) VGROUPS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0); } +cmd ::= SHOW dbPrefix(X) VGROUPS ids(Y). { + SSQLToken token; + setDBName(&token, &X); + setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &Y); +} + //drop configure for tables cmd ::= DROP TABLE ifexists(Y) ids(X) cpxName(Z). { X.n += Z.n; diff --git a/src/inc/taos.h b/src/inc/taos.h index 2fd6d8be927a310e0131b62a8f0ecf55ae943ef2..c56d0e86d73c4d9b1b51e4e2e9c487081295dd3d 100644 --- a/src/inc/taos.h +++ b/src/inc/taos.h @@ -57,10 +57,16 @@ typedef struct taosField { char type; } TAOS_FIELD; -void taos_init(); -int taos_options(TSDB_OPTION option, const void *arg, ...); -TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port); -void taos_close(TAOS *taos); +#ifdef _TD_GO_DLL_ + #define DLL_EXPORT __declspec(dllexport) +#else + #define DLL_EXPORT +#endif + +DLL_EXPORT void taos_init(); +DLL_EXPORT int taos_options(TSDB_OPTION option, const void *arg, ...); +DLL_EXPORT TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port); +DLL_EXPORT void taos_close(TAOS *taos); typedef struct TAOS_BIND { int buffer_type; @@ -80,18 +86,18 @@ int taos_stmt_execute(TAOS_STMT *stmt); TAOS_RES * taos_stmt_use_result(TAOS_STMT *stmt); int taos_stmt_close(TAOS_STMT *stmt); -int taos_query(TAOS *taos, const char *sql); -TAOS_RES *taos_use_result(TAOS *taos); -TAOS_ROW taos_fetch_row(TAOS_RES *res); -int taos_result_precision(TAOS_RES *res); // get the time precision of result -void taos_free_result(TAOS_RES *res); -int taos_field_count(TAOS *taos); -int taos_num_fields(TAOS_RES *res); -int taos_affected_rows(TAOS *taos); -TAOS_FIELD *taos_fetch_fields(TAOS_RES *res); -int taos_select_db(TAOS *taos, const char *db); -int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields); -void taos_stop_query(TAOS_RES *res); +DLL_EXPORT int taos_query(TAOS *taos, const char *sql); +DLL_EXPORT TAOS_RES *taos_use_result(TAOS *taos); +DLL_EXPORT TAOS_ROW taos_fetch_row(TAOS_RES *res); +DLL_EXPORT int taos_result_precision(TAOS_RES *res); // get the time precision of result +DLL_EXPORT void taos_free_result(TAOS_RES *res); +DLL_EXPORT int taos_field_count(TAOS *taos); +DLL_EXPORT int taos_num_fields(TAOS_RES *res); +DLL_EXPORT int taos_affected_rows(TAOS *taos); +DLL_EXPORT TAOS_FIELD *taos_fetch_fields(TAOS_RES *res); +DLL_EXPORT int taos_select_db(TAOS *taos, const char *db); +DLL_EXPORT int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields); +DLL_EXPORT void taos_stop_query(TAOS_RES *res); int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows); int taos_validate_sql(TAOS *taos, const char *sql); @@ -100,27 +106,27 @@ int taos_validate_sql(TAOS *taos, const char *sql); // TAOS_RES *taos_list_dbs(TAOS *mysql, const char *wild); // TODO: the return value should be `const` -char *taos_get_server_info(TAOS *taos); -char *taos_get_client_info(); -char *taos_errstr(TAOS *taos); +DLL_EXPORT char *taos_get_server_info(TAOS *taos); +DLL_EXPORT char *taos_get_client_info(); +DLL_EXPORT char *taos_errstr(TAOS *taos); -int taos_errno(TAOS *taos); +DLL_EXPORT int taos_errno(TAOS *taos); -void taos_query_a(TAOS *taos, const char *sql, void (*fp)(void *param, TAOS_RES *, int code), void *param); -void taos_fetch_rows_a(TAOS_RES *res, void (*fp)(void *param, TAOS_RES *, int numOfRows), void *param); -void taos_fetch_row_a(TAOS_RES *res, void (*fp)(void *param, TAOS_RES *, TAOS_ROW row), void *param); +DLL_EXPORT void taos_query_a(TAOS *taos, const char *sql, void (*fp)(void *param, TAOS_RES *, int code), void *param); +DLL_EXPORT void taos_fetch_rows_a(TAOS_RES *res, void (*fp)(void *param, TAOS_RES *, int numOfRows), void *param); +DLL_EXPORT void taos_fetch_row_a(TAOS_RES *res, void (*fp)(void *param, TAOS_RES *, TAOS_ROW row), void *param); -TAOS_SUB *taos_subscribe(const char *host, const char *user, const char *pass, const char *db, const char *table, int64_t time, int mseconds); -TAOS_ROW taos_consume(TAOS_SUB *tsub); -void taos_unsubscribe(TAOS_SUB *tsub); -int taos_subfields_count(TAOS_SUB *tsub); -TAOS_FIELD *taos_fetch_subfields(TAOS_SUB *tsub); +DLL_EXPORT TAOS_SUB *taos_subscribe(const char *host, const char *user, const char *pass, const char *db, const char *table, int64_t time, int mseconds); +DLL_EXPORT TAOS_ROW taos_consume(TAOS_SUB *tsub); +DLL_EXPORT void taos_unsubscribe(TAOS_SUB *tsub); +DLL_EXPORT int taos_subfields_count(TAOS_SUB *tsub); +DLL_EXPORT TAOS_FIELD *taos_fetch_subfields(TAOS_SUB *tsub); -TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sql, void (*fp)(void *param, TAOS_RES *, TAOS_ROW row), +DLL_EXPORT TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sql, void (*fp)(void *param, TAOS_RES *, TAOS_ROW row), int64_t stime, void *param, void (*callback)(void *)); -void taos_close_stream(TAOS_STREAM *tstr); +DLL_EXPORT void taos_close_stream(TAOS_STREAM *tstr); -int taos_load_table_info(TAOS *taos, const char* tableNameList); +DLL_EXPORT int taos_load_table_info(TAOS *taos, const char* tableNameList); #ifdef __cplusplus } diff --git a/src/inc/tglobalcfg.h b/src/inc/tglobalcfg.h index 37e8e20681c2b75762f5e7ffaba764652374f9d1..c4407f7d55487689c84e5484fbb72749a62834e2 100644 --- a/src/inc/tglobalcfg.h +++ b/src/inc/tglobalcfg.h @@ -75,7 +75,6 @@ extern float tsNumOfThreadsPerCore; extern float tsRatioOfQueryThreads; extern char tsPublicIp[]; extern char tsPrivateIp[]; -extern char tsServerIpStr[]; extern short tsNumOfVnodesPerCore; extern short tsNumOfTotalVnodes; extern short tsCheckHeaderFile; @@ -148,7 +147,6 @@ extern int tsHttpMaxThreads; extern int tsHttpEnableCompress; extern int tsHttpEnableRecordSql; extern int tsTelegrafUseFieldNum; -extern int tsAdminRowLimit; extern int tsTscEnableRecordSql; extern int tsAnyIp; diff --git a/src/inc/tsdb.h b/src/inc/tsdb.h index 1ec9422bbf492aba3fc0df639b382da5a593ed25..aa712ab62296c806b530cea14bacba525530d93d 100644 --- a/src/inc/tsdb.h +++ b/src/inc/tsdb.h @@ -182,6 +182,10 @@ extern "C" { #define TSDB_MAX_AVG_BLOCKS 2048 #define TSDB_DEFAULT_AVG_BLOCKS 4 +/* + * There is a bug in function taosAllocateId. + * When "create database tables 1" is executed, the wrong sid is assigned, so the minimum value is set to 2. + */ #define TSDB_MIN_TABLES_PER_VNODE 2 #define TSDB_MAX_TABLES_PER_VNODE 220000 diff --git a/src/inc/tutil.h b/src/inc/tutil.h index d3c8429edcdb6f729f227f44dfbe2fd4a50b29a5..b66da286973521c1e6cd29db2b2923cfc371be58 100644 --- a/src/inc/tutil.h +++ b/src/inc/tutil.h @@ -164,6 +164,8 @@ int32_t taosInitTimer(void (*callback)(int), int32_t ms); bool taosMbsToUcs4(char *mbs, int32_t mbs_len, char *ucs4, int32_t ucs4_max_len); +int tasoUcs4Compare(void* f1_ucs4, void *f2_ucs4, int bytes); + bool taosUcs4ToMbs(void *ucs4, int32_t ucs4_max_len, char *mbs); bool taosValidateEncodec(const char *encodec); diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index ff45220d8901dfd361a69ced5ab3d80df993dd83..1ca969a4682f99eb0ca8329eb03bd3c06a8f2438 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -457,25 +457,15 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { printf("%*" PRId64 "|", l[i], *((int64_t *)row[i])); break; case TSDB_DATA_TYPE_FLOAT: { -#ifdef _TD_ARM_32_ float fv = 0; - //memcpy(&fv, row[i], sizeof(float)); - *(int32_t*)(&fv) = *(int32_t*)row[i]; + fv = GET_FLOAT_VAL(row[i]); printf("%*.5f|", l[i], fv); -#else - printf("%*.5f|", l[i], *((float *)row[i])); -#endif - } + } break; case TSDB_DATA_TYPE_DOUBLE: { -#ifdef _TD_ARM_32_ double dv = 0; - //memcpy(&dv, row[i], sizeof(double)); - *(int64_t*)(&dv) = *(int64_t*)row[i]; + dv = GET_DOUBLE_VAL(row[i]); printf("%*.9f|", l[i], dv); -#else - printf("%*.9f|", l[i], *((double *)row[i])); -#endif } break; case TSDB_DATA_TYPE_BINARY: @@ -542,25 +532,15 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { printf("%" PRId64 "\n", *((int64_t *)row[i])); break; case TSDB_DATA_TYPE_FLOAT: { -#ifdef _TD_ARM_32_ float fv = 0; - //memcpy(&fv, row[i], sizeof(float)); - *(int32_t*)(&fv) = *(int32_t*)row[i]; + fv = GET_FLOAT_VAL(row[i]); printf("%.5f\n", fv); -#else - printf("%.5f\n", *((float *)row[i])); -#endif - } + } break; case TSDB_DATA_TYPE_DOUBLE: { -#ifdef _TD_ARM_32_ double dv = 0; - //memcpy(&dv, row[i], sizeof(double)); - *(int64_t*)(&dv) = *(int64_t*)row[i]; + dv = GET_DOUBLE_VAL(row[i]); printf("%.9f\n", dv); -#else - printf("%.9f\n", *((double *)row[i])); -#endif } break; case TSDB_DATA_TYPE_BINARY: @@ -630,25 +610,15 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { fprintf(fp, "%" PRId64, *((int64_t *)row[i])); break; case TSDB_DATA_TYPE_FLOAT: { -#ifdef _TD_ARM_32_ float fv = 0; - //memcpy(&fv, row[i], sizeof(float)); - *(int32_t*)(&fv) = *(int32_t*)row[i]; + fv = GET_FLOAT_VAL(row[i]); fprintf(fp, "%.5f", fv); -#else - fprintf(fp, "%.5f", *((float *)row[i])); -#endif - } + } break; case TSDB_DATA_TYPE_DOUBLE: { -#ifdef _TD_ARM_32_ double dv = 0; - //memcpy(&dv, row[i], sizeof(double)); - *(int64_t*)(&dv) = *(int64_t*)row[i]; + dv = GET_DOUBLE_VAL(row[i]); fprintf(fp, "%.9f", dv); -#else - fprintf(fp, "%.9f", *((double *)row[i])); -#endif } break; case TSDB_DATA_TYPE_BINARY: diff --git a/src/kit/shell/src/shellLinux.c b/src/kit/shell/src/shellLinux.c index e9e988c6c687a8eaefd858d6628f50f45a142af7..bcb9c7b4e7d219f98251d6f4111675507fd97eea 100644 --- a/src/kit/shell/src/shellLinux.c +++ b/src/kit/shell/src/shellLinux.c @@ -130,7 +130,11 @@ void shellParseArgument(int argc, char *argv[], struct arguments *arguments) { argp_parse(&argp, argc, argv, 0, 0, arguments); if (arguments->abort) { - error(10, 0, "ABORTED"); + #ifndef _ALPINE + error(10, 0, "ABORTED"); + #else + abort(); + #endif } } diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 40fbabe1f76027860c8f3b863618f870b833a91f..6eb8426e5842e327ef94108fadb941a6c1c78c89 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -17,7 +17,10 @@ #include #include + +#ifndef _ALPINE #include +#endif #include #include #include @@ -309,7 +312,13 @@ int main(int argc, char *argv[]) { argp_parse(&argp, argc, argv, 0, 0, &arguments); - if (arguments.abort) error(10, 0, "ABORTED"); + if (arguments.abort) { + #ifndef _ALPINE + error(10, 0, "ABORTED"); + #else + abort(); + #endif + } enum MODE query_mode = arguments.mode; char *ip_addr = arguments.host; @@ -342,6 +351,11 @@ int main(int argc, char *argv[]) { } FILE *fp = fopen(arguments.output_file, "a"); + if (NULL == fp) { + fprintf(stderr, "Failed to open %s for writing\n", arguments.output_file); + return 1; + }; + time_t tTime = time(NULL); struct tm tm = *localtime(&tTime); @@ -833,7 +847,7 @@ void generateData(char *res, char **data_type, int num_of_cols, int64_t timestam } else if (strcasecmp(data_type[i % c], "binary") == 0) { char s[len_of_binary]; rand_string(s, len_of_binary); - pstr += sprintf(pstr, ", %s", s); + pstr += sprintf(pstr, ", \"%s\"", s); } } diff --git a/src/kit/taosdump/taosdump.c b/src/kit/taosdump/taosdump.c index c8ef3bc0481c72d284485d7c369db97de6d780e9..f722d24c26859900692b62d088f5e2a7ddfd9ef7 100644 --- a/src/kit/taosdump/taosdump.c +++ b/src/kit/taosdump/taosdump.c @@ -15,7 +15,9 @@ #include #include -#include +#ifndef _ALPINE + #include +#endif #include #include #include @@ -335,7 +337,13 @@ int main(int argc, char *argv[]) { reflected in arguments. */ argp_parse(&argp, argc, argv, 0, 0, &arguments); - if (arguments.abort) error(10, 0, "ABORTED"); + if (arguments.abort) { + #ifndef _ALPINE + error(10, 0, "ABORTED"); + #else + abort(); + #endif + } if (taosCheckParam(&arguments) < 0) { exit(EXIT_FAILURE); diff --git a/src/os/darwin/inc/os.h b/src/os/darwin/inc/os.h index bf86103e8400725b991a9716de25b2018ec5a61d..ea7a95c4dafd075570417ceaef4ef97c2dc5b207 100644 --- a/src/os/darwin/inc/os.h +++ b/src/os/darwin/inc/os.h @@ -209,9 +209,14 @@ typedef int(*__compar_fn_t)(const void *, const void *); #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE #endif +#ifndef _TD_ARM_32_ #define BUILDIN_CLZL(val) __builtin_clzl(val) -#define BUILDIN_CLZ(val) __builtin_clz(val) #define BUILDIN_CTZL(val) __builtin_ctzl(val) +#else +#define BUILDIN_CLZL(val) __builtin_clzll(val) +#define BUILDIN_CTZL(val) __builtin_ctzll(val) +#endif +#define BUILDIN_CLZ(val) __builtin_clz(val) #define BUILDIN_CTZ(val) __builtin_ctz(val) #endif \ No newline at end of file diff --git a/src/os/linux/inc/os.h b/src/os/linux/inc/os.h index 68ae7c09eafe6c76e745e9c5333827294eb72ece..aa54a3563ec08b2c83d7dd34db427399cfa93a3e 100644 --- a/src/os/linux/inc/os.h +++ b/src/os/linux/inc/os.h @@ -23,7 +23,10 @@ extern "C" { #include #include -#include +#ifndef _ALPINE + #include +#endif + #include #include #include @@ -229,9 +232,22 @@ void taosSetCoreDump(); void taosBlockSIGPIPE(); +#ifdef _ALPINE + typedef int(*__compar_fn_t)(const void *, const void *); + void error (int, int, const char *); + #ifndef PTHREAD_MUTEX_RECURSIVE_NP + #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE + #endif +#endif + +#ifndef _TD_ARM_32_ #define BUILDIN_CLZL(val) __builtin_clzl(val) -#define BUILDIN_CLZ(val) __builtin_clz(val) #define BUILDIN_CTZL(val) __builtin_ctzl(val) +#else +#define BUILDIN_CLZL(val) __builtin_clzll(val) +#define BUILDIN_CTZL(val) __builtin_ctzll(val) +#endif +#define BUILDIN_CLZ(val) __builtin_clz(val) #define BUILDIN_CTZ(val) __builtin_ctz(val) #ifdef __cplusplus diff --git a/src/os/linux/src/tlinux.c b/src/os/linux/src/tlinux.c index a23919e458709490d45a5bcadebf84ee5fed743d..ccd6fc8a340f8132edc94f8639692eedfb2024c6 100644 --- a/src/os/linux/src/tlinux.c +++ b/src/os/linux/src/tlinux.c @@ -234,8 +234,15 @@ void *taosProcessAlarmSignal(void *tharg) { timer_t timerId; struct sigevent sevent; - sevent.sigev_notify = SIGEV_THREAD_ID; - sevent._sigev_un._tid = syscall(__NR_gettid); + + #ifdef _ALPINE + sevent.sigev_notify = SIGEV_THREAD; + sevent.sigev_value.sival_int = syscall(__NR_gettid); + #else + sevent.sigev_notify = SIGEV_THREAD_ID; + sevent._sigev_un._tid = syscall(__NR_gettid); + #endif + sevent.sigev_signo = SIGALRM; if (timer_create(CLOCK_REALTIME, &sevent, &timerId) == -1) { diff --git a/src/os/linux/src/tsystem.c b/src/os/linux/src/tsystem.c index 055a67e0772f1a9595fa2825514358e9ef16083c..c3b8b41c9d5536972d345efd4c6d1974ae9d77dd 100644 --- a/src/os/linux/src/tsystem.c +++ b/src/os/linux/src/tsystem.c @@ -27,12 +27,15 @@ #include #include #include -#include -#include #include #include #include + +#ifdef _ALPINE #include +#else +#include +#endif #include "tglobalcfg.h" #include "tlog.h" diff --git a/src/os/windows/inc/os.h b/src/os/windows/inc/os.h index 9c0add2c319829e10d192de8a94dc43038c3155d..3f957e8abd489abdbe7bb009b3d4fa47aadb4467 100644 --- a/src/os/windows/inc/os.h +++ b/src/os/windows/inc/os.h @@ -17,10 +17,10 @@ #define TDENGINE_PLATFORM_WINDOWS_H #include -#include +#include #include -#include -#include +#include +#include #include #include #include @@ -35,12 +35,15 @@ #include #include #include -#include -#include +#include +#include #include +#include #include "winsock2.h" #include +#include + #ifdef __cplusplus extern "C" { #endif @@ -74,7 +77,13 @@ extern "C" { #define strncasecmp _strnicmp #define wcsncasecmp _wcsnicmp #define strtok_r strtok_s -#define str2int64 _atoi64 +#ifdef _TD_GO_DLL_ + int64_t str2int64(char *str); + uint64_t htonll(uint64_t val); +#else + #define str2int64 _atoi64 +#endif + #define snprintf _snprintf #define in_addr_t unsigned long #define socklen_t int @@ -135,7 +144,12 @@ extern "C" { #define atomic_exchange_64(ptr, val) _InterlockedExchange64((__int64 volatile*)(ptr), (__int64)(val)) #define atomic_exchange_ptr(ptr, val) _InterlockedExchangePointer((void* volatile*)(ptr), (void*)(val)) -#define atomic_val_compare_exchange_8(ptr, oldval, newval) _InterlockedCompareExchange8((char volatile*)(ptr), (char)(newval), (char)(oldval)) +#ifdef _TD_GO_DLL_ + #define atomic_val_compare_exchange_8 __sync_val_compare_and_swap +#else + #define atomic_val_compare_exchange_8(ptr, oldval, newval) _InterlockedCompareExchange8((char volatile*)(ptr), (char)(newval), (char)(oldval)) +#endif + #define atomic_val_compare_exchange_16(ptr, oldval, newval) _InterlockedCompareExchange16((short volatile*)(ptr), (short)(newval), (short)(oldval)) #define atomic_val_compare_exchange_32(ptr, oldval, newval) _InterlockedCompareExchange((long volatile*)(ptr), (long)(newval), (long)(oldval)) #define atomic_val_compare_exchange_64(ptr, oldval, newval) _InterlockedCompareExchange64((__int64 volatile*)(ptr), (__int64)(newval), (__int64)(oldval)) @@ -155,9 +169,14 @@ __int64 interlocked_add_fetch_64(__int64 volatile *ptr, __int64 val); #else #define atomic_add_fetch_ptr atomic_add_fetch_32 #endif +#ifdef _TD_GO_DLL_ + #define atomic_fetch_add_8 __sync_fetch_and_ad + #define atomic_fetch_add_16 __sync_fetch_and_add +#else + #define atomic_fetch_add_8(ptr, val) _InterlockedExchangeAdd8((char volatile*)(ptr), (char)(val)) + #define atomic_fetch_add_16(ptr, val) _InterlockedExchangeAdd16((short volatile*)(ptr), (short)(val)) +#endif -#define atomic_fetch_add_8(ptr, val) _InterlockedExchangeAdd8((char volatile*)(ptr), (char)(val)) -#define atomic_fetch_add_16(ptr, val) _InterlockedExchangeAdd16((short volatile*)(ptr), (short)(val)) #define atomic_fetch_add_32(ptr, val) _InterlockedExchangeAdd((long volatile*)(ptr), (long)(val)) #define atomic_fetch_add_64(ptr, val) _InterlockedExchangeAdd64((__int64 volatile*)(ptr), (__int64)(val)) #ifdef _WIN64 @@ -185,14 +204,17 @@ __int64 interlocked_add_fetch_64(__int64 volatile *ptr, __int64 val); #else #define atomic_fetch_sub_ptr atomic_fetch_sub_32 #endif - -char interlocked_and_fetch_8(char volatile* ptr, char val); -short interlocked_and_fetch_16(short volatile* ptr, short val); +#ifndef _TD_GO_DLL_ + char interlocked_and_fetch_8(char volatile* ptr, char val); + short interlocked_and_fetch_16(short volatile* ptr, short val); +#endif long interlocked_and_fetch_32(long volatile* ptr, long val); __int64 interlocked_and_fetch_64(__int64 volatile* ptr, __int64 val); -#define atomic_and_fetch_8(ptr, val) interlocked_and_fetch_8((char volatile*)(ptr), (char)(val)) -#define atomic_and_fetch_16(ptr, val) interlocked_and_fetch_16((short volatile*)(ptr), (short)(val)) +#ifndef _TD_GO_DLL_ + #define atomic_and_fetch_8(ptr, val) interlocked_and_fetch_8((char volatile*)(ptr), (char)(val)) + #define atomic_and_fetch_16(ptr, val) interlocked_and_fetch_16((short volatile*)(ptr), (short)(val)) +#endif #define atomic_and_fetch_32(ptr, val) interlocked_and_fetch_32((long volatile*)(ptr), (long)(val)) #define atomic_and_fetch_64(ptr, val) interlocked_and_fetch_64((__int64 volatile*)(ptr), (__int64)(val)) #ifdef _WIN64 @@ -200,9 +222,10 @@ __int64 interlocked_and_fetch_64(__int64 volatile* ptr, __int64 val); #else #define atomic_and_fetch_ptr atomic_and_fetch_32 #endif - -#define atomic_fetch_and_8(ptr, val) _InterlockedAnd8((char volatile*)(ptr), (char)(val)) -#define atomic_fetch_and_16(ptr, val) _InterlockedAnd16((short volatile*)(ptr), (short)(val)) +#ifndef _TD_GO_DLL_ + #define atomic_fetch_and_8(ptr, val) _InterlockedAnd8((char volatile*)(ptr), (char)(val)) + #define atomic_fetch_and_16(ptr, val) _InterlockedAnd16((short volatile*)(ptr), (short)(val)) +#endif #define atomic_fetch_and_32(ptr, val) _InterlockedAnd((long volatile*)(ptr), (long)(val)) #ifdef _M_IX86 @@ -217,14 +240,17 @@ __int64 interlocked_and_fetch_64(__int64 volatile* ptr, __int64 val); #else #define atomic_fetch_and_ptr atomic_fetch_and_32 #endif - -char interlocked_or_fetch_8(char volatile* ptr, char val); -short interlocked_or_fetch_16(short volatile* ptr, short val); +#ifndef _TD_GO_DLL_ + char interlocked_or_fetch_8(char volatile* ptr, char val); + short interlocked_or_fetch_16(short volatile* ptr, short val); +#endif long interlocked_or_fetch_32(long volatile* ptr, long val); __int64 interlocked_or_fetch_64(__int64 volatile* ptr, __int64 val); -#define atomic_or_fetch_8(ptr, val) interlocked_or_fetch_8((char volatile*)(ptr), (char)(val)) -#define atomic_or_fetch_16(ptr, val) interlocked_or_fetch_16((short volatile*)(ptr), (short)(val)) +#ifndef _TD_GO_DLL_ + #define atomic_or_fetch_8(ptr, val) interlocked_or_fetch_8((char volatile*)(ptr), (char)(val)) + #define atomic_or_fetch_16(ptr, val) interlocked_or_fetch_16((short volatile*)(ptr), (short)(val)) +#endif #define atomic_or_fetch_32(ptr, val) interlocked_or_fetch_32((long volatile*)(ptr), (long)(val)) #define atomic_or_fetch_64(ptr, val) interlocked_or_fetch_64((__int64 volatile*)(ptr), (__int64)(val)) #ifdef _WIN64 @@ -232,9 +258,10 @@ __int64 interlocked_or_fetch_64(__int64 volatile* ptr, __int64 val); #else #define atomic_or_fetch_ptr atomic_or_fetch_32 #endif - -#define atomic_fetch_or_8(ptr, val) _InterlockedOr8((char volatile*)(ptr), (char)(val)) -#define atomic_fetch_or_16(ptr, val) _InterlockedOr16((short volatile*)(ptr), (short)(val)) +#ifndef _TD_GO_DLL_ + #define atomic_fetch_or_8(ptr, val) _InterlockedOr8((char volatile*)(ptr), (char)(val)) + #define atomic_fetch_or_16(ptr, val) _InterlockedOr16((short volatile*)(ptr), (short)(val)) +#endif #define atomic_fetch_or_32(ptr, val) _InterlockedOr((long volatile*)(ptr), (long)(val)) #ifdef _M_IX86 @@ -250,13 +277,17 @@ __int64 interlocked_or_fetch_64(__int64 volatile* ptr, __int64 val); #define atomic_fetch_or_ptr atomic_fetch_or_32 #endif -char interlocked_xor_fetch_8(char volatile* ptr, char val); -short interlocked_xor_fetch_16(short volatile* ptr, short val); +#ifndef _TD_GO_DLL_ + char interlocked_xor_fetch_8(char volatile* ptr, char val); + short interlocked_xor_fetch_16(short volatile* ptr, short val); +#endif long interlocked_xor_fetch_32(long volatile* ptr, long val); __int64 interlocked_xor_fetch_64(__int64 volatile* ptr, __int64 val); -#define atomic_xor_fetch_8(ptr, val) interlocked_xor_fetch_8((char volatile*)(ptr), (char)(val)) -#define atomic_xor_fetch_16(ptr, val) interlocked_xor_fetch_16((short volatile*)(ptr), (short)(val)) +#ifndef _TD_GO_DLL_ + #define atomic_xor_fetch_8(ptr, val) interlocked_xor_fetch_8((char volatile*)(ptr), (char)(val)) + #define atomic_xor_fetch_16(ptr, val) interlocked_xor_fetch_16((short volatile*)(ptr), (short)(val)) +#endif #define atomic_xor_fetch_32(ptr, val) interlocked_xor_fetch_32((long volatile*)(ptr), (long)(val)) #define atomic_xor_fetch_64(ptr, val) interlocked_xor_fetch_64((__int64 volatile*)(ptr), (__int64)(val)) #ifdef _WIN64 @@ -265,8 +296,10 @@ __int64 interlocked_xor_fetch_64(__int64 volatile* ptr, __int64 val); #define atomic_xor_fetch_ptr atomic_xor_fetch_32 #endif -#define atomic_fetch_xor_8(ptr, val) _InterlockedXor8((char volatile*)(ptr), (char)(val)) -#define atomic_fetch_xor_16(ptr, val) _InterlockedXor16((short volatile*)(ptr), (short)(val)) +#ifndef _TD_GO_DLL_ + #define atomic_fetch_xor_8(ptr, val) _InterlockedXor8((char volatile*)(ptr), (char)(val)) + #define atomic_fetch_xor_16(ptr, val) _InterlockedXor16((short volatile*)(ptr), (short)(val)) +#endif #define atomic_fetch_xor_32(ptr, val) _InterlockedXor((long volatile*)(ptr), (long)(val)) #ifdef _M_IX86 @@ -292,7 +325,11 @@ __int64 interlocked_xor_fetch_64(__int64 volatile* ptr, __int64 val); #define MAX(a,b) (((a)>(b))?(a):(b)) #define MIN(a,b) (((a)<(b))?(a):(b)) -#define MILLISECOND_PER_SECOND (1000i64) +#ifdef _TD_GO_DLL_ + #define MILLISECOND_PER_SECOND (1000LL) +#else + #define MILLISECOND_PER_SECOND (1000i64) +#endif #define tsem_t sem_t #define tsem_init sem_init diff --git a/src/os/windows/src/twindows.c b/src/os/windows/src/twindows.c index 98be6b60ba16e52b2177971d95930f7f717785aa..b29919b969c6a5aa25e979f59065f1ed9c703832 100644 --- a/src/os/windows/src/twindows.c +++ b/src/os/windows/src/twindows.c @@ -28,6 +28,10 @@ #include "tsdb.h" #include "tglobalcfg.h" +#include +#include +#include + char configDir[TSDB_FILENAME_LEN] = "C:/TDengine/cfg"; char tsDirectory[TSDB_FILENAME_LEN] = "C:/TDengine/data"; char logDir[TSDB_FILENAME_LEN] = "C:/TDengine/log"; @@ -68,11 +72,19 @@ int taosSetSockOpt(int socketfd, int level, int optname, void *optval, int optle // add char interlocked_add_fetch_8(char volatile* ptr, char val) { - return _InterlockedExchangeAdd8(ptr, val) + val; + #ifdef _TD_GO_DLL_ + return __sync_fetch_and_add(ptr, val) + val; + #else + return _InterlockedExchangeAdd8(ptr, val) + val; + #endif } short interlocked_add_fetch_16(short volatile* ptr, short val) { - return _InterlockedExchangeAdd16(ptr, val) + val; + #ifdef _TD_GO_DLL_ + return __sync_fetch_and_add(ptr, val) + val; + #else + return _InterlockedExchangeAdd16(ptr, val) + val; + #endif } long interlocked_add_fetch_32(long volatile* ptr, long val) { @@ -84,6 +96,7 @@ __int64 interlocked_add_fetch_64(__int64 volatile* ptr, __int64 val) { } // and +#ifndef _TD_GO_DLL_ char interlocked_and_fetch_8(char volatile* ptr, char val) { return _InterlockedAnd8(ptr, val) & val; } @@ -91,6 +104,7 @@ char interlocked_and_fetch_8(char volatile* ptr, char val) { short interlocked_and_fetch_16(short volatile* ptr, short val) { return _InterlockedAnd16(ptr, val) & val; } +#endif long interlocked_and_fetch_32(long volatile* ptr, long val) { return _InterlockedAnd(ptr, val) & val; @@ -124,6 +138,7 @@ __int64 interlocked_fetch_and_64(__int64 volatile* ptr, __int64 val) { #endif // or +#ifndef _TD_GO_DLL_ char interlocked_or_fetch_8(char volatile* ptr, char val) { return _InterlockedOr8(ptr, val) | val; } @@ -131,7 +146,7 @@ char interlocked_or_fetch_8(char volatile* ptr, char val) { short interlocked_or_fetch_16(short volatile* ptr, short val) { return _InterlockedOr16(ptr, val) | val; } - +#endif long interlocked_or_fetch_32(long volatile* ptr, long val) { return _InterlockedOr(ptr, val) | val; } @@ -164,6 +179,7 @@ __int64 interlocked_fetch_or_64(__int64 volatile* ptr, __int64 val) { #endif // xor +#ifndef _TD_GO_DLL_ char interlocked_xor_fetch_8(char volatile* ptr, char val) { return _InterlockedXor8(ptr, val) ^ val; } @@ -171,7 +187,7 @@ char interlocked_xor_fetch_8(char volatile* ptr, char val) { short interlocked_xor_fetch_16(short volatile* ptr, short val) { return _InterlockedXor16(ptr, val) ^ val; } - +#endif long interlocked_xor_fetch_32(long volatile* ptr, long val) { return _InterlockedXor(ptr, val) ^ val; } @@ -396,4 +412,16 @@ char *strndup(const char *s, size_t n) { return r; } -void taosSetCoreDump() {} \ No newline at end of file +void taosSetCoreDump() {} + +#ifdef _TD_GO_DLL_ +int64_t str2int64(char *str) { + char *endptr = NULL; + return strtoll(str, &endptr, 10); +} + +uint64_t htonll(uint64_t val) +{ + return (((uint64_t) htonl(val)) << 32) + htonl(val >> 32); +} +#endif \ No newline at end of file diff --git a/src/rpc/src/trpc.c b/src/rpc/src/trpc.c index db1ca33841c502f2b983501880412d79bf02e175..87f7e2e2661c8581cce9a350c7fec63517ee9fa9 100755 --- a/src/rpc/src/trpc.c +++ b/src/rpc/src/trpc.c @@ -906,7 +906,10 @@ int taosProcessMsgHeader(STaosHeader *pHeader, SRpcConn **ppConn, STaosRpc *pSer } if (taosAuthenticateMsg((uint8_t *)pHeader, dataLen - TSDB_AUTH_LEN, pDigest->auth, pConn->secret) < 0) { - tTrace("%s cid:%d sid:%d id:%s, authentication failed, msg discarded pConn:%p", pServer->label, chann, sid, + char ipstr[24]; + tinet_ntoa(ipstr, ip); + mLError("user:%s login from %s, authentication failed", pHeader->meterId, ipstr); + tError("%s cid:%d sid:%d id:%s, authentication failed, msg discarded pConn:%p", pServer->label, chann, sid, pConn->meterId, pConn); code = TSDB_CODE_AUTH_FAILURE; goto _exit; diff --git a/src/rpc/src/ttcpserver.c b/src/rpc/src/ttcpserver.c index 29ada20bc427455edf8c5b771178a33aa8214ba3..663bfcdf8ee86008b0cfa4803725af1866a950bf 100644 --- a/src/rpc/src/ttcpserver.c +++ b/src/rpc/src/ttcpserver.c @@ -447,6 +447,7 @@ void *taosInitTcpServer(char *ip, uint16_t port, char *label, int numOfThreads, return (void *)pServerObj; } +#if 0 void taosListTcpConnection(void *handle, char *buffer) { SServerObj *pServerObj; SThreadObj *pThreadObj; @@ -468,7 +469,7 @@ void taosListTcpConnection(void *handle, char *buffer) { msg = msg + strlen(msg); pFdObj = pThreadObj->pHead; while (pFdObj) { - sprintf(" ip:%s port:%hu\n", pFdObj->ipstr, pFdObj->port); + sprintf(msg, " ip:%s port:%hu\n", pFdObj->ipstr, pFdObj->port); msg = msg + strlen(msg); numOfFds++; numOfConns++; @@ -486,6 +487,7 @@ void taosListTcpConnection(void *handle, char *buffer) { return; } +#endif int taosSendTcpServerData(uint32_t ip, uint16_t port, char *data, int len, void *chandle) { SFdObj *pFdObj = (SFdObj *)chandle; diff --git a/src/sdb/src/sdbEngine.c b/src/sdb/src/sdbEngine.c index 0efa81866f3b683b4027662a6b3d015e74d391ce..9a5e6413f3c6e7671d5a198afc7d5068751628d3 100644 --- a/src/sdb/src/sdbEngine.c +++ b/src/sdb/src/sdbEngine.c @@ -807,20 +807,22 @@ void sdbResetTable(SSdbTable *pTable) { int bytes; int total_size = 0; int real_size = 0; - int64_t oldId; SRowHead *rowHead = NULL; void * pMetaRow = NULL; + int64_t oldId = pTable->id; + int oldNumOfRows = pTable->numOfRows; - oldId = pTable->id; if (sdbOpenSdbFile(pTable) < 0) return; + pTable->numOfRows = oldNumOfRows; total_size = sizeof(SRowHead) + pTable->maxRowSize + sizeof(TSCKSUM); rowHead = (SRowHead *)malloc(total_size); if (rowHead == NULL) { + sdbError("failed to allocate row head memory for reset, sdb:%s", pTable->name); return; } - sdbTrace("open sdb file:%s for update", pTable->fn); + sdbPrint("open sdb file:%s for reset table", pTable->fn); while (1) { memset(rowHead, 0, total_size); @@ -841,15 +843,15 @@ void sdbResetTable(SSdbTable *pTable) { } if (rowHead->rowSize < 0 || rowHead->rowSize > pTable->maxRowSize) { - sdbError("error row size in sdb file:%s rowSize:%d maxRowSize:%d", pTable->fn, rowHead->rowSize, - pTable->maxRowSize); + sdbError("error row size in sdb file:%s for reset, id:%d rowSize:%d maxRowSize:%d", + pTable->fn, rowHead->id, rowHead->rowSize, pTable->maxRowSize); pTable->size += sizeof(SRowHead); continue; } bytes = read(pTable->fd, rowHead->data, rowHead->rowSize + sizeof(TSCKSUM)); if (bytes < rowHead->rowSize + sizeof(TSCKSUM)) { - sdbError("failed to read sdb file:%s id:%d rowSize:%d", pTable->fn, rowHead->id, rowHead->rowSize); + sdbError("failed to read sdb file:%s for reset, id:%d rowSize:%d", pTable->fn, rowHead->id, rowHead->rowSize); break; } @@ -897,7 +899,7 @@ void sdbResetTable(SSdbTable *pTable) { tfree(rowHead); - sdbTrace("table:%s is updated, sdbVerion:%ld id:%ld", pTable->name, sdbVersion, pTable->id); + sdbPrint("table:%s is updated, sdbVerion:%ld id:%ld", pTable->name, sdbVersion, pTable->id); } // TODO:A problem here :use snapshot file to sync another node will cause diff --git a/src/system/detail/inc/dnodeSystem.h b/src/system/detail/inc/dnodeSystem.h index 632b723ac0741a4cfe36533e29da2b3f0971f873..96e5699464af1095ae92e74b4e96dd67ae11c81d 100644 --- a/src/system/detail/inc/dnodeSystem.h +++ b/src/system/detail/inc/dnodeSystem.h @@ -21,6 +21,7 @@ extern "C" { #endif #include +#include #define tsetModuleStatus(mod) \ { tsModuleStatus |= (1 << mod); } diff --git a/src/system/detail/inc/mgmt.h b/src/system/detail/inc/mgmt.h index 39a94f320bba4099d933929b599bbc70ab81b77f..24f9822f1616529801ef2eee8ce3ec3dc5fc6f5d 100644 --- a/src/system/detail/inc/mgmt.h +++ b/src/system/detail/inc/mgmt.h @@ -419,7 +419,7 @@ int mgmtRetrieveVnodes(SShowObj *pShow, char *data, int rows, SConnObj *pConn); int mgmtInitBalance(); void mgmtCleanupBalance(); int mgmtAllocVnodes(SVgObj *pVgroup); -void mgmtSetDnodeShellRemoving(SDnodeObj *pDnode); +int mgmtSetDnodeShellRemoving(SDnodeObj *pDnode); void mgmtSetDnodeUnRemove(SDnodeObj *pDnode); void mgmtStartBalanceTimer(int64_t mseconds); void mgmtSetDnodeOfflineOnSdbChanged(); diff --git a/src/system/detail/src/mgmtDb.c b/src/system/detail/src/mgmtDb.c index fb449f4761279c1d452092ce5f8f23a505bfa7e7..b935b68425e053a1a4ed466d65c8c790c701f384 100644 --- a/src/system/detail/src/mgmtDb.c +++ b/src/system/detail/src/mgmtDb.c @@ -668,6 +668,11 @@ int mgmtRetrieveDbs(SShowObj *pShow, char *data, int rows, SConnObj *pConn) { pDb = (SDbObj *)pShow->pNode; if (pDb == NULL) break; pShow->pNode = (void *)pDb->next; + if (mgmtCheckIsMonitorDB(pDb->name, tsMonitorDbName)) { + if (strcmp(pConn->pUser->user, "root") != 0 && strcmp(pConn->pUser->user, "_root") != 0 && strcmp(pConn->pUser->user, "monitor") != 0 ) { + continue; + } + } cols = 0; diff --git a/src/system/detail/src/mgmtDnode.c b/src/system/detail/src/mgmtDnode.c index 2c96b9a3c0e99a4d014bd981a0f2cdd9fddab596..4066dd766996b6e63f9226e4df2f27cebae2738b 100644 --- a/src/system/detail/src/mgmtDnode.c +++ b/src/system/detail/src/mgmtDnode.c @@ -434,10 +434,17 @@ int mgmtGetVnodeMeta(SMeterMeta *pMeta, SShowObj *pShow, SConnObj *pConn) { if (NULL == pDnode) { return TSDB_CODE_NODE_OFFLINE; } + + SVnodeLoad* pVnode; + pShow->numOfRows = 0; + for (int i = 0 ; i < TSDB_MAX_VNODES; i++) { + pVnode = &pDnode->vload[i]; + if (0 != pVnode->vgId) { + pShow->numOfRows++; + } + } - pShow->numOfRows = pDnode->openVnodes; - pShow->pNode = pDnode; - + pShow->pNode = pDnode; } else { while (true) { pShow->pNode = mgmtGetNextDnode(pShow, (SDnodeObj **)&pDnode); diff --git a/src/system/detail/src/mgmtDnodeInt.c b/src/system/detail/src/mgmtDnodeInt.c index 6b6571b06c713bd9b6c41dab690652cf1c6fd639..9da46b019039e360a92972cff2a57830a69a7246 100644 --- a/src/system/detail/src/mgmtDnodeInt.c +++ b/src/system/detail/src/mgmtDnodeInt.c @@ -488,6 +488,7 @@ int mgmtSendCfgDnodeMsg(char *cont) { return code; } +#ifdef CLUSTER pStart = taosBuildReqMsg(pDnode->thandle, TSDB_MSG_TYPE_CFG_PNODE); if (pStart == NULL) return TSDB_CODE_NODE_OFFLINE; pMsg = pStart; @@ -497,6 +498,8 @@ int mgmtSendCfgDnodeMsg(char *cont) { msgLen = pMsg - pStart; taosSendMsgToDnode(pDnode, pStart, msgLen); - +#else + (void)tsCfgDynamicOptions(pCfg->config); +#endif return 0; } diff --git a/src/system/detail/src/mgmtMeter.c b/src/system/detail/src/mgmtMeter.c index 6ff9448c09caf49a6d26bb32d22c1eb4ffa98b5e..22a2ab2a221537edc76006852355522f9d399f1a 100644 --- a/src/system/detail/src/mgmtMeter.c +++ b/src/system/detail/src/mgmtMeter.c @@ -1270,6 +1270,11 @@ int mgmtRetrieveMeters(SShowObj *pShow, char *data, int rows, SConnObj *pConn) { if (pConn->pDb != NULL) pDb = mgmtGetDb(pConn->pDb->name); if (pDb == NULL) return 0; + if (mgmtCheckIsMonitorDB(pDb->name, tsMonitorDbName)) { + if (strcmp(pConn->pUser->user, "root") != 0 && strcmp(pConn->pUser->user, "_root") != 0 && strcmp(pConn->pUser->user, "monitor") != 0 ) { + return 0; + } + } strcpy(prefix, pDb->name); strcat(prefix, TS_PATH_DELIMITER); @@ -1387,6 +1392,16 @@ int mgmtRetrieveMetrics(SShowObj *pShow, char *data, int rows, SConnObj *pConn) char * pWrite; int cols = 0; + SDbObj *pDb = NULL; + if (pConn->pDb != NULL) pDb = mgmtGetDb(pConn->pDb->name); + + if (pDb == NULL) return 0; + if (mgmtCheckIsMonitorDB(pDb->name, tsMonitorDbName)) { + if (strcmp(pConn->pUser->user, "root") != 0 && strcmp(pConn->pUser->user, "_root") != 0 && strcmp(pConn->pUser->user, "monitor") != 0 ) { + return 0; + } + } + SPatternCompareInfo info = PATTERN_COMPARE_INFO_INITIALIZER; char metricName[TSDB_METER_NAME_LEN] = {0}; diff --git a/src/system/detail/src/mgmtShell.c b/src/system/detail/src/mgmtShell.c index c05eece6067accdfc6d4ee775463c93d32debb10..9d4b896fb81b791891d5139913d9c53441221a7f 100644 --- a/src/system/detail/src/mgmtShell.c +++ b/src/system/detail/src/mgmtShell.c @@ -734,8 +734,11 @@ int mgmtProcessAlterUserMsg(char *pMsg, int msgLen, SConnObj *pConn) { if ((pAlter->flag & TSDB_ALTER_USER_PRIVILEGES) != 0) { bool hasRight = false; + if (strcmp(pUser->user, "root") == 0) { hasRight = false; + } else if (strcmp(pUser->user, pUser->acct) == 0) { + hasRight = false; } else if (strcmp(pOperUser->user, "root") == 0) { hasRight = true; } else if (strcmp(pUser->user, pOperUser->user) == 0) { @@ -750,21 +753,24 @@ int mgmtProcessAlterUserMsg(char *pMsg, int msgLen, SConnObj *pConn) { } } + if (pAlter->privilege == 1) { // super + hasRight = false; + } + if (hasRight) { - if ((pAlter->flag & TSDB_ALTER_USER_PRIVILEGES) != 0) { - if (pAlter->privilege == 1) { // super - pUser->superAuth = 1; - pUser->writeAuth = 1; - } - if (pAlter->privilege == 2) { // read - pUser->superAuth = 0; - pUser->writeAuth = 0; - } - if (pAlter->privilege == 3) { // write - pUser->superAuth = 0; - pUser->writeAuth = 1; - } + //if (pAlter->privilege == 1) { // super + // pUser->superAuth = 1; + // pUser->writeAuth = 1; + //} + if (pAlter->privilege == 2) { // read + pUser->superAuth = 0; + pUser->writeAuth = 0; } + if (pAlter->privilege == 3) { // write + pUser->superAuth = 0; + pUser->writeAuth = 1; + } + code = mgmtUpdateUser(pUser); mLPrint("user:%s privilege is altered by %s, code:%d", pAlter->user, pConn->pUser->user, code); } else { diff --git a/src/system/detail/src/mgmtVgroup.c b/src/system/detail/src/mgmtVgroup.c index c9052c094b737842ce6ceca73e44ca237cbc8ad8..15a5fe808b44c5cc3f94f06bb691a11aa8998122 100644 --- a/src/system/detail/src/mgmtVgroup.c +++ b/src/system/detail/src/mgmtVgroup.c @@ -237,11 +237,25 @@ int mgmtGetVgroupMeta(SMeterMeta *pMeta, SShowObj *pShow, SConnObj *pConn) { pSchema[cols].bytes = htons(pShow->bytes[cols]); cols++; - int maxReplica = 0; - SVgObj *pVgroup = pDb->pHead; - while (pVgroup != NULL) { + int maxReplica = 0; + SVgObj *pVgroup = NULL; + STabObj *pMeter = NULL; + if (pShow->payloadLen > 0 ) { + pMeter = mgmtGetMeter(pShow->payload); + if (NULL == pMeter) { + return TSDB_CODE_INVALID_METER_ID; + } + + pVgroup = mgmtGetVgroup(pMeter->gid.vgId); + if (NULL == pVgroup) return TSDB_CODE_INVALID_METER_ID; + maxReplica = pVgroup->numOfVnodes > maxReplica ? pVgroup->numOfVnodes : maxReplica; - pVgroup = pVgroup->next; + } else { + SVgObj *pVgroup = pDb->pHead; + while (pVgroup != NULL) { + maxReplica = pVgroup->numOfVnodes > maxReplica ? pVgroup->numOfVnodes : maxReplica; + pVgroup = pVgroup->next; + } } for (int i = 0; i < maxReplica; ++i) { @@ -276,10 +290,16 @@ int mgmtGetVgroupMeta(SMeterMeta *pMeta, SShowObj *pShow, SConnObj *pConn) { pShow->offset[0] = 0; for (int i = 1; i < cols; ++i) pShow->offset[i] = pShow->offset[i - 1] + pShow->bytes[i - 1]; - pShow->numOfRows = pDb->numOfVgroups; - pShow->pNode = pDb->pHead; pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1]; + if (NULL == pMeter) { + pShow->numOfRows = pDb->numOfVgroups; + pShow->pNode = pDb->pHead; + } else { + pShow->numOfRows = 1; + pShow->pNode = pVgroup; + } + return 0; } diff --git a/src/system/detail/src/vnodeImport.c b/src/system/detail/src/vnodeImport.c index 6bf543e47068cbcce3aca822885b646689b175a4..f7f01a3c69946238130746106f387d536eb0bd6a 100644 --- a/src/system/detail/src/vnodeImport.c +++ b/src/system/detail/src/vnodeImport.c @@ -579,7 +579,12 @@ static int vnodeCloseImportFiles(SMeterObj *pObj, SImportHandle *pHandle) { SVnodeObj *pVnode = vnodeList + pObj->vnode; char dpath[TSDB_FILENAME_LEN] = "\0"; SCompInfo compInfo; - __off_t offset = 0; + +#ifdef _ALPINE + off_t offset = 0; +#else + __off_t offset = 0; +#endif if (pVnode->nfd > 0) { offset = lseek(pVnode->nfd, 0, SEEK_CUR); diff --git a/src/system/detail/src/vnodeMeter.c b/src/system/detail/src/vnodeMeter.c index 7cb4870eb27289e16c6ea3b040751a5af2a986a9..06d0fd8b681e10a6d489006fec9a1fc4b28b12e2 100644 --- a/src/system/detail/src/vnodeMeter.c +++ b/src/system/detail/src/vnodeMeter.c @@ -563,8 +563,8 @@ int vnodeInsertPoints(SMeterObj *pObj, char *cont, int contLen, char source, voi if (numOfPoints >= (pVnode->cfg.blocksPerMeter - 2) * pObj->pointsPerBlock) { code = TSDB_CODE_BATCH_SIZE_TOO_BIG; - dError("vid:%d sid:%d id:%s, batch size too big, it shall be smaller than:%d", pObj->vnode, pObj->sid, - pObj->meterId, (pVnode->cfg.blocksPerMeter - 2) * pObj->pointsPerBlock); + dError("vid:%d sid:%d id:%s, batch size too big, insert points:%d, it shall be smaller than:%d", pObj->vnode, pObj->sid, + pObj->meterId, numOfPoints, (pVnode->cfg.blocksPerMeter - 2) * pObj->pointsPerBlock); return code; } diff --git a/src/system/detail/src/vnodeQueryImpl.c b/src/system/detail/src/vnodeQueryImpl.c index db5eafa77948de9405c508d73fe62bf4ff6e415a..138e349c6659990e2e71fa8e202247ea462d4901 100644 --- a/src/system/detail/src/vnodeQueryImpl.c +++ b/src/system/detail/src/vnodeQueryImpl.c @@ -3380,10 +3380,8 @@ void forwardQueryStartPosition(SQueryRuntimeEnv *pRuntimeEnv) { updateOffsetVal(pRuntimeEnv, &blockInfo, pBlock); } else { pQuery->limit.offset -= maxReads; - // update the lastkey, since the following skip operation may traverse to another media. update the lastkey first. - pQuery->lastKey = (QUERY_IS_ASC_QUERY(pQuery))? blockInfo.keyLast+1:blockInfo.keyFirst-1; - + pQuery->lastKey = (QUERY_IS_ASC_QUERY(pQuery))? blockInfo.keyLast+1:blockInfo.keyFirst-1; doSkipDataBlock(pRuntimeEnv); } } @@ -4289,8 +4287,8 @@ static int32_t moveToNextBlock(SQueryRuntimeEnv *pRuntimeEnv, int32_t step, __bl return DISK_DATA_LOADED; } else { - pQuery->pos = (step == QUERY_ASC_FORWARD_STEP) ? 0 : pQuery->pBlock[pQuery->slot].numOfPoints - 1; pQuery->slot = (step == QUERY_ASC_FORWARD_STEP) ? 0 : pQuery->numOfBlocks - 1; + pQuery->pos = (step == QUERY_ASC_FORWARD_STEP) ? 0 : pQuery->pBlock[pQuery->slot].numOfPoints - 1; } } else { // next block in the same file int32_t fid = pQuery->fileId; diff --git a/src/system/detail/src/vnodeStatus.c b/src/system/detail/src/vnodeStatus.c index 4756496f4018c23d2890139009d27636f8cc3af8..d7b593ec139f920792f5b71ca150331360d69b6a 100644 --- a/src/system/detail/src/vnodeStatus.c +++ b/src/system/detail/src/vnodeStatus.c @@ -52,7 +52,7 @@ const char* taosGetVnodeStatusStr(int32_t vnodeStatus) { const char* taosGetVnodeSyncStatusStr(int32_t vnodeSyncStatus) { switch (vnodeSyncStatus) { - case TSDB_VN_SYNC_STATUS_INIT: return "init"; + case TSDB_VN_SYNC_STATUS_INIT: return "ready"; case TSDB_VN_SYNC_STATUS_SYNCING: return "syncing"; case TSDB_VN_SYNC_STATUS_SYNC_CACHE: return "sync_cache"; case TSDB_VN_SYNC_STATUS_SYNC_FILE: return "sync_file"; diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 5e84f3feadbf4f8cee66c334ac62465ed081936e..f88e5d6396fcd6762a6f1fb42e7b97ec46113354 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -57,7 +57,6 @@ ELSEIF (TD_WINDOWS_64) LIST(APPEND SRC ./src/tsched.c) LIST(APPEND SRC ./src/tskiplist.c) LIST(APPEND SRC ./src/tsocket.c) - LIST(APPEND SRC ./src/tstatus.c) LIST(APPEND SRC ./src/tstrbuild.c) LIST(APPEND SRC ./src/ttime.c) LIST(APPEND SRC ./src/ttimer.c) diff --git a/src/util/src/hash.c b/src/util/src/hash.c index 90aa8cfaa5267a241aed91f0fa1531a332d60125..42948f3563e715cb3f2dfb057d6991d021ddd487 100644 --- a/src/util/src/hash.c +++ b/src/util/src/hash.c @@ -536,4 +536,6 @@ int32_t taosCheckHashTable(HashObj *pObj) { assert(num == pEntry->num); } } + + return 0; } diff --git a/src/util/src/textbuffer.c b/src/util/src/textbuffer.c index 98eca265250c8917c1e38e79e365174a93a1154d..3e71d90147aaa0e4e94992ad6846d7bf5efbbc28 100644 --- a/src/util/src/textbuffer.c +++ b/src/util/src/textbuffer.c @@ -895,8 +895,7 @@ static FORCE_INLINE int32_t columnValueAscendingComparator(char *f1, char *f2, i return (ret < 0) ? -1 : 1; }; case TSDB_DATA_TYPE_NCHAR: { - int32_t b = bytes / TSDB_NCHAR_SIZE; - int32_t ret = wcsncmp((wchar_t *)f1, (wchar_t *)f2, b); + int32_t ret = tasoUcs4Compare(f1, f2, bytes); if (ret == 0) { return 0; } diff --git a/src/util/src/tglobalcfg.c b/src/util/src/tglobalcfg.c index 4d4bace68136d0cfd487c1e7f24f372eec50ab1d..2db036824deea494682a3ae0a8bcd7e0bd84d0c5 100644 --- a/src/util/src/tglobalcfg.c +++ b/src/util/src/tglobalcfg.c @@ -56,7 +56,11 @@ int tscEmbedded = 0; */ int64_t tsMsPerDay[] = {86400000L, 86400000000L}; +#ifdef CLUSTER char tsMasterIp[TSDB_IPv4ADDR_LEN] = {0}; +#else +char tsMasterIp[TSDB_IPv4ADDR_LEN] = "127.0.0.1"; +#endif char tsSecondIp[TSDB_IPv4ADDR_LEN] = {0}; uint16_t tsMgmtShellPort = 6030; // udp[6030-6034] tcp[6030] uint16_t tsVnodeShellPort = 6035; // udp[6035-6039] tcp[6035] @@ -76,7 +80,6 @@ float tsNumOfThreadsPerCore = 1.0; float tsRatioOfQueryThreads = 0.5; char tsPublicIp[TSDB_IPv4ADDR_LEN] = {0}; char tsPrivateIp[TSDB_IPv4ADDR_LEN] = {0}; -char tsServerIpStr[TSDB_IPv4ADDR_LEN] = "127.0.0.1"; short tsNumOfVnodesPerCore = 8; short tsNumOfTotalVnodes = 0; short tsCheckHeaderFile = 0; @@ -118,7 +121,7 @@ int tsBalanceMonitorInterval = 2; // seconds int tsBalanceStartInterval = 300; // seconds int tsBalancePolicy = 0; // 1-use sys.montor int tsOfflineThreshold = 864000; // seconds 10days -int tsMgmtEqualVnodeNum = 0; +int tsMgmtEqualVnodeNum = 4; int tsEnableHttpModule = 1; int tsEnableMonitorModule = 1; @@ -160,7 +163,6 @@ int tsHttpMaxThreads = 2; int tsHttpEnableCompress = 0; int tsHttpEnableRecordSql = 0; int tsTelegrafUseFieldNum = 0; -int tsAdminRowLimit = 10240; int tsTscEnableRecordSql = 0; int tsEnableCoreFile = 0; @@ -447,9 +449,6 @@ static void doInitGlobalConfig() { tsInitConfigOption(cfg++, "secondIp", tsSecondIp, TSDB_CFG_VTYPE_IPSTR, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT | TSDB_CFG_CTYPE_B_CLUSTER, 0, 0, TSDB_IPv4ADDR_LEN, TSDB_CFG_UTYPE_NONE); - tsInitConfigOption(cfg++, "serverIp", tsServerIpStr, TSDB_CFG_VTYPE_IPSTR, - TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT | TSDB_CFG_CTYPE_B_LITE, - 0, 0, TSDB_IPv4ADDR_LEN, TSDB_CFG_UTYPE_NONE); tsInitConfigOption(cfg++, "publicIp", tsPublicIp, TSDB_CFG_VTYPE_IPSTR, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLUSTER, 0, 0, TSDB_IPv4ADDR_LEN, TSDB_CFG_UTYPE_NONE); diff --git a/src/util/src/tutil.c b/src/util/src/tutil.c index ef4bcb95cbe4944938cee447898da96f7480927f..21d147d9473fb643df3bdc719aa19699619ea2d7 100644 --- a/src/util/src/tutil.c +++ b/src/util/src/tutil.c @@ -401,6 +401,46 @@ int32_t taosFileRename(char *fullPath, char *suffix, char delimiter, char **dstP return rename(fullPath, *dstPath); } +int tasoUcs4Compare(void* f1_ucs4, void *f2_ucs4, int bytes) { +#if defined WINDOWS + for (int i = 0; i < bytes; ++i) { + int32_t f1 = *(int32_t*)((char*)f1_ucs4 + i * 4); + int32_t f2 = *(int32_t*)((char*)f2_ucs4 + i * 4); + + if ((f1 == 0 && f2 != 0) || (f1 != 0 && f2 == 0)) { + return f1 - f2; + } + else if (f1 == 0 && f2 == 0) { + return 0; + } + + if (f1 != f2) { + return f1 - f2; + } + } + return 0; + +#if 0 + int32_t ucs4_max_len = bytes + 4; + char *f1_mbs = calloc(bytes, 1); + char *f2_mbs = calloc(bytes, 1); + if (!taosUcs4ToMbs(f1_ucs4, ucs4_max_len, f1_mbs)) { + return -1; + } + if (!taosUcs4ToMbs(f2_ucs4, ucs4_max_len, f2_mbs)) { + return -1; + } + int32_t ret = strcmp(f1_mbs, f2_mbs); + free(f1_mbs); + free(f2_mbs); + return ret; +#endif + +#else + return wcsncmp((wchar_t *)f1_ucs4, (wchar_t *)f2_ucs4, bytes / TSDB_NCHAR_SIZE); +#endif +} + bool taosUcs4ToMbs(void *ucs4, int32_t ucs4_max_len, char *mbs) { #ifdef USE_LIBICONV iconv_t cd = iconv_open(tsCharset, DEFAULT_UNICODE_ENCODEC); diff --git a/src/util/src/version.c b/src/util/src/version.c index c85289fb8ad2f661ec4786c20b3e8ec6207b561d..9d75eb897436037babfac1e27610950cd9aaf094 100644 --- a/src/util/src/version.c +++ b/src/util/src/version.c @@ -1,5 +1,5 @@ -char version[64] = "1.6.4.4"; +char version[64] = "1.6.5.1"; char compatible_version[64] = "1.6.1.0"; -char gitinfo[128] = "d62c5c30231d04a736d437cf428af6e12599bd9f"; -char gitinfoOfInternal[128] = "8094a32d78dc519bd883d01ac2ba6ec49ac57a80"; -char buildinfo[512] = "Built by ubuntu at 2019-12-16 21:40"; +char gitinfo[128] = "2ea714387009421beb35e7f03b94c6a87d22529a"; +char gitinfoOfInternal[128] = "950f54ac026bc05bcec5cff356f4964a18d635bd"; +char buildinfo[512] = "Built by ubuntu at 2019-12-21 11:14";