Merge pull request #28620 from taosdata/main

merge: from main to 3.0
This commit is contained in:
Shengliang Guan 2024-11-02 12:06:20 +08:00 committed by GitHub
commit a71aacbb13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 1109 additions and 403 deletions

View File

@ -191,48 +191,11 @@ ELSE()
SET(COMPILER_SUPPORT_AVX512VL false)
ELSE()
CHECK_C_COMPILER_FLAG("-mfma" COMPILER_SUPPORT_FMA)
CHECK_C_COMPILER_FLAG("-mavx" COMPILER_SUPPORT_AVX)
CHECK_C_COMPILER_FLAG("-mavx2" COMPILER_SUPPORT_AVX2)
CHECK_C_COMPILER_FLAG("-mavx512f" COMPILER_SUPPORT_AVX512F)
CHECK_C_COMPILER_FLAG("-mavx512vbmi" COMPILER_SUPPORT_AVX512BMI)
CHECK_C_COMPILER_FLAG("-mavx512vl" COMPILER_SUPPORT_AVX512VL)
INCLUDE(CheckCSourceRuns)
SET(CMAKE_REQUIRED_FLAGS "-mavx")
check_c_source_runs("
#include <immintrin.h>
int main() {
__m256d a, b, c;
double buf[4] = {0};
a = _mm256_loadu_pd(buf);
b = _mm256_loadu_pd(buf);
c = _mm256_add_pd(a, b);
_mm256_storeu_pd(buf, c);
for (int i = 0; i < sizeof(buf) / sizeof(buf[0]); ++i) {
IF (buf[i] != 0) {
return 1;
}
}
return 0;
}
" COMPILER_SUPPORT_AVX)
SET(CMAKE_REQUIRED_FLAGS "-mavx2")
check_c_source_runs("
#include <immintrin.h>
int main() {
__m256i a, b, c;
int buf[8] = {0};
a = _mm256_loadu_si256((__m256i *)buf);
b = _mm256_loadu_si256((__m256i *)buf);
c = _mm256_and_si256(a, b);
_mm256_storeu_si256((__m256i *)buf, c);
for (int i = 0; i < sizeof(buf) / sizeof(buf[0]); ++i) {
IF (buf[i] != 0) {
return 1;
}
}
return 0;
}
" COMPILER_SUPPORT_AVX2)
ENDIF()
IF(COMPILER_SUPPORT_SSE42)

View File

@ -8,7 +8,7 @@ toc_max_heading_level: 4
## 基本查询
为了更好的介绍 TDengine 数据查询,使用 如下 taosBenchmark 命令,生成本章内容需要的时序数据。
为了更好的介绍 TDengine 数据查询,使用如下 taosBenchmark 命令,生成本章内容需要的时序数据。
```shell
taosBenchmark --start-timestamp=1600000000000 --tables=100 --records=10000000 --time-step=10000
@ -25,7 +25,7 @@ ORDER BY ts DESC
LIMIT 5;
```
上面的 SQL从超级表 `meters` 中查询出电压 `voltage` 大于 230 的记录,按时间降序排列,且仅输出前 5 行。查询结果如下:
上面的 SQL从超级表 `meters` 中查询出电压 `voltage` 大于 230V 的记录,按时间降序排列,且仅输出前 5 行。查询结果如下:
```text
ts | current | voltage | phase | groupid | location |

View File

@ -64,7 +64,7 @@ database_option: {
- MAXROWS文件块中记录的最大条数默认为 4096 条。
- MINROWS文件块中记录的最小条数默认为 100 条。
- KEEP表示数据文件保存的天数缺省值为 3650取值范围 [1, 365000]且必须大于或等于3倍的 DURATION 参数值。数据库会自动删除保存时间超过 KEEP 值的数据。KEEP 可以使用加单位的表示形式,如 KEEP 100h、KEEP 10d 等,支持 m分钟、h小时和 d三个单位。也可以不写单位如 KEEP 50此时默认单位为天。企业版支持[多级存储](https://docs.taosdata.com/tdinternal/arch/#%E5%A4%9A%E7%BA%A7%E5%AD%98%E5%82%A8)功能, 因此, 可以设置多个保存时间(多个以英文逗号分隔,最多 3 个,满足 keep 0 \<= keep 1 \<= keep 2如 KEEP 100h,100d,3650d; 社区版不支持多级存储功能(即使配置了多个保存时间, 也不会生效, KEEP 会取最大的保存时间)。
- STT_TRIGGER表示落盘文件触发文件合并的个数。默认为 1范围 1 到 16。对于少表高频场景此参数建议使用默认配置或较小的值而对于多表低频场景,此参数建议配置较大的值。
- STT_TRIGGER表示落盘文件触发文件合并的个数。开源版本固定为 1企业版本可设置范围为 1 到 16。对于少表高频写入场景此参数建议使用默认配置而对于多表低频写入场景,此参数建议配置较大的值。
- SINGLE_STABLE表示此数据库中是否只可以创建一个超级表用于超级表列非常多的情况。
- 0表示可以创建多张超级表。
- 1表示只可以创建一张超级表。
@ -76,8 +76,8 @@ database_option: {
- 1写 WAL但不执行 fsync。
- 2写 WAL而且执行 fsync。
- WAL_FSYNC_PERIOD当 WAL_LEVEL 参数设置为 2 时,用于设置落盘的周期。默认为 3000单位毫秒。最小为 0表示每次写入立即落盘最大为 180000即三分钟。
- WAL_RETENTION_PERIOD: 为了数据订阅消费需要WAL日志文件额外保留的最大时长策略。WAL日志清理不受订阅客户端消费状态影响。单位为 s。默认为 3600表示在 WAL 保留最近 3600 秒的数据,请根据数据订阅的需要修改这个参数为适当值。
- WAL_RETENTION_SIZE为了数据订阅消费需要WAL日志文件额外保留的最大累计大小策略。单位为 KB。默认为 0表示累计大小无上限。
- WAL_RETENTION_PERIOD: 为了数据订阅消费,需要 WAL 日志文件额外保留的最大时长策略。WAL 日志清理,不受订阅客户端消费状态影响。单位为 s。默认为 3600表示在 WAL 保留最近 3600 秒的数据,请根据数据订阅的需要修改这个参数为适当值。
- WAL_RETENTION_SIZE为了数据订阅消费需要 WAL 日志文件额外保留的最大累计大小策略。单位为 KB。默认为 0表示累计大小无上限。
### 创建数据库示例
```sql

View File

@ -11,7 +11,7 @@ description: 使用标签索引提升查询性能
创建索引的语法如下
```sql
CREATE INDEX index_name ON tbl_name (tagColName
CREATE INDEX index_name ON tbl_name (tagColName)
```
其中 `index_name` 为索引名称, `tbl_name` 为超级表名称,`tagColName` 为要在其上建立索引的 tag 列的名称。`tagColName` 的类型不受限制,即任何类型的 tag 列都可以建立索引。

View File

@ -152,15 +152,12 @@ int32_t tsDecompressBigint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int
// for internal usage
int32_t getWordLength(char type);
#ifdef __AVX2__
int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, char *const output, const char type);
int32_t tsDecompressFloatImpAvx2(const char *input, int32_t nelements, char *output);
int32_t tsDecompressDoubleImpAvx2(const char *input, int32_t nelements, char *output);
#endif
#ifdef __AVX512VL__
void tsDecompressTimestampAvx2(const char *input, int32_t nelements, char *output, bool bigEndian);
void tsDecompressTimestampAvx512(const char *const input, const int32_t nelements, char *const output, bool bigEndian);
#endif
int32_t tsDecompressTimestampAvx2(const char *input, int32_t nelements, char *output, bool bigEndian);
int32_t tsDecompressTimestampAvx512(const char *const input, const int32_t nelements, char *const output,
bool bigEndian);
/*************************************************************************
* REGULAR COMPRESSION 2

View File

@ -41,6 +41,7 @@ extern const int32_t TYPE_BYTES[21];
#define FLOAT_BYTES sizeof(float)
#define DOUBLE_BYTES sizeof(double)
#define POINTER_BYTES sizeof(void *)
#define M256_BYTES 32
#define TSDB_KEYSIZE sizeof(TSKEY)
#define TSDB_NCHAR_SIZE sizeof(TdUcs4)

View File

@ -363,6 +363,9 @@ int8_t validColEncode(uint8_t type, uint8_t l1) {
if (l1 == TSDB_COLVAL_ENCODE_NOCHANGE) {
return 1;
}
if (l1 == TSDB_COLVAL_ENCODE_DISABLED) {
return 1;
}
if (type == TSDB_DATA_TYPE_BOOL) {
return TSDB_COLVAL_ENCODE_RLE == l1 ? 1 : 0;
} else if (type >= TSDB_DATA_TYPE_TINYINT && type <= TSDB_DATA_TYPE_INT) {

View File

@ -1264,6 +1264,9 @@ static SSDataBlock* buildStreamPartitionResult(SOperatorInfo* pOperator) {
SPartitionDataInfo* pParInfo = (SPartitionDataInfo*)pInfo->parIte;
blockDataCleanup(pDest);
int32_t rows = taosArrayGetSize(pParInfo->rowIds);
code = blockDataEnsureCapacity(pDest, rows);
QUERY_CHECK_CODE(code, lino, _end);
SSDataBlock* pSrc = pInfo->pInputDataBlock;
for (int32_t i = 0; i < rows; i++) {
int32_t rowIndex = *(int32_t*)taosArrayGet(pParInfo->rowIds, i);

View File

@ -42,7 +42,7 @@ typedef struct STimeSliceOperatorInfo {
SRowKey prevKey;
bool prevTsSet;
uint64_t groupId;
SGroupKeys* pPrevGroupKey;
SArray* pPrevGroupKeys;
SSDataBlock* pNextGroupRes;
SSDataBlock* pRemainRes; // save block unfinished processing
int32_t remainIndex; // the remaining index in the block to be processed
@ -288,6 +288,7 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
// output the result
int32_t fillColIndex = 0;
int32_t groupKeyIndex = 0;
bool hasInterp = true;
for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) {
SExprInfo* pExprInfo = &pExprSup->pExprInfo[j];
@ -320,7 +321,9 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
QUERY_CHECK_CODE(code, lino, _end);
} else if (!isSelectGroupConstValueFunc(pExprInfo)) {
// use stored group key
SGroupKeys* pkey = pSliceInfo->pPrevGroupKey;
SGroupKeys *pkey = taosArrayGet(pSliceInfo->pPrevGroupKeys, groupKeyIndex);
QUERY_CHECK_NULL(pkey, code, lino, _end, terrno);
groupKeyIndex++;
if (pkey->isNull == false) {
code = colDataSetVal(pDst, rows, pkey->pData, false);
QUERY_CHECK_CODE(code, lino, _end);
@ -645,13 +648,20 @@ _end:
return code;
}
static void destroyGroupKey(void* pKey) {
SGroupKeys* key = (SGroupKeys*)pKey;
if (key->pData != NULL) {
taosMemoryFreeClear(key->pData);
}
}
static int32_t initGroupKeyKeeper(STimeSliceOperatorInfo* pInfo, SExprSupp* pExprSup) {
if (pInfo->pPrevGroupKey != NULL) {
if (pInfo->pPrevGroupKeys != NULL) {
return TSDB_CODE_SUCCESS;
}
pInfo->pPrevGroupKey = taosMemoryCalloc(1, sizeof(SGroupKeys));
if (pInfo->pPrevGroupKey == NULL) {
pInfo->pPrevGroupKeys = taosArrayInit(pExprSup->numOfExprs, sizeof(SGroupKeys));
if (pInfo->pPrevGroupKeys == NULL) {
return terrno;
}
@ -659,11 +669,19 @@ static int32_t initGroupKeyKeeper(STimeSliceOperatorInfo* pInfo, SExprSupp* pExp
SExprInfo* pExprInfo = &pExprSup->pExprInfo[i];
if (isGroupKeyFunc(pExprInfo)) {
pInfo->pPrevGroupKey->bytes = pExprInfo->base.resSchema.bytes;
pInfo->pPrevGroupKey->type = pExprInfo->base.resSchema.type;
pInfo->pPrevGroupKey->isNull = false;
pInfo->pPrevGroupKey->pData = taosMemoryCalloc(1, pInfo->pPrevGroupKey->bytes);
if (!pInfo->pPrevGroupKey->pData) {
SGroupKeys key = {.bytes = pExprInfo->base.resSchema.bytes,
.type = pExprInfo->base.resSchema.type,
.isNull = false,
.pData = taosMemoryCalloc(1, pExprInfo->base.resSchema.bytes)};
if (!key.pData) {
taosArrayDestroyEx(pInfo->pPrevGroupKeys, destroyGroupKey);
pInfo->pPrevGroupKeys = NULL;
return terrno;
}
if (NULL == taosArrayPush(pInfo->pPrevGroupKeys, &key)) {
taosMemoryFree(key.pData);
taosArrayDestroyEx(pInfo->pPrevGroupKeys, destroyGroupKey);
pInfo->pPrevGroupKeys = NULL;
return terrno;
}
}
@ -910,7 +928,7 @@ static void genInterpAfterDataBlock(STimeSliceOperatorInfo* pSliceInfo, SOperato
SInterval* pInterval = &pSliceInfo->interval;
if (pSliceInfo->fillType == TSDB_FILL_NEXT || pSliceInfo->fillType == TSDB_FILL_LINEAR ||
pSliceInfo->pPrevGroupKey == NULL) {
pSliceInfo->pPrevGroupKeys == NULL) {
return;
}
@ -921,12 +939,18 @@ static void genInterpAfterDataBlock(STimeSliceOperatorInfo* pSliceInfo, SOperato
}
}
static void copyPrevGroupKey(SExprSupp* pExprSup, SGroupKeys* pGroupKey, SSDataBlock* pSrcBlock) {
static int32_t copyPrevGroupKey(SExprSupp* pExprSup, SArray * pGroupKeys, SSDataBlock* pSrcBlock) {
int32_t groupKeyIdx = 0;
for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) {
SExprInfo* pExprInfo = &pExprSup->pExprInfo[j];
if (isGroupKeyFunc(pExprInfo)) {
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
SGroupKeys *pGroupKey = taosArrayGet(pGroupKeys, groupKeyIdx);
if (pGroupKey == NULL) {
return terrno;
}
groupKeyIdx++;
SColumnInfoData* pSrc = taosArrayGet(pSrcBlock->pDataBlock, srcSlot);
if (colDataIsNull_s(pSrc, 0)) {
@ -942,9 +966,9 @@ static void copyPrevGroupKey(SExprSupp* pExprSup, SGroupKeys* pGroupKey, SSDataB
}
pGroupKey->isNull = false;
break;
}
}
return TSDB_CODE_SUCCESS;
}
static void resetTimesliceInfo(STimeSliceOperatorInfo* pSliceInfo) {
@ -986,7 +1010,11 @@ static void doHandleTimeslice(SOperatorInfo* pOperator, SSDataBlock* pBlock) {
T_LONG_JMP(pTaskInfo->env, code);
}
doTimesliceImpl(pOperator, pSliceInfo, pBlock, pTaskInfo, ignoreNull);
copyPrevGroupKey(&pOperator->exprSupp, pSliceInfo->pPrevGroupKey, pBlock);
code = copyPrevGroupKey(&pOperator->exprSupp, pSliceInfo->pPrevGroupKeys, pBlock);
if (code != TSDB_CODE_SUCCESS) {
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
T_LONG_JMP(pTaskInfo->env, code);
}
}
static int32_t doTimesliceNext(SOperatorInfo* pOperator, SSDataBlock** ppRes) {
@ -1160,7 +1188,7 @@ int32_t createTimeSliceOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyN
pInfo->prevTsSet = false;
pInfo->prevKey.ts = INT64_MIN;
pInfo->groupId = 0;
pInfo->pPrevGroupKey = NULL;
pInfo->pPrevGroupKeys = NULL;
pInfo->pNextGroupRes = NULL;
pInfo->pRemainRes = NULL;
pInfo->remainIndex = 0;
@ -1233,9 +1261,9 @@ void destroyTimeSliceOperatorInfo(void* param) {
}
taosArrayDestroy(pInfo->pLinearInfo);
if (pInfo->pPrevGroupKey) {
taosMemoryFree(pInfo->pPrevGroupKey->pData);
taosMemoryFree(pInfo->pPrevGroupKey);
if (pInfo->pPrevGroupKeys) {
taosArrayDestroyEx(pInfo->pPrevGroupKeys, destroyGroupKey);
pInfo->pPrevGroupKeys = NULL;
}
if (pInfo->hasPk && IS_VAR_DATA_TYPE(pInfo->pkCol.type)) {
taosMemoryFreeClear(pInfo->prevKey.pks[0].pData);

View File

@ -1,6 +1,10 @@
aux_source_directory(src FUNCTION_SRC)
aux_source_directory(src/detail FUNCTION_SRC_DETAIL)
list(REMOVE_ITEM FUNCTION_SRC src/udfd.c)
IF(COMPILER_SUPPORT_AVX2)
MESSAGE(STATUS "AVX2 instructions is ACTIVATED")
set_source_files_properties(src/detail/tminmaxavx.c PROPERTIES COMPILE_FLAGS -mavx2)
ENDIF()
add_library(function STATIC ${FUNCTION_SRC} ${FUNCTION_SRC_DETAIL})
target_include_directories(
function

View File

@ -25,6 +25,11 @@ extern "C" {
#include "functionResInfoInt.h"
int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems);
int32_t i8VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res);
int32_t i16VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res);
int32_t i32VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res);
int32_t floatVectorCmpAVX2(const float* pData, int32_t numOfRows, bool isMinFunc, float* res);
int32_t doubleVectorCmpAVX2(const double* pData, int32_t numOfRows, bool isMinFunc, double* res);
int32_t saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pSrcBlock, STuplePos* pPos);
int32_t updateTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pSrcBlock, STuplePos* pPos);

View File

@ -72,173 +72,6 @@
#define GET_INVOKE_INTRINSIC_THRESHOLD(_bits, _bytes) ((_bits) / ((_bytes) << 3u))
#ifdef __AVX2__
static void calculateRounds(int32_t numOfRows, int32_t bytes, int32_t* remainder, int32_t* rounds, int32_t* width) {
const int32_t bitWidth = 256;
*width = (bitWidth >> 3u) / bytes;
*remainder = numOfRows % (*width);
*rounds = numOfRows / (*width);
}
#define EXTRACT_MAX_VAL(_first, _sec, _width, _remain, _v) \
__COMPARE_EXTRACT_MAX(0, (_width), (_v), (_first)) \
__COMPARE_EXTRACT_MAX(0, (_remain), (_v), (_sec))
#define EXTRACT_MIN_VAL(_first, _sec, _width, _remain, _v) \
__COMPARE_EXTRACT_MIN(0, (_width), (_v), (_first)) \
__COMPARE_EXTRACT_MIN(0, (_remain), (_v), (_sec))
#define CMP_TYPE_MIN_MAX(type, cmp) \
const type* p = pData; \
__m256i initVal = _mm256_lddqu_si256((__m256i*)p); \
p += width; \
for (int32_t i = 1; i < (rounds); ++i) { \
__m256i next = _mm256_lddqu_si256((__m256i*)p); \
initVal = CMP_FUNC_##cmp##_##type(initVal, next); \
p += width; \
} \
const type* q = (const type*)&initVal; \
type* v = (type*)res; \
EXTRACT_##cmp##_VAL(q, p, width, remain, *v)
static void i8VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res) {
const int8_t* p = pData;
int32_t width, remain, rounds;
calculateRounds(numOfRows, sizeof(int8_t), &remain, &rounds, &width);
#define CMP_FUNC_MIN_int8_t _mm256_min_epi8
#define CMP_FUNC_MAX_int8_t _mm256_max_epi8
#define CMP_FUNC_MIN_uint8_t _mm256_min_epu8
#define CMP_FUNC_MAX_uint8_t _mm256_max_epu8
if (!isMinFunc) { // max function
if (signVal) {
CMP_TYPE_MIN_MAX(int8_t, MAX);
} else {
CMP_TYPE_MIN_MAX(uint8_t, MAX);
}
} else { // min function
if (signVal) {
CMP_TYPE_MIN_MAX(int8_t, MIN);
} else {
CMP_TYPE_MIN_MAX(uint8_t, MIN);
}
}
}
static void i16VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res) {
int32_t width, remain, rounds;
calculateRounds(numOfRows, sizeof(int16_t), &remain, &rounds, &width);
#define CMP_FUNC_MIN_int16_t _mm256_min_epi16
#define CMP_FUNC_MAX_int16_t _mm256_max_epi16
#define CMP_FUNC_MIN_uint16_t _mm256_min_epu16
#define CMP_FUNC_MAX_uint16_t _mm256_max_epu16
if (!isMinFunc) { // max function
if (signVal) {
CMP_TYPE_MIN_MAX(int16_t, MAX);
} else {
CMP_TYPE_MIN_MAX(uint16_t, MAX);
}
} else { // min function
if (signVal) {
CMP_TYPE_MIN_MAX(int16_t, MIN);
} else {
CMP_TYPE_MIN_MAX(uint16_t, MIN);
}
}
}
static void i32VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res) {
int32_t width, remain, rounds;
calculateRounds(numOfRows, sizeof(int32_t), &remain, &rounds, &width);
#define CMP_FUNC_MIN_int32_t _mm256_min_epi32
#define CMP_FUNC_MAX_int32_t _mm256_max_epi32
#define CMP_FUNC_MIN_uint32_t _mm256_min_epu32
#define CMP_FUNC_MAX_uint32_t _mm256_max_epu32
if (!isMinFunc) { // max function
if (signVal) {
CMP_TYPE_MIN_MAX(int32_t, MAX);
} else {
CMP_TYPE_MIN_MAX(uint32_t, MAX);
}
} else { // min function
if (signVal) {
CMP_TYPE_MIN_MAX(int32_t, MIN);
} else {
CMP_TYPE_MIN_MAX(uint32_t, MIN);
}
}
}
static void floatVectorCmpAVX2(const float* pData, int32_t numOfRows, bool isMinFunc, float* res) {
const float* p = pData;
int32_t width, remain, rounds;
calculateRounds(numOfRows, sizeof(float), &remain, &rounds, &width);
__m256 next;
__m256 initVal = _mm256_loadu_ps(p);
p += width;
if (!isMinFunc) { // max function
for (int32_t i = 1; i < rounds; ++i) {
next = _mm256_loadu_ps(p);
initVal = _mm256_max_ps(initVal, next);
p += width;
}
const float* q = (const float*)&initVal;
EXTRACT_MAX_VAL(q, p, width, remain, *res)
} else { // min function
for (int32_t i = 1; i < rounds; ++i) {
next = _mm256_loadu_ps(p);
initVal = _mm256_min_ps(initVal, next);
p += width;
}
const float* q = (const float*)&initVal;
EXTRACT_MIN_VAL(q, p, width, remain, *res)
}
}
static void doubleVectorCmpAVX2(const double* pData, int32_t numOfRows, bool isMinFunc, double* res) {
const double* p = pData;
int32_t width, remain, rounds;
calculateRounds(numOfRows, sizeof(double), &remain, &rounds, &width);
__m256d next;
__m256d initVal = _mm256_loadu_pd(p);
p += width;
if (!isMinFunc) { // max function
for (int32_t i = 1; i < rounds; ++i) {
next = _mm256_loadu_pd(p);
initVal = _mm256_max_pd(initVal, next);
p += width;
}
// let sum up the final results
const double* q = (const double*)&initVal;
EXTRACT_MAX_VAL(q, p, width, remain, *res)
} else { // min function
for (int32_t i = 1; i < rounds; ++i) {
next = _mm256_loadu_pd(p);
initVal = _mm256_min_pd(initVal, next);
p += width;
}
// let sum up the final results
const double* q = (const double*)&initVal;
EXTRACT_MIN_VAL(q, p, width, remain, *res)
}
}
#endif
static int32_t findFirstValPosition(const SColumnInfoData* pCol, int32_t start, int32_t numOfRows, bool isStr) {
int32_t i = start;
@ -255,13 +88,14 @@ static void handleInt8Col(const void* data, int32_t start, int32_t numOfRows, SM
pBuf->v = ((const int8_t*)data)[start];
}
#ifdef __AVX2__
if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(int8_t) >= sizeof(__m256i)) {
i8VectorCmpAVX2(data + start * sizeof(int8_t), numOfRows, isMinFunc, signVal, &pBuf->v);
} else {
#else
if (true) {
#endif
if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(int8_t) >= M256_BYTES) {
int32_t code = i8VectorCmpAVX2(((char*)data) + start * sizeof(int8_t), numOfRows, isMinFunc, signVal, &pBuf->v);
if (code == TSDB_CODE_SUCCESS) {
pBuf->assign = true;
return;
}
}
if (signVal) {
const int8_t* p = (const int8_t*)data;
int8_t* v = (int8_t*)&pBuf->v;
@ -281,7 +115,6 @@ static void handleInt8Col(const void* data, int32_t start, int32_t numOfRows, SM
__COMPARE_EXTRACT_MAX(start, start + numOfRows, *v, p);
}
}
}
pBuf->assign = true;
}
@ -292,13 +125,14 @@ static void handleInt16Col(const void* data, int32_t start, int32_t numOfRows, S
pBuf->v = ((const int16_t*)data)[start];
}
#ifdef __AVX2__
if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(int16_t) >= sizeof(__m256i)) {
i16VectorCmpAVX2(data + start * sizeof(int16_t), numOfRows, isMinFunc, signVal, &pBuf->v);
} else {
#else
if (true) {
#endif
if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(int16_t) >= M256_BYTES) {
int32_t code = i16VectorCmpAVX2(((char*)data) + start * sizeof(int16_t), numOfRows, isMinFunc, signVal, &pBuf->v);
if (code == TSDB_CODE_SUCCESS) {
pBuf->assign = true;
return;
}
}
if (signVal) {
const int16_t* p = (const int16_t*)data;
int16_t* v = (int16_t*)&pBuf->v;
@ -318,7 +152,6 @@ static void handleInt16Col(const void* data, int32_t start, int32_t numOfRows, S
__COMPARE_EXTRACT_MAX(start, start + numOfRows, *v, p);
}
}
}
pBuf->assign = true;
}
@ -329,13 +162,14 @@ static void handleInt32Col(const void* data, int32_t start, int32_t numOfRows, S
pBuf->v = ((const int32_t*)data)[start];
}
#ifdef __AVX2__
if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(int32_t) >= sizeof(__m256i)) {
i32VectorCmpAVX2(data + start * sizeof(int32_t), numOfRows, isMinFunc, signVal, &pBuf->v);
} else {
#else
if (true) {
#endif
if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(int32_t) >= M256_BYTES) {
int32_t code = i32VectorCmpAVX2(((char*)data) + start * sizeof(int32_t), numOfRows, isMinFunc, signVal, &pBuf->v);
if (code == TSDB_CODE_SUCCESS) {
pBuf->assign = true;
return;
}
}
if (signVal) {
const int32_t* p = (const int32_t*)data;
int32_t* v = (int32_t*)&pBuf->v;
@ -355,7 +189,6 @@ static void handleInt32Col(const void* data, int32_t start, int32_t numOfRows, S
__COMPARE_EXTRACT_MAX(start, start + numOfRows, *v, p);
}
}
}
pBuf->assign = true;
}
@ -397,19 +230,19 @@ static void handleFloatCol(SColumnInfoData* pCol, int32_t start, int32_t numOfRo
*val = pData[start];
}
#ifdef __AVX2__
if (tsAVXSupported && tsSIMDEnable && numOfRows * sizeof(float) >= sizeof(__m256i)) {
floatVectorCmpAVX2(pData + start, numOfRows, isMinFunc, val);
} else {
#else
if (true) {
#endif
if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(float) >= M256_BYTES) {
int32_t code = floatVectorCmpAVX2(pData + start, numOfRows, isMinFunc, val);
if (code == TSDB_CODE_SUCCESS) {
pBuf->assign = true;
return;
}
}
if (isMinFunc) { // min
__COMPARE_EXTRACT_MIN(start, start + numOfRows, *val, pData);
} else { // max
__COMPARE_EXTRACT_MAX(start, start + numOfRows, *val, pData);
}
}
pBuf->assign = true;
}
@ -422,19 +255,19 @@ static void handleDoubleCol(SColumnInfoData* pCol, int32_t start, int32_t numOfR
*val = pData[start];
}
#ifdef __AVX2__
if (tsAVXSupported && tsSIMDEnable && numOfRows * sizeof(double) >= sizeof(__m256i)) {
doubleVectorCmpAVX2(pData + start, numOfRows, isMinFunc, val);
} else {
#else
if (true) {
#endif
if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(double) >= M256_BYTES) {
int32_t code = doubleVectorCmpAVX2(pData + start, numOfRows, isMinFunc, val);
if (code == TSDB_CODE_SUCCESS) {
pBuf->assign = true;
return;
}
}
if (isMinFunc) { // min
__COMPARE_EXTRACT_MIN(start, start + numOfRows, *val, pData);
} else { // max
__COMPARE_EXTRACT_MAX(start, start + numOfRows, *val, pData);
}
}
pBuf->assign = true;
}

View File

@ -0,0 +1,227 @@
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* 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.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "builtinsimpl.h"
#ifdef __AVX2__
static void calculateRounds(int32_t numOfRows, int32_t bytes, int32_t* remainder, int32_t* rounds, int32_t* width) {
const int32_t bitWidth = 256;
*width = (bitWidth >> 3u) / bytes;
*remainder = numOfRows % (*width);
*rounds = numOfRows / (*width);
}
#define __COMPARE_EXTRACT_MIN(start, end, val, _data) \
for (int32_t i = (start); i < (end); ++i) { \
if ((val) > (_data)[i]) { \
(val) = (_data)[i]; \
} \
}
#define __COMPARE_EXTRACT_MAX(start, end, val, _data) \
for (int32_t i = (start); i < (end); ++i) { \
if ((val) < (_data)[i]) { \
(val) = (_data)[i]; \
} \
}
#define EXTRACT_MAX_VAL(_first, _sec, _width, _remain, _v) \
__COMPARE_EXTRACT_MAX(0, (_width), (_v), (_first)) \
__COMPARE_EXTRACT_MAX(0, (_remain), (_v), (_sec))
#define EXTRACT_MIN_VAL(_first, _sec, _width, _remain, _v) \
__COMPARE_EXTRACT_MIN(0, (_width), (_v), (_first)) \
__COMPARE_EXTRACT_MIN(0, (_remain), (_v), (_sec))
#define CMP_TYPE_MIN_MAX(type, cmp) \
const type* p = pData; \
__m256i initVal = _mm256_lddqu_si256((__m256i*)p); \
p += width; \
for (int32_t i = 1; i < (rounds); ++i) { \
__m256i next = _mm256_lddqu_si256((__m256i*)p); \
initVal = CMP_FUNC_##cmp##_##type(initVal, next); \
p += width; \
} \
const type* q = (const type*)&initVal; \
type* v = (type*)res; \
EXTRACT_##cmp##_VAL(q, p, width, remain, *v)
#endif
int32_t i8VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res) {
#ifdef __AVX2__
const int8_t* p = pData;
int32_t width, remain, rounds;
calculateRounds(numOfRows, sizeof(int8_t), &remain, &rounds, &width);
#define CMP_FUNC_MIN_int8_t _mm256_min_epi8
#define CMP_FUNC_MAX_int8_t _mm256_max_epi8
#define CMP_FUNC_MIN_uint8_t _mm256_min_epu8
#define CMP_FUNC_MAX_uint8_t _mm256_max_epu8
if (!isMinFunc) { // max function
if (signVal) {
CMP_TYPE_MIN_MAX(int8_t, MAX);
} else {
CMP_TYPE_MIN_MAX(uint8_t, MAX);
}
} else { // min function
if (signVal) {
CMP_TYPE_MIN_MAX(int8_t, MIN);
} else {
CMP_TYPE_MIN_MAX(uint8_t, MIN);
}
}
return TSDB_CODE_SUCCESS;
#else
uError("unable run %s without avx2 instructions", __func__);
return TSDB_CODE_OPS_NOT_SUPPORT;
#endif
}
int32_t i16VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res) {
#ifdef __AVX2__
int32_t width, remain, rounds;
calculateRounds(numOfRows, sizeof(int16_t), &remain, &rounds, &width);
#define CMP_FUNC_MIN_int16_t _mm256_min_epi16
#define CMP_FUNC_MAX_int16_t _mm256_max_epi16
#define CMP_FUNC_MIN_uint16_t _mm256_min_epu16
#define CMP_FUNC_MAX_uint16_t _mm256_max_epu16
if (!isMinFunc) { // max function
if (signVal) {
CMP_TYPE_MIN_MAX(int16_t, MAX);
} else {
CMP_TYPE_MIN_MAX(uint16_t, MAX);
}
} else { // min function
if (signVal) {
CMP_TYPE_MIN_MAX(int16_t, MIN);
} else {
CMP_TYPE_MIN_MAX(uint16_t, MIN);
}
}
return TSDB_CODE_SUCCESS;
#else
uError("unable run %s without avx2 instructions", __func__);
return TSDB_CODE_OPS_NOT_SUPPORT;
#endif
}
int32_t i32VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res) {
#ifdef __AVX2__
int32_t width, remain, rounds;
calculateRounds(numOfRows, sizeof(int32_t), &remain, &rounds, &width);
#define CMP_FUNC_MIN_int32_t _mm256_min_epi32
#define CMP_FUNC_MAX_int32_t _mm256_max_epi32
#define CMP_FUNC_MIN_uint32_t _mm256_min_epu32
#define CMP_FUNC_MAX_uint32_t _mm256_max_epu32
if (!isMinFunc) { // max function
if (signVal) {
CMP_TYPE_MIN_MAX(int32_t, MAX);
} else {
CMP_TYPE_MIN_MAX(uint32_t, MAX);
}
} else { // min function
if (signVal) {
CMP_TYPE_MIN_MAX(int32_t, MIN);
} else {
CMP_TYPE_MIN_MAX(uint32_t, MIN);
}
}
return TSDB_CODE_SUCCESS;
#else
uError("unable run %s without avx2 instructions", __func__);
return TSDB_CODE_OPS_NOT_SUPPORT;
#endif
}
int32_t floatVectorCmpAVX2(const float* pData, int32_t numOfRows, bool isMinFunc, float* res) {
#ifdef __AVX2__
const float* p = pData;
int32_t width, remain, rounds;
calculateRounds(numOfRows, sizeof(float), &remain, &rounds, &width);
__m256 next;
__m256 initVal = _mm256_loadu_ps(p);
p += width;
if (!isMinFunc) { // max function
for (int32_t i = 1; i < rounds; ++i) {
next = _mm256_loadu_ps(p);
initVal = _mm256_max_ps(initVal, next);
p += width;
}
const float* q = (const float*)&initVal;
EXTRACT_MAX_VAL(q, p, width, remain, *res)
} else { // min function
for (int32_t i = 1; i < rounds; ++i) {
next = _mm256_loadu_ps(p);
initVal = _mm256_min_ps(initVal, next);
p += width;
}
const float* q = (const float*)&initVal;
EXTRACT_MIN_VAL(q, p, width, remain, *res)
}
return TSDB_CODE_SUCCESS;
#else
uError("unable run %s without avx2 instructions", __func__);
return TSDB_CODE_OPS_NOT_SUPPORT;
#endif
}
int32_t doubleVectorCmpAVX2(const double* pData, int32_t numOfRows, bool isMinFunc, double* res) {
#ifdef __AVX2__
const double* p = pData;
int32_t width, remain, rounds;
calculateRounds(numOfRows, sizeof(double), &remain, &rounds, &width);
__m256d next;
__m256d initVal = _mm256_loadu_pd(p);
p += width;
if (!isMinFunc) { // max function
for (int32_t i = 1; i < rounds; ++i) {
next = _mm256_loadu_pd(p);
initVal = _mm256_max_pd(initVal, next);
p += width;
}
// let sum up the final results
const double* q = (const double*)&initVal;
EXTRACT_MAX_VAL(q, p, width, remain, *res)
} else { // min function
for (int32_t i = 1; i < rounds; ++i) {
next = _mm256_loadu_pd(p);
initVal = _mm256_min_pd(initVal, next);
p += width;
}
// let sum up the final results
const double* q = (const double*)&initVal;
EXTRACT_MIN_VAL(q, p, width, remain, *res)
}
return TSDB_CODE_SUCCESS;
#else
uError("unable run %s without avx2 instructions", __func__);
return TSDB_CODE_OPS_NOT_SUPPORT;
#endif
}

View File

@ -37,7 +37,6 @@ float tsNumOfCores = 0;
int64_t tsTotalMemoryKB = 0;
char *tsProcPath = NULL;
char tsSIMDEnable = 1;
char tsAVX512Enable = 0;
char tsSSE42Supported = 0;
char tsAVXSupported = 0;

View File

@ -1,5 +1,9 @@
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/version.c.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/version.c")
aux_source_directory(src UTIL_SRC)
IF(COMPILER_SUPPORT_AVX2)
MESSAGE(STATUS "AVX2 instructions is ACTIVATED")
set_source_files_properties(src/tdecompressavx.c PROPERTIES COMPILE_FLAGS -mavx2)
ENDIF()
add_library(util STATIC ${UTIL_SRC})
if(DEFINED GRANT_CFG_INCLUDE_DIR)

View File

@ -471,12 +471,12 @@ int32_t tsDecompressINTImp(const char *const input, const int32_t nelements, cha
return nelements * word_length;
}
#ifdef __AVX512F__
if (tsSIMDEnable && tsAVX512Enable && tsAVX512Supported) {
tsDecompressIntImpl_Hw(input, nelements, output, type);
return nelements * word_length;
int32_t cnt = tsDecompressIntImpl_Hw(input, nelements, output, type);
if (cnt >= 0) {
return cnt;
}
}
#endif
// Selector value: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
char bit_per_integer[] = {0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 15, 20, 30, 60};
@ -867,12 +867,12 @@ int32_t tsDecompressTimestampImp(const char *const input, const int32_t nelement
memcpy(output, input + 1, nelements * longBytes);
return nelements * longBytes;
} else if (input[0] == 1) { // Decompress
#ifdef __AVX512VL__
if (tsSIMDEnable && tsAVX512Enable && tsAVX512Supported) {
tsDecompressTimestampAvx512(const char *const input, const int32_t nelements, char *const output, bool bigEndian);
return nelements * longBytes;
int32_t cnt = tsDecompressTimestampAvx512(input, nelements, output, false);
if (cnt >= 0) {
return cnt;
}
}
#endif
int64_t *ostream = (int64_t *)output;
@ -1103,13 +1103,14 @@ int32_t tsDecompressDoubleImp(const char *const input, int32_t ninput, const int
return nelements * DOUBLE_BYTES;
}
#ifdef __AVX2__
// use AVX2 implementation when allowed and the compression ratio is not high
double compressRatio = 1.0 * nelements * DOUBLE_BYTES / ninput;
if (tsSIMDEnable && tsAVX2Supported && compressRatio < 2) {
return tsDecompressDoubleImpAvx2(input + 1, nelements, output);
int32_t cnt = tsDecompressDoubleImpAvx2(input + 1, nelements, output);
if (cnt >= 0) {
return cnt;
}
}
#endif
// use implementation without SIMD instructions by default
return tsDecompressDoubleImpHelper(input + 1, nelements, output);
@ -1257,13 +1258,14 @@ int32_t tsDecompressFloatImp(const char *const input, int32_t ninput, const int3
return nelements * FLOAT_BYTES;
}
#ifdef __AVX2__
// use AVX2 implementation when allowed and the compression ratio is not high
double compressRatio = 1.0 * nelements * FLOAT_BYTES / ninput;
if (tsSIMDEnable && tsAVX2Supported && compressRatio < 2) {
return tsDecompressFloatImpAvx2(input + 1, nelements, output);
int32_t cnt = tsDecompressFloatImpAvx2(input + 1, nelements, output);
if (cnt >= 0) {
return cnt;
}
}
#endif
// use implementation without SIMD instructions by default
return tsDecompressFloatImpHelper(input + 1, nelements, output);
@ -1617,6 +1619,9 @@ int32_t tsDecompressBigint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int
uTrace("encode:%s, compress:%s, level:%d, type:%s, l1:%d", compressL1Dict[l1].name, compressL2Dict[l2].name, \
lvl, tDataTypes[type].name, l1); \
int32_t len = compressL1Dict[l1].comprFn(pIn, nEle, pBuf, type); \
if (len < 0) { \
return len; \
} \
int8_t alvl = tsGetCompressL2Level(l2, lvl); \
return compressL2Dict[l2].comprFn(pBuf, len, pOut, nOut, type, alvl); \
} else { \
@ -1628,8 +1633,7 @@ int32_t tsDecompressBigint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int
} \
} else if (l1 == L1_DISABLED && l2 != L2_DISABLED) { \
if (compress) { \
uTrace("encode:%s, compress:%s, level:%d, type:%s", "disabled", compressL2Dict[l1].name, lvl, \
tDataTypes[type].name); \
uTrace("encode:%s, compress:%s, level:%d, type:%s", "disabled", "disable", lvl, tDataTypes[type].name); \
int8_t alvl = tsGetCompressL2Level(l2, lvl); \
return compressL2Dict[l2].comprFn(pIn, nIn, pOut, nOut, type, alvl); \
} else { \
@ -1883,3 +1887,26 @@ int8_t tUpdateCompress(uint32_t oldCmpr, uint32_t newCmpr, uint8_t l2Disabled, u
return update;
}
int32_t getWordLength(char type) {
int32_t wordLength = 0;
switch (type) {
case TSDB_DATA_TYPE_BIGINT:
wordLength = LONG_BYTES;
break;
case TSDB_DATA_TYPE_INT:
wordLength = INT_BYTES;
break;
case TSDB_DATA_TYPE_SMALLINT:
wordLength = SHORT_BYTES;
break;
case TSDB_DATA_TYPE_TINYINT:
wordLength = CHAR_BYTES;
break;
default:
uError("Invalid decompress integer type:%d", type);
return TSDB_CODE_INVALID_PARA;
}
return wordLength;
}

View File

@ -13,35 +13,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os.h"
#include "tcompression.h"
#include "ttypes.h"
int32_t getWordLength(char type) {
int32_t wordLength = 0;
switch (type) {
case TSDB_DATA_TYPE_BIGINT:
wordLength = LONG_BYTES;
break;
case TSDB_DATA_TYPE_INT:
wordLength = INT_BYTES;
break;
case TSDB_DATA_TYPE_SMALLINT:
wordLength = SHORT_BYTES;
break;
case TSDB_DATA_TYPE_TINYINT:
wordLength = CHAR_BYTES;
break;
default:
uError("Invalid decompress integer type:%d", type);
return TSDB_CODE_INVALID_PARA;
}
return wordLength;
}
#ifdef __AVX2__
char tsSIMDEnable = 1;
#else
char tsSIMDEnable = 0;
#endif
int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, char *const output, const char type) {
#ifdef __AVX2__
int32_t word_length = getWordLength(type);
// Selector value: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
@ -75,12 +56,12 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements,
int32_t batch = 0;
int32_t remain = 0;
if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) {
#if __AVX512F__
#ifdef __AVX512F__
batch = num >> 3;
remain = num & 0x07;
#endif
} else if (tsSIMDEnable && tsAVX2Supported) {
#if __AVX2__
#ifdef __AVX2__
batch = num >> 2;
remain = num & 0x03;
#endif
@ -88,7 +69,7 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements,
if (selector == 0 || selector == 1) {
if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) {
#if __AVX512F__
#ifdef __AVX512F__
for (int32_t i = 0; i < batch; ++i) {
__m512i prev = _mm512_set1_epi64(prevValue);
_mm512_storeu_si512((__m512i *)&p[_pos], prev);
@ -117,7 +98,7 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements,
}
} else {
if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) {
#if __AVX512F__
#ifdef __AVX512F__
__m512i sum_mask1 = _mm512_set_epi64(6, 6, 4, 4, 2, 2, 0, 0);
__m512i sum_mask2 = _mm512_set_epi64(5, 5, 5, 5, 1, 1, 1, 1);
__m512i sum_mask3 = _mm512_set_epi64(3, 3, 3, 3, 3, 3, 3, 3);
@ -310,10 +291,13 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements,
}
return nelements * word_length;
#else
uError("unable run %s without avx2 instructions", __func__);
return -1;
#endif
}
#define M256_BYTES sizeof(__m256i)
#ifdef __AVX2__
FORCE_INLINE __m256i decodeFloatAvx2(const char *data, const char *flag) {
__m256i dataVec = _mm256_load_si256((__m256i *)data);
__m256i flagVec = _mm256_load_si256((__m256i *)flag);
@ -332,7 +316,27 @@ FORCE_INLINE __m256i decodeFloatAvx2(const char *data, const char *flag) {
return diffVec;
}
FORCE_INLINE __m256i decodeDoubleAvx2(const char *data, const char *flag) {
__m256i dataVec = _mm256_load_si256((__m256i *)data);
__m256i flagVec = _mm256_load_si256((__m256i *)flag);
__m256i k7 = _mm256_set1_epi64x(7);
__m256i lopart = _mm256_set_epi64x(0, -1, 0, -1);
__m256i hipart = _mm256_set_epi64x(-1, 0, -1, 0);
__m256i trTail = _mm256_cmpgt_epi64(flagVec, k7);
__m256i trHead = _mm256_andnot_si256(trTail, _mm256_set1_epi64x(-1));
__m256i shiftVec = _mm256_slli_epi64(_mm256_sub_epi64(k7, _mm256_and_si256(flagVec, k7)), 3);
__m256i maskVec = hipart;
__m256i diffVec = _mm256_sllv_epi64(dataVec, _mm256_and_si256(shiftVec, maskVec));
maskVec = _mm256_or_si256(trHead, lopart);
diffVec = _mm256_srlv_epi64(diffVec, _mm256_and_si256(shiftVec, maskVec));
maskVec = _mm256_and_si256(trTail, lopart);
diffVec = _mm256_sllv_epi64(diffVec, _mm256_and_si256(shiftVec, maskVec));
return diffVec;
}
#endif
int32_t tsDecompressFloatImpAvx2(const char *input, int32_t nelements, char *output) {
#ifdef __AVX2__
// Allocate memory-aligned buffer
char buf[M256_BYTES * 3];
memset(buf, 0, sizeof(buf));
@ -380,27 +384,14 @@ int32_t tsDecompressFloatImpAvx2(const char *input, int32_t nelements, char *out
out += idx * FLOAT_BYTES;
}
return (int32_t)(out - output);
}
FORCE_INLINE __m256i decodeDoubleAvx2(const char *data, const char *flag) {
__m256i dataVec = _mm256_load_si256((__m256i *)data);
__m256i flagVec = _mm256_load_si256((__m256i *)flag);
__m256i k7 = _mm256_set1_epi64x(7);
__m256i lopart = _mm256_set_epi64x(0, -1, 0, -1);
__m256i hipart = _mm256_set_epi64x(-1, 0, -1, 0);
__m256i trTail = _mm256_cmpgt_epi64(flagVec, k7);
__m256i trHead = _mm256_andnot_si256(trTail, _mm256_set1_epi64x(-1));
__m256i shiftVec = _mm256_slli_epi64(_mm256_sub_epi64(k7, _mm256_and_si256(flagVec, k7)), 3);
__m256i maskVec = hipart;
__m256i diffVec = _mm256_sllv_epi64(dataVec, _mm256_and_si256(shiftVec, maskVec));
maskVec = _mm256_or_si256(trHead, lopart);
diffVec = _mm256_srlv_epi64(diffVec, _mm256_and_si256(shiftVec, maskVec));
maskVec = _mm256_and_si256(trTail, lopart);
diffVec = _mm256_sllv_epi64(diffVec, _mm256_and_si256(shiftVec, maskVec));
return diffVec;
#else
uError("unable run %s without avx2 instructions", __func__);
return -1;
#endif
}
int32_t tsDecompressDoubleImpAvx2(const char *input, const int32_t nelements, char *const output) {
#ifdef __AVX2__
// Allocate memory-aligned buffer
char buf[M256_BYTES * 3];
memset(buf, 0, sizeof(buf));
@ -448,12 +439,15 @@ int32_t tsDecompressDoubleImpAvx2(const char *input, const int32_t nelements, ch
out += idx * DOUBLE_BYTES;
}
return (int32_t)(out - output);
}
#else
uError("unable run %s without avx2 instructions", __func__);
return -1;
#endif
}
#if __AVX512VL__
// decode two timestamps in one loop.
void tsDecompressTimestampAvx2(const char *const input, const int32_t nelements, char *const output, bool bigEndian) {
int32_t tsDecompressTimestampAvx2(const char *const input, const int32_t nelements, char *const output,
bool bigEndian) {
#ifdef __AVX512VL__
int64_t *ostream = (int64_t *)output;
int32_t ipos = 1, opos = 0;
@ -588,11 +582,16 @@ void tsDecompressTimestampAvx2(const char *const input, const int32_t nelements,
ostream[opos++] = prevVal[1] + prevDeltaX;
}
}
return;
return opos;
#else
uError("unable run %s without avx512 instructions", __func__);
return -1;
#endif
}
void tsDecompressTimestampAvx512(const char *const input, const int32_t nelements, char *const output,
int32_t tsDecompressTimestampAvx512(const char *const input, const int32_t nelements, char *const output,
bool UNUSED_PARAM(bigEndian)) {
#ifdef __AVX512VL__
int64_t *ostream = (int64_t *)output;
int32_t ipos = 1, opos = 0;
@ -700,6 +699,9 @@ void tsDecompressTimestampAvx512(const char *const input, const int32_t nelement
}
}
return;
}
return opos;
#else
uError("unable run %s without avx512 instructions", __func__);
return -1;
#endif
}

View File

@ -0,0 +1,368 @@
taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (null) order by irowts;
irowts | table_name | isfilled | intp_c1 |
================================================================================
2020-02-01 00:00:04.000 | td32727 | true | NULL |
2020-02-01 00:00:05.000 | td32727 | false | 5 |
2020-02-01 00:00:06.000 | td32727 | true | NULL |
2020-02-01 00:00:07.000 | td32727 | true | NULL |
2020-02-01 00:00:08.000 | td32727 | true | NULL |
2020-02-01 00:00:09.000 | td32727 | true | NULL |
2020-02-01 00:00:10.000 | td32727 | false | 10 |
2020-02-01 00:00:11.000 | td32727 | true | NULL |
2020-02-01 00:00:12.000 | td32727 | true | NULL |
2020-02-01 00:00:13.000 | td32727 | true | NULL |
2020-02-01 00:00:14.000 | td32727 | true | NULL |
2020-02-01 00:00:15.000 | td32727 | false | 15 |
2020-02-01 00:00:16.000 | td32727 | true | NULL |
taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (next) order by irowts;
irowts | table_name | isfilled | intp_c1 |
================================================================================
2020-02-01 00:00:04.000 | td32727 | true | 5 |
2020-02-01 00:00:05.000 | td32727 | false | 5 |
2020-02-01 00:00:06.000 | td32727 | true | 10 |
2020-02-01 00:00:07.000 | td32727 | true | 10 |
2020-02-01 00:00:08.000 | td32727 | true | 10 |
2020-02-01 00:00:09.000 | td32727 | true | 10 |
2020-02-01 00:00:10.000 | td32727 | false | 10 |
2020-02-01 00:00:11.000 | td32727 | true | 15 |
2020-02-01 00:00:12.000 | td32727 | true | 15 |
2020-02-01 00:00:13.000 | td32727 | true | 15 |
2020-02-01 00:00:14.000 | td32727 | true | 15 |
2020-02-01 00:00:15.000 | td32727 | false | 15 |
taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (prev) order by irowts;
irowts | table_name | isfilled | intp_c1 |
================================================================================
2020-02-01 00:00:05.000 | td32727 | false | 5 |
2020-02-01 00:00:06.000 | td32727 | true | 5 |
2020-02-01 00:00:07.000 | td32727 | true | 5 |
2020-02-01 00:00:08.000 | td32727 | true | 5 |
2020-02-01 00:00:09.000 | td32727 | true | 5 |
2020-02-01 00:00:10.000 | td32727 | false | 10 |
2020-02-01 00:00:11.000 | td32727 | true | 10 |
2020-02-01 00:00:12.000 | td32727 | true | 10 |
2020-02-01 00:00:13.000 | td32727 | true | 10 |
2020-02-01 00:00:14.000 | td32727 | true | 10 |
2020-02-01 00:00:15.000 | td32727 | false | 15 |
2020-02-01 00:00:16.000 | td32727 | true | 15 |
taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (linear) order by irowts;
irowts | table_name | isfilled | intp_c1 |
================================================================================
2020-02-01 00:00:05.000 | td32727 | false | 5 |
2020-02-01 00:00:06.000 | td32727 | true | 6 |
2020-02-01 00:00:07.000 | td32727 | true | 7 |
2020-02-01 00:00:08.000 | td32727 | true | 8 |
2020-02-01 00:00:09.000 | td32727 | true | 9 |
2020-02-01 00:00:10.000 | td32727 | false | 10 |
2020-02-01 00:00:11.000 | td32727 | true | 11 |
2020-02-01 00:00:12.000 | td32727 | true | 12 |
2020-02-01 00:00:13.000 | td32727 | true | 13 |
2020-02-01 00:00:14.000 | td32727 | true | 14 |
2020-02-01 00:00:15.000 | td32727 | false | 15 |
taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (value, 1) order by irowts;
irowts | table_name | isfilled | intp_c1 |
================================================================================
2020-02-01 00:00:04.000 | td32727 | true | 1 |
2020-02-01 00:00:05.000 | td32727 | false | 5 |
2020-02-01 00:00:06.000 | td32727 | true | 1 |
2020-02-01 00:00:07.000 | td32727 | true | 1 |
2020-02-01 00:00:08.000 | td32727 | true | 1 |
2020-02-01 00:00:09.000 | td32727 | true | 1 |
2020-02-01 00:00:10.000 | td32727 | false | 10 |
2020-02-01 00:00:11.000 | td32727 | true | 1 |
2020-02-01 00:00:12.000 | td32727 | true | 1 |
2020-02-01 00:00:13.000 | td32727 | true | 1 |
2020-02-01 00:00:14.000 | td32727 | true | 1 |
2020-02-01 00:00:15.000 | td32727 | false | 15 |
2020-02-01 00:00:16.000 | td32727 | true | 1 |
taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (null) order by irowts, c2;
irowts | table_name | c_c2 | isfilled | intp_c1 |
==============================================================================================
2020-02-01 00:00:04.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:04.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:04.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:05.000 | td32727 | 5 | false | 5 |
2020-02-01 00:00:05.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:05.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:06.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:06.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:06.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:07.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:07.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:07.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:08.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:08.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:08.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:09.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:09.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:09.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:10.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:10.000 | td32727 | 10 | false | 10 |
2020-02-01 00:00:10.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:11.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:11.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:11.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:12.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:12.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:12.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:13.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:13.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:13.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:14.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:14.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:14.000 | td32727 | 15 | true | NULL |
2020-02-01 00:00:15.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:15.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:15.000 | td32727 | 15 | false | 15 |
2020-02-01 00:00:16.000 | td32727 | 5 | true | NULL |
2020-02-01 00:00:16.000 | td32727 | 10 | true | NULL |
2020-02-01 00:00:16.000 | td32727 | 15 | true | NULL |
taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (next) order by irowts, c2;
irowts | table_name | c_c2 | isfilled | intp_c1 |
==============================================================================================
2020-02-01 00:00:04.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:04.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:04.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:05.000 | td32727 | 5 | false | 5 |
2020-02-01 00:00:05.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:05.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:06.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:06.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:07.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:07.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:08.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:08.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:09.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:09.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:10.000 | td32727 | 10 | false | 10 |
2020-02-01 00:00:10.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:11.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:12.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:13.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:14.000 | td32727 | 15 | true | 15 |
2020-02-01 00:00:15.000 | td32727 | 15 | false | 15 |
taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (prev) order by irowts, c2;
irowts | table_name | c_c2 | isfilled | intp_c1 |
==============================================================================================
2020-02-01 00:00:05.000 | td32727 | 5 | false | 5 |
2020-02-01 00:00:06.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:07.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:08.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:09.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:10.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:10.000 | td32727 | 10 | false | 10 |
2020-02-01 00:00:11.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:11.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:12.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:12.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:13.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:13.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:14.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:14.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:15.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:15.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:15.000 | td32727 | 15 | false | 15 |
2020-02-01 00:00:16.000 | td32727 | 5 | true | 5 |
2020-02-01 00:00:16.000 | td32727 | 10 | true | 10 |
2020-02-01 00:00:16.000 | td32727 | 15 | true | 15 |
taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (linear) order by irowts, c2;
irowts | table_name | c_c2 | isfilled | intp_c1 |
==============================================================================================
2020-02-01 00:00:05.000 | td32727 | 5 | false | 5 |
2020-02-01 00:00:10.000 | td32727 | 10 | false | 10 |
2020-02-01 00:00:15.000 | td32727 | 15 | false | 15 |
taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (value, 1) order by irowts, c2;
irowts | table_name | c_c2 | isfilled | intp_c1 |
==============================================================================================
2020-02-01 00:00:04.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:04.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:04.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:05.000 | td32727 | 5 | false | 5 |
2020-02-01 00:00:05.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:05.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:06.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:06.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:06.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:07.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:07.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:07.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:08.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:08.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:08.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:09.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:09.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:09.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:10.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:10.000 | td32727 | 10 | false | 10 |
2020-02-01 00:00:10.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:11.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:11.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:11.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:12.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:12.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:12.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:13.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:13.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:13.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:14.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:14.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:14.000 | td32727 | 15 | true | 1 |
2020-02-01 00:00:15.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:15.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:15.000 | td32727 | 15 | false | 15 |
2020-02-01 00:00:16.000 | td32727 | 5 | true | 1 |
2020-02-01 00:00:16.000 | td32727 | 10 | true | 1 |
2020-02-01 00:00:16.000 | td32727 | 15 | true | 1 |
taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (null) order by irowts, c2, c3;
irowts | table_name | c_c2 | c_c3 | isfilled | intp_c1 |
======================================================================================================================
2020-02-01 00:00:04.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:04.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:04.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:05.000 | td32727 | 5 | 5 | false | 5 |
2020-02-01 00:00:05.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:05.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:06.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:06.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:06.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:07.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:07.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:07.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:08.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:08.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:08.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:09.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:09.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:09.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:10.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:10.000 | td32727 | 10 | 10 | false | 10 |
2020-02-01 00:00:10.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:11.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:11.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:11.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:12.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:12.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:12.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:13.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:13.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:13.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:14.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:14.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:14.000 | td32727 | 15 | 15 | true | NULL |
2020-02-01 00:00:15.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:15.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:15.000 | td32727 | 15 | 15 | false | 15 |
2020-02-01 00:00:16.000 | td32727 | 5 | 5 | true | NULL |
2020-02-01 00:00:16.000 | td32727 | 10 | 10 | true | NULL |
2020-02-01 00:00:16.000 | td32727 | 15 | 15 | true | NULL |
taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (next) order by irowts, c2, c3;
irowts | table_name | c_c2 | c_c3 | isfilled | intp_c1 |
======================================================================================================================
2020-02-01 00:00:04.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:04.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:04.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:05.000 | td32727 | 5 | 5 | false | 5 |
2020-02-01 00:00:05.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:05.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:06.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:06.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:07.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:07.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:08.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:08.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:09.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:09.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:10.000 | td32727 | 10 | 10 | false | 10 |
2020-02-01 00:00:10.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:11.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:12.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:13.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:14.000 | td32727 | 15 | 15 | true | 15 |
2020-02-01 00:00:15.000 | td32727 | 15 | 15 | false | 15 |
taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (prev) order by irowts, c2, c3;
irowts | table_name | c_c2 | c_c3 | isfilled | intp_c1 |
======================================================================================================================
2020-02-01 00:00:05.000 | td32727 | 5 | 5 | false | 5 |
2020-02-01 00:00:06.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:07.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:08.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:09.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:10.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:10.000 | td32727 | 10 | 10 | false | 10 |
2020-02-01 00:00:11.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:11.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:12.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:12.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:13.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:13.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:14.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:14.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:15.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:15.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:15.000 | td32727 | 15 | 15 | false | 15 |
2020-02-01 00:00:16.000 | td32727 | 5 | 5 | true | 5 |
2020-02-01 00:00:16.000 | td32727 | 10 | 10 | true | 10 |
2020-02-01 00:00:16.000 | td32727 | 15 | 15 | true | 15 |
taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (linear) order by irowts, c2, c3;
irowts | table_name | c_c2 | c_c3 | isfilled | intp_c1 |
======================================================================================================================
2020-02-01 00:00:05.000 | td32727 | 5 | 5 | false | 5 |
2020-02-01 00:00:10.000 | td32727 | 10 | 10 | false | 10 |
2020-02-01 00:00:15.000 | td32727 | 15 | 15 | false | 15 |
taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (value, 1) order by irowts, c2, c3;
irowts | table_name | c_c2 | c_c3 | isfilled | intp_c1 |
======================================================================================================================
2020-02-01 00:00:04.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:04.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:04.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:05.000 | td32727 | 5 | 5 | false | 5 |
2020-02-01 00:00:05.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:05.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:06.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:06.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:06.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:07.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:07.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:07.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:08.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:08.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:08.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:09.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:09.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:09.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:10.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:10.000 | td32727 | 10 | 10 | false | 10 |
2020-02-01 00:00:10.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:11.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:11.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:11.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:12.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:12.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:12.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:13.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:13.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:13.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:14.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:14.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:14.000 | td32727 | 15 | 15 | true | 1 |
2020-02-01 00:00:15.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:15.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:15.000 | td32727 | 15 | 15 | false | 15 |
2020-02-01 00:00:16.000 | td32727 | 5 | 5 | true | 1 |
2020-02-01 00:00:16.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:16.000 | td32727 | 15 | 15 | true | 1 |
1 taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (null) order by irowts;
2 irowts | table_name | isfilled | intp_c1 |
3 ================================================================================
4 2020-02-01 00:00:04.000 | td32727 | true | NULL |
5 2020-02-01 00:00:05.000 | td32727 | false | 5 |
6 2020-02-01 00:00:06.000 | td32727 | true | NULL |
7 2020-02-01 00:00:07.000 | td32727 | true | NULL |
8 2020-02-01 00:00:08.000 | td32727 | true | NULL |
9 2020-02-01 00:00:09.000 | td32727 | true | NULL |
10 2020-02-01 00:00:10.000 | td32727 | false | 10 |
11 2020-02-01 00:00:11.000 | td32727 | true | NULL |
12 2020-02-01 00:00:12.000 | td32727 | true | NULL |
13 2020-02-01 00:00:13.000 | td32727 | true | NULL |
14 2020-02-01 00:00:14.000 | td32727 | true | NULL |
15 2020-02-01 00:00:15.000 | td32727 | false | 15 |
16 2020-02-01 00:00:16.000 | td32727 | true | NULL |
17 taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (next) order by irowts;
18 irowts | table_name | isfilled | intp_c1 |
19 ================================================================================
20 2020-02-01 00:00:04.000 | td32727 | true | 5 |
21 2020-02-01 00:00:05.000 | td32727 | false | 5 |
22 2020-02-01 00:00:06.000 | td32727 | true | 10 |
23 2020-02-01 00:00:07.000 | td32727 | true | 10 |
24 2020-02-01 00:00:08.000 | td32727 | true | 10 |
25 2020-02-01 00:00:09.000 | td32727 | true | 10 |
26 2020-02-01 00:00:10.000 | td32727 | false | 10 |
27 2020-02-01 00:00:11.000 | td32727 | true | 15 |
28 2020-02-01 00:00:12.000 | td32727 | true | 15 |
29 2020-02-01 00:00:13.000 | td32727 | true | 15 |
30 2020-02-01 00:00:14.000 | td32727 | true | 15 |
31 2020-02-01 00:00:15.000 | td32727 | false | 15 |
32 taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (prev) order by irowts;
33 irowts | table_name | isfilled | intp_c1 |
34 ================================================================================
35 2020-02-01 00:00:05.000 | td32727 | false | 5 |
36 2020-02-01 00:00:06.000 | td32727 | true | 5 |
37 2020-02-01 00:00:07.000 | td32727 | true | 5 |
38 2020-02-01 00:00:08.000 | td32727 | true | 5 |
39 2020-02-01 00:00:09.000 | td32727 | true | 5 |
40 2020-02-01 00:00:10.000 | td32727 | false | 10 |
41 2020-02-01 00:00:11.000 | td32727 | true | 10 |
42 2020-02-01 00:00:12.000 | td32727 | true | 10 |
43 2020-02-01 00:00:13.000 | td32727 | true | 10 |
44 2020-02-01 00:00:14.000 | td32727 | true | 10 |
45 2020-02-01 00:00:15.000 | td32727 | false | 15 |
46 2020-02-01 00:00:16.000 | td32727 | true | 15 |
47 taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (linear) order by irowts;
48 irowts | table_name | isfilled | intp_c1 |
49 ================================================================================
50 2020-02-01 00:00:05.000 | td32727 | false | 5 |
51 2020-02-01 00:00:06.000 | td32727 | true | 6 |
52 2020-02-01 00:00:07.000 | td32727 | true | 7 |
53 2020-02-01 00:00:08.000 | td32727 | true | 8 |
54 2020-02-01 00:00:09.000 | td32727 | true | 9 |
55 2020-02-01 00:00:10.000 | td32727 | false | 10 |
56 2020-02-01 00:00:11.000 | td32727 | true | 11 |
57 2020-02-01 00:00:12.000 | td32727 | true | 12 |
58 2020-02-01 00:00:13.000 | td32727 | true | 13 |
59 2020-02-01 00:00:14.000 | td32727 | true | 14 |
60 2020-02-01 00:00:15.000 | td32727 | false | 15 |
61 taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (value, 1) order by irowts;
62 irowts | table_name | isfilled | intp_c1 |
63 ================================================================================
64 2020-02-01 00:00:04.000 | td32727 | true | 1 |
65 2020-02-01 00:00:05.000 | td32727 | false | 5 |
66 2020-02-01 00:00:06.000 | td32727 | true | 1 |
67 2020-02-01 00:00:07.000 | td32727 | true | 1 |
68 2020-02-01 00:00:08.000 | td32727 | true | 1 |
69 2020-02-01 00:00:09.000 | td32727 | true | 1 |
70 2020-02-01 00:00:10.000 | td32727 | false | 10 |
71 2020-02-01 00:00:11.000 | td32727 | true | 1 |
72 2020-02-01 00:00:12.000 | td32727 | true | 1 |
73 2020-02-01 00:00:13.000 | td32727 | true | 1 |
74 2020-02-01 00:00:14.000 | td32727 | true | 1 |
75 2020-02-01 00:00:15.000 | td32727 | false | 15 |
76 2020-02-01 00:00:16.000 | td32727 | true | 1 |
77 taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (null) order by irowts, c2;
78 irowts | table_name | c_c2 | isfilled | intp_c1 |
79 ==============================================================================================
80 2020-02-01 00:00:04.000 | td32727 | 5 | true | NULL |
81 2020-02-01 00:00:04.000 | td32727 | 10 | true | NULL |
82 2020-02-01 00:00:04.000 | td32727 | 15 | true | NULL |
83 2020-02-01 00:00:05.000 | td32727 | 5 | false | 5 |
84 2020-02-01 00:00:05.000 | td32727 | 10 | true | NULL |
85 2020-02-01 00:00:05.000 | td32727 | 15 | true | NULL |
86 2020-02-01 00:00:06.000 | td32727 | 5 | true | NULL |
87 2020-02-01 00:00:06.000 | td32727 | 10 | true | NULL |
88 2020-02-01 00:00:06.000 | td32727 | 15 | true | NULL |
89 2020-02-01 00:00:07.000 | td32727 | 5 | true | NULL |
90 2020-02-01 00:00:07.000 | td32727 | 10 | true | NULL |
91 2020-02-01 00:00:07.000 | td32727 | 15 | true | NULL |
92 2020-02-01 00:00:08.000 | td32727 | 5 | true | NULL |
93 2020-02-01 00:00:08.000 | td32727 | 10 | true | NULL |
94 2020-02-01 00:00:08.000 | td32727 | 15 | true | NULL |
95 2020-02-01 00:00:09.000 | td32727 | 5 | true | NULL |
96 2020-02-01 00:00:09.000 | td32727 | 10 | true | NULL |
97 2020-02-01 00:00:09.000 | td32727 | 15 | true | NULL |
98 2020-02-01 00:00:10.000 | td32727 | 5 | true | NULL |
99 2020-02-01 00:00:10.000 | td32727 | 10 | false | 10 |
100 2020-02-01 00:00:10.000 | td32727 | 15 | true | NULL |
101 2020-02-01 00:00:11.000 | td32727 | 5 | true | NULL |
102 2020-02-01 00:00:11.000 | td32727 | 10 | true | NULL |
103 2020-02-01 00:00:11.000 | td32727 | 15 | true | NULL |
104 2020-02-01 00:00:12.000 | td32727 | 5 | true | NULL |
105 2020-02-01 00:00:12.000 | td32727 | 10 | true | NULL |
106 2020-02-01 00:00:12.000 | td32727 | 15 | true | NULL |
107 2020-02-01 00:00:13.000 | td32727 | 5 | true | NULL |
108 2020-02-01 00:00:13.000 | td32727 | 10 | true | NULL |
109 2020-02-01 00:00:13.000 | td32727 | 15 | true | NULL |
110 2020-02-01 00:00:14.000 | td32727 | 5 | true | NULL |
111 2020-02-01 00:00:14.000 | td32727 | 10 | true | NULL |
112 2020-02-01 00:00:14.000 | td32727 | 15 | true | NULL |
113 2020-02-01 00:00:15.000 | td32727 | 5 | true | NULL |
114 2020-02-01 00:00:15.000 | td32727 | 10 | true | NULL |
115 2020-02-01 00:00:15.000 | td32727 | 15 | false | 15 |
116 2020-02-01 00:00:16.000 | td32727 | 5 | true | NULL |
117 2020-02-01 00:00:16.000 | td32727 | 10 | true | NULL |
118 2020-02-01 00:00:16.000 | td32727 | 15 | true | NULL |
119 taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (next) order by irowts, c2;
120 irowts | table_name | c_c2 | isfilled | intp_c1 |
121 ==============================================================================================
122 2020-02-01 00:00:04.000 | td32727 | 5 | true | 5 |
123 2020-02-01 00:00:04.000 | td32727 | 10 | true | 10 |
124 2020-02-01 00:00:04.000 | td32727 | 15 | true | 15 |
125 2020-02-01 00:00:05.000 | td32727 | 5 | false | 5 |
126 2020-02-01 00:00:05.000 | td32727 | 10 | true | 10 |
127 2020-02-01 00:00:05.000 | td32727 | 15 | true | 15 |
128 2020-02-01 00:00:06.000 | td32727 | 10 | true | 10 |
129 2020-02-01 00:00:06.000 | td32727 | 15 | true | 15 |
130 2020-02-01 00:00:07.000 | td32727 | 10 | true | 10 |
131 2020-02-01 00:00:07.000 | td32727 | 15 | true | 15 |
132 2020-02-01 00:00:08.000 | td32727 | 10 | true | 10 |
133 2020-02-01 00:00:08.000 | td32727 | 15 | true | 15 |
134 2020-02-01 00:00:09.000 | td32727 | 10 | true | 10 |
135 2020-02-01 00:00:09.000 | td32727 | 15 | true | 15 |
136 2020-02-01 00:00:10.000 | td32727 | 10 | false | 10 |
137 2020-02-01 00:00:10.000 | td32727 | 15 | true | 15 |
138 2020-02-01 00:00:11.000 | td32727 | 15 | true | 15 |
139 2020-02-01 00:00:12.000 | td32727 | 15 | true | 15 |
140 2020-02-01 00:00:13.000 | td32727 | 15 | true | 15 |
141 2020-02-01 00:00:14.000 | td32727 | 15 | true | 15 |
142 2020-02-01 00:00:15.000 | td32727 | 15 | false | 15 |
143 taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (prev) order by irowts, c2;
144 irowts | table_name | c_c2 | isfilled | intp_c1 |
145 ==============================================================================================
146 2020-02-01 00:00:05.000 | td32727 | 5 | false | 5 |
147 2020-02-01 00:00:06.000 | td32727 | 5 | true | 5 |
148 2020-02-01 00:00:07.000 | td32727 | 5 | true | 5 |
149 2020-02-01 00:00:08.000 | td32727 | 5 | true | 5 |
150 2020-02-01 00:00:09.000 | td32727 | 5 | true | 5 |
151 2020-02-01 00:00:10.000 | td32727 | 5 | true | 5 |
152 2020-02-01 00:00:10.000 | td32727 | 10 | false | 10 |
153 2020-02-01 00:00:11.000 | td32727 | 5 | true | 5 |
154 2020-02-01 00:00:11.000 | td32727 | 10 | true | 10 |
155 2020-02-01 00:00:12.000 | td32727 | 5 | true | 5 |
156 2020-02-01 00:00:12.000 | td32727 | 10 | true | 10 |
157 2020-02-01 00:00:13.000 | td32727 | 5 | true | 5 |
158 2020-02-01 00:00:13.000 | td32727 | 10 | true | 10 |
159 2020-02-01 00:00:14.000 | td32727 | 5 | true | 5 |
160 2020-02-01 00:00:14.000 | td32727 | 10 | true | 10 |
161 2020-02-01 00:00:15.000 | td32727 | 5 | true | 5 |
162 2020-02-01 00:00:15.000 | td32727 | 10 | true | 10 |
163 2020-02-01 00:00:15.000 | td32727 | 15 | false | 15 |
164 2020-02-01 00:00:16.000 | td32727 | 5 | true | 5 |
165 2020-02-01 00:00:16.000 | td32727 | 10 | true | 10 |
166 2020-02-01 00:00:16.000 | td32727 | 15 | true | 15 |
167 taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (linear) order by irowts, c2;
168 irowts | table_name | c_c2 | isfilled | intp_c1 |
169 ==============================================================================================
170 2020-02-01 00:00:05.000 | td32727 | 5 | false | 5 |
171 2020-02-01 00:00:10.000 | td32727 | 10 | false | 10 |
172 2020-02-01 00:00:15.000 | td32727 | 15 | false | 15 |
173 taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (value, 1) order by irowts, c2;
174 irowts | table_name | c_c2 | isfilled | intp_c1 |
175 ==============================================================================================
176 2020-02-01 00:00:04.000 | td32727 | 5 | true | 1 |
177 2020-02-01 00:00:04.000 | td32727 | 10 | true | 1 |
178 2020-02-01 00:00:04.000 | td32727 | 15 | true | 1 |
179 2020-02-01 00:00:05.000 | td32727 | 5 | false | 5 |
180 2020-02-01 00:00:05.000 | td32727 | 10 | true | 1 |
181 2020-02-01 00:00:05.000 | td32727 | 15 | true | 1 |
182 2020-02-01 00:00:06.000 | td32727 | 5 | true | 1 |
183 2020-02-01 00:00:06.000 | td32727 | 10 | true | 1 |
184 2020-02-01 00:00:06.000 | td32727 | 15 | true | 1 |
185 2020-02-01 00:00:07.000 | td32727 | 5 | true | 1 |
186 2020-02-01 00:00:07.000 | td32727 | 10 | true | 1 |
187 2020-02-01 00:00:07.000 | td32727 | 15 | true | 1 |
188 2020-02-01 00:00:08.000 | td32727 | 5 | true | 1 |
189 2020-02-01 00:00:08.000 | td32727 | 10 | true | 1 |
190 2020-02-01 00:00:08.000 | td32727 | 15 | true | 1 |
191 2020-02-01 00:00:09.000 | td32727 | 5 | true | 1 |
192 2020-02-01 00:00:09.000 | td32727 | 10 | true | 1 |
193 2020-02-01 00:00:09.000 | td32727 | 15 | true | 1 |
194 2020-02-01 00:00:10.000 | td32727 | 5 | true | 1 |
195 2020-02-01 00:00:10.000 | td32727 | 10 | false | 10 |
196 2020-02-01 00:00:10.000 | td32727 | 15 | true | 1 |
197 2020-02-01 00:00:11.000 | td32727 | 5 | true | 1 |
198 2020-02-01 00:00:11.000 | td32727 | 10 | true | 1 |
199 2020-02-01 00:00:11.000 | td32727 | 15 | true | 1 |
200 2020-02-01 00:00:12.000 | td32727 | 5 | true | 1 |
201 2020-02-01 00:00:12.000 | td32727 | 10 | true | 1 |
202 2020-02-01 00:00:12.000 | td32727 | 15 | true | 1 |
203 2020-02-01 00:00:13.000 | td32727 | 5 | true | 1 |
204 2020-02-01 00:00:13.000 | td32727 | 10 | true | 1 |
205 2020-02-01 00:00:13.000 | td32727 | 15 | true | 1 |
206 2020-02-01 00:00:14.000 | td32727 | 5 | true | 1 |
207 2020-02-01 00:00:14.000 | td32727 | 10 | true | 1 |
208 2020-02-01 00:00:14.000 | td32727 | 15 | true | 1 |
209 2020-02-01 00:00:15.000 | td32727 | 5 | true | 1 |
210 2020-02-01 00:00:15.000 | td32727 | 10 | true | 1 |
211 2020-02-01 00:00:15.000 | td32727 | 15 | false | 15 |
212 2020-02-01 00:00:16.000 | td32727 | 5 | true | 1 |
213 2020-02-01 00:00:16.000 | td32727 | 10 | true | 1 |
214 2020-02-01 00:00:16.000 | td32727 | 15 | true | 1 |
215 taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (null) order by irowts, c2, c3;
216 irowts | table_name | c_c2 | c_c3 | isfilled | intp_c1 |
217 ======================================================================================================================
218 2020-02-01 00:00:04.000 | td32727 | 5 | 5 | true | NULL |
219 2020-02-01 00:00:04.000 | td32727 | 10 | 10 | true | NULL |
220 2020-02-01 00:00:04.000 | td32727 | 15 | 15 | true | NULL |
221 2020-02-01 00:00:05.000 | td32727 | 5 | 5 | false | 5 |
222 2020-02-01 00:00:05.000 | td32727 | 10 | 10 | true | NULL |
223 2020-02-01 00:00:05.000 | td32727 | 15 | 15 | true | NULL |
224 2020-02-01 00:00:06.000 | td32727 | 5 | 5 | true | NULL |
225 2020-02-01 00:00:06.000 | td32727 | 10 | 10 | true | NULL |
226 2020-02-01 00:00:06.000 | td32727 | 15 | 15 | true | NULL |
227 2020-02-01 00:00:07.000 | td32727 | 5 | 5 | true | NULL |
228 2020-02-01 00:00:07.000 | td32727 | 10 | 10 | true | NULL |
229 2020-02-01 00:00:07.000 | td32727 | 15 | 15 | true | NULL |
230 2020-02-01 00:00:08.000 | td32727 | 5 | 5 | true | NULL |
231 2020-02-01 00:00:08.000 | td32727 | 10 | 10 | true | NULL |
232 2020-02-01 00:00:08.000 | td32727 | 15 | 15 | true | NULL |
233 2020-02-01 00:00:09.000 | td32727 | 5 | 5 | true | NULL |
234 2020-02-01 00:00:09.000 | td32727 | 10 | 10 | true | NULL |
235 2020-02-01 00:00:09.000 | td32727 | 15 | 15 | true | NULL |
236 2020-02-01 00:00:10.000 | td32727 | 5 | 5 | true | NULL |
237 2020-02-01 00:00:10.000 | td32727 | 10 | 10 | false | 10 |
238 2020-02-01 00:00:10.000 | td32727 | 15 | 15 | true | NULL |
239 2020-02-01 00:00:11.000 | td32727 | 5 | 5 | true | NULL |
240 2020-02-01 00:00:11.000 | td32727 | 10 | 10 | true | NULL |
241 2020-02-01 00:00:11.000 | td32727 | 15 | 15 | true | NULL |
242 2020-02-01 00:00:12.000 | td32727 | 5 | 5 | true | NULL |
243 2020-02-01 00:00:12.000 | td32727 | 10 | 10 | true | NULL |
244 2020-02-01 00:00:12.000 | td32727 | 15 | 15 | true | NULL |
245 2020-02-01 00:00:13.000 | td32727 | 5 | 5 | true | NULL |
246 2020-02-01 00:00:13.000 | td32727 | 10 | 10 | true | NULL |
247 2020-02-01 00:00:13.000 | td32727 | 15 | 15 | true | NULL |
248 2020-02-01 00:00:14.000 | td32727 | 5 | 5 | true | NULL |
249 2020-02-01 00:00:14.000 | td32727 | 10 | 10 | true | NULL |
250 2020-02-01 00:00:14.000 | td32727 | 15 | 15 | true | NULL |
251 2020-02-01 00:00:15.000 | td32727 | 5 | 5 | true | NULL |
252 2020-02-01 00:00:15.000 | td32727 | 10 | 10 | true | NULL |
253 2020-02-01 00:00:15.000 | td32727 | 15 | 15 | false | 15 |
254 2020-02-01 00:00:16.000 | td32727 | 5 | 5 | true | NULL |
255 2020-02-01 00:00:16.000 | td32727 | 10 | 10 | true | NULL |
256 2020-02-01 00:00:16.000 | td32727 | 15 | 15 | true | NULL |
257 taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (next) order by irowts, c2, c3;
258 irowts | table_name | c_c2 | c_c3 | isfilled | intp_c1 |
259 ======================================================================================================================
260 2020-02-01 00:00:04.000 | td32727 | 5 | 5 | true | 5 |
261 2020-02-01 00:00:04.000 | td32727 | 10 | 10 | true | 10 |
262 2020-02-01 00:00:04.000 | td32727 | 15 | 15 | true | 15 |
263 2020-02-01 00:00:05.000 | td32727 | 5 | 5 | false | 5 |
264 2020-02-01 00:00:05.000 | td32727 | 10 | 10 | true | 10 |
265 2020-02-01 00:00:05.000 | td32727 | 15 | 15 | true | 15 |
266 2020-02-01 00:00:06.000 | td32727 | 10 | 10 | true | 10 |
267 2020-02-01 00:00:06.000 | td32727 | 15 | 15 | true | 15 |
268 2020-02-01 00:00:07.000 | td32727 | 10 | 10 | true | 10 |
269 2020-02-01 00:00:07.000 | td32727 | 15 | 15 | true | 15 |
270 2020-02-01 00:00:08.000 | td32727 | 10 | 10 | true | 10 |
271 2020-02-01 00:00:08.000 | td32727 | 15 | 15 | true | 15 |
272 2020-02-01 00:00:09.000 | td32727 | 10 | 10 | true | 10 |
273 2020-02-01 00:00:09.000 | td32727 | 15 | 15 | true | 15 |
274 2020-02-01 00:00:10.000 | td32727 | 10 | 10 | false | 10 |
275 2020-02-01 00:00:10.000 | td32727 | 15 | 15 | true | 15 |
276 2020-02-01 00:00:11.000 | td32727 | 15 | 15 | true | 15 |
277 2020-02-01 00:00:12.000 | td32727 | 15 | 15 | true | 15 |
278 2020-02-01 00:00:13.000 | td32727 | 15 | 15 | true | 15 |
279 2020-02-01 00:00:14.000 | td32727 | 15 | 15 | true | 15 |
280 2020-02-01 00:00:15.000 | td32727 | 15 | 15 | false | 15 |
281 taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (prev) order by irowts, c2, c3;
282 irowts | table_name | c_c2 | c_c3 | isfilled | intp_c1 |
283 ======================================================================================================================
284 2020-02-01 00:00:05.000 | td32727 | 5 | 5 | false | 5 |
285 2020-02-01 00:00:06.000 | td32727 | 5 | 5 | true | 5 |
286 2020-02-01 00:00:07.000 | td32727 | 5 | 5 | true | 5 |
287 2020-02-01 00:00:08.000 | td32727 | 5 | 5 | true | 5 |
288 2020-02-01 00:00:09.000 | td32727 | 5 | 5 | true | 5 |
289 2020-02-01 00:00:10.000 | td32727 | 5 | 5 | true | 5 |
290 2020-02-01 00:00:10.000 | td32727 | 10 | 10 | false | 10 |
291 2020-02-01 00:00:11.000 | td32727 | 5 | 5 | true | 5 |
292 2020-02-01 00:00:11.000 | td32727 | 10 | 10 | true | 10 |
293 2020-02-01 00:00:12.000 | td32727 | 5 | 5 | true | 5 |
294 2020-02-01 00:00:12.000 | td32727 | 10 | 10 | true | 10 |
295 2020-02-01 00:00:13.000 | td32727 | 5 | 5 | true | 5 |
296 2020-02-01 00:00:13.000 | td32727 | 10 | 10 | true | 10 |
297 2020-02-01 00:00:14.000 | td32727 | 5 | 5 | true | 5 |
298 2020-02-01 00:00:14.000 | td32727 | 10 | 10 | true | 10 |
299 2020-02-01 00:00:15.000 | td32727 | 5 | 5 | true | 5 |
300 2020-02-01 00:00:15.000 | td32727 | 10 | 10 | true | 10 |
301 2020-02-01 00:00:15.000 | td32727 | 15 | 15 | false | 15 |
302 2020-02-01 00:00:16.000 | td32727 | 5 | 5 | true | 5 |
303 2020-02-01 00:00:16.000 | td32727 | 10 | 10 | true | 10 |
304 2020-02-01 00:00:16.000 | td32727 | 15 | 15 | true | 15 |
305 taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (linear) order by irowts, c2, c3;
306 irowts | table_name | c_c2 | c_c3 | isfilled | intp_c1 |
307 ======================================================================================================================
308 2020-02-01 00:00:05.000 | td32727 | 5 | 5 | false | 5 |
309 2020-02-01 00:00:10.000 | td32727 | 10 | 10 | false | 10 |
310 2020-02-01 00:00:15.000 | td32727 | 15 | 15 | false | 15 |
311 taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (value, 1) order by irowts, c2, c3;
312 irowts | table_name | c_c2 | c_c3 | isfilled | intp_c1 |
313 ======================================================================================================================
314 2020-02-01 00:00:04.000 | td32727 | 5 | 5 | true | 1 |
315 2020-02-01 00:00:04.000 | td32727 | 10 | 10 | true | 1 |
316 2020-02-01 00:00:04.000 | td32727 | 15 | 15 | true | 1 |
317 2020-02-01 00:00:05.000 | td32727 | 5 | 5 | false | 5 |
318 2020-02-01 00:00:05.000 | td32727 | 10 | 10 | true | 1 |
319 2020-02-01 00:00:05.000 | td32727 | 15 | 15 | true | 1 |
320 2020-02-01 00:00:06.000 | td32727 | 5 | 5 | true | 1 |
321 2020-02-01 00:00:06.000 | td32727 | 10 | 10 | true | 1 |
322 2020-02-01 00:00:06.000 | td32727 | 15 | 15 | true | 1 |
323 2020-02-01 00:00:07.000 | td32727 | 5 | 5 | true | 1 |
324 2020-02-01 00:00:07.000 | td32727 | 10 | 10 | true | 1 |
325 2020-02-01 00:00:07.000 | td32727 | 15 | 15 | true | 1 |
326 2020-02-01 00:00:08.000 | td32727 | 5 | 5 | true | 1 |
327 2020-02-01 00:00:08.000 | td32727 | 10 | 10 | true | 1 |
328 2020-02-01 00:00:08.000 | td32727 | 15 | 15 | true | 1 |
329 2020-02-01 00:00:09.000 | td32727 | 5 | 5 | true | 1 |
330 2020-02-01 00:00:09.000 | td32727 | 10 | 10 | true | 1 |
331 2020-02-01 00:00:09.000 | td32727 | 15 | 15 | true | 1 |
332 2020-02-01 00:00:10.000 | td32727 | 5 | 5 | true | 1 |
333 2020-02-01 00:00:10.000 | td32727 | 10 | 10 | false | 10 |
334 2020-02-01 00:00:10.000 | td32727 | 15 | 15 | true | 1 |
335 2020-02-01 00:00:11.000 | td32727 | 5 | 5 | true | 1 |
336 2020-02-01 00:00:11.000 | td32727 | 10 | 10 | true | 1 |
337 2020-02-01 00:00:11.000 | td32727 | 15 | 15 | true | 1 |
338 2020-02-01 00:00:12.000 | td32727 | 5 | 5 | true | 1 |
339 2020-02-01 00:00:12.000 | td32727 | 10 | 10 | true | 1 |
340 2020-02-01 00:00:12.000 | td32727 | 15 | 15 | true | 1 |
341 2020-02-01 00:00:13.000 | td32727 | 5 | 5 | true | 1 |
342 2020-02-01 00:00:13.000 | td32727 | 10 | 10 | true | 1 |
343 2020-02-01 00:00:13.000 | td32727 | 15 | 15 | true | 1 |
344 2020-02-01 00:00:14.000 | td32727 | 5 | 5 | true | 1 |
345 2020-02-01 00:00:14.000 | td32727 | 10 | 10 | true | 1 |
346 2020-02-01 00:00:14.000 | td32727 | 15 | 15 | true | 1 |
347 2020-02-01 00:00:15.000 | td32727 | 5 | 5 | true | 1 |
348 2020-02-01 00:00:15.000 | td32727 | 10 | 10 | true | 1 |
349 2020-02-01 00:00:15.000 | td32727 | 15 | 15 | false | 15 |
350 2020-02-01 00:00:16.000 | td32727 | 5 | 5 | true | 1 |
351 2020-02-01 00:00:16.000 | td32727 | 10 | 10 | true | 1 |
352 2020-02-01 00:00:16.000 | td32727 | 15 | 15 | true | 1 |

View File

@ -0,0 +1,15 @@
select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (null) order by irowts;
select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (next) order by irowts;
select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (prev) order by irowts;
select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (linear) order by irowts;
select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (value, 1) order by irowts;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (null) order by irowts, c2;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (next) order by irowts, c2;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (prev) order by irowts, c2;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (linear) order by irowts, c2;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (value, 1) order by irowts, c2;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (null) order by irowts, c2, c3;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (next) order by irowts, c2, c3;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (prev) order by irowts, c2, c3;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (linear) order by irowts, c2, c3;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (value, 1) order by irowts, c2, c3;

View File

@ -0,0 +1,72 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
from frame import etool
from frame.etool import *
from frame.log import *
from frame.cases import *
from frame.sql import *
from frame.caseBase import *
from frame.common import *
class TDTestCase(TBase):
updatecfgDict = {
"keepColumnName": "1",
"ttlChangeOnWrite": "1",
"querySmaOptimize": "1",
"slowLogScope": "none",
"queryBufferSize": 10240
}
def insert_data(self):
tdLog.printNoPrefix("==========step1:create table")
tdSql.execute("create database test keep 36500")
tdSql.execute("use test")
tdSql.execute(
f'''create table if not exists test.td32727
(ts timestamp, c0 tinyint, c1 smallint, c2 int, c3 bigint, c4 double, c5 float, c6 bool, c7 varchar(10), c8 nchar(10), c9 tinyint unsigned, c10 smallint unsigned, c11 int unsigned, c12 bigint unsigned)
'''
)
tdLog.printNoPrefix("==========step2:insert data")
tdSql.execute(f"insert into test.td32727 values ('2020-02-01 00:00:05', 5, 5, 5, 5, 5.0, 5.0, true, 'varchar', 'nchar', 5, 5, 5, 5)")
tdSql.execute(f"insert into test.td32727 values ('2020-02-01 00:00:10', 10, 10, 10, 10, 10.0, 10.0, true, 'varchar', 'nchar', 10, 10, 10, 10)")
tdSql.execute(f"insert into test.td32727 values ('2020-02-01 00:00:15', 15, 15, 15, 15, 15.0, 15.0, true, 'varchar', 'nchar', 15, 15, 15, 15)")
def test_normal_query_new(self, testCase):
# read sql from .sql file and execute
tdLog.info("test normal query.")
self.sqlFile = etool.curFile(__file__, f"in/{testCase}.in")
self.ansFile = etool.curFile(__file__, f"ans/{testCase}.csv")
tdCom.compare_testcase_result(self.sqlFile, self.ansFile, testCase)
def test_interp(self):
self.test_normal_query_new("interp")
def run(self):
tdLog.debug(f"start to excute {__file__}")
self.insert_data()
# math function
self.test_interp()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())

View File

@ -16,6 +16,7 @@
,,y,army,./pytest.sh python3 ./test.py -f query/function/test_func_elapsed.py
,,y,army,./pytest.sh python3 ./test.py -f query/function/test_function.py
,,y,army,./pytest.sh python3 ./test.py -f query/function/test_resinfo.py
,,y,army,./pytest.sh python3 ./test.py -f query/function/test_interp.py
,,y,army,./pytest.sh python3 ./test.py -f query/function/concat.py
,,y,army,./pytest.sh python3 ./test.py -f query/function/cast.py
,,y,army,./pytest.sh python3 ./test.py -f query/test_join.py

View File

@ -20,7 +20,7 @@ sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bi
$count = 0
while $count < $N
$ms = 1591200000000 + $count
sql insert into $tb values( $ms , 1, 0, $count , $count , $count ,'it is a string')
sql insert into $tb values( $ms , 10, 0, $count , $count , $count ,'it is a string')
$count = $count + 1
endw
@ -29,6 +29,13 @@ if $rows != $N then
return -1
endi
sql flush database $db
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step2
$i = 1
$db = $dbPrefix . $i

View File

@ -0,0 +1,146 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ============================ dnode1 start
$i = 0
$dbPrefix = db
$tbPrefix = tb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$N = 2000
print =============== step1
sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool encode 'disabled', t tinyint encode 'disabled', s smallint encode 'disabled', i int encode 'disabled', big bigint encode 'disabled', str binary(256))
$count = 0
while $count < $N
$ms = 1591200000000 + $count
sql insert into $tb values( $ms , 1, 0, $count , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
sql flush database $db
sql select * from $tb
if $rows != $N then
return -1
endi
sql alter table $tb modify column ts encode 'disabled'
$count = 0
while $count < $N
$ms = 1591200030000 + $count
sql insert into $tb values( $ms , 1, 0, $count , $count , $count ,'it is a string')
$count = $count + 1
endw
$M = 4000
sql select * from $tb
if $rows != $M then
return -1
endi
sql flush database $db
sql select * from $tb
if $rows != $M then
return -1
endi
$stb1 = txx1
sql create table txx1 (ts timestamp encode 'disabled' compress 'disabled' level 'h', f int compress 'lz4') tags(t int)
$count = 0
$subTb1 = txx1_sub1
$subTb2 = txx1_sub2
sql create table $subTb1 using $stb1 tags(1)
sql create table $subTb2 using $stb1 tags(2)
while $count < $N
$ms = 1591200030000 + $count
sql insert into $subTb1 values( $ms , 1)
$ms2 = 1591200040000 + $count
sql insert into $subTb2 values( $ms2 , 1)
$count = $count + 1
endw
$count = 0
sql select * from $stb1
if $rows != $M then
return -1
endi
sql flush database $db
sql select * from $stb1
if $rows != $M then
return -1
endi
$L = 8000
sql alter table $stb1 modify column ts encode 'delta-i'
sql alter table $stb1 modify column f encode 'disabled'
while $count < $N
$ms = 1591200050000 + $count
sql insert into $subTb1 values( $ms , 1)
$ms2 = 1591200060000 + $count
sql insert into $subTb2 values( $ms2 , 1)
$count = $count + 1
endw
sql select * from $stb1
if $rows != $L then
return -1
endi
sql flush database $db
sql select * from $stb1
if $rows != $L then
return -1
endi
sql alter table $stb1 modify column ts encode 'disabled'
$count = 0
$I = 12000
while $count < $N
$ms = 1591200070000 + $count
sql insert into $subTb1 values( $ms , 1)
$ms2 = 1591200080000 + $count
sql insert into $subTb2 values( $ms2 , 1)
$count = $count + 1
endw
sql select * from $stb1
if $rows != $I then
return -1
endi
sql flush database $db
sql select * from $stb1
if $rows != $I then
return -1
endi

View File

@ -325,6 +325,7 @@
./test.sh -f tsim/compress/compress.sim
./test.sh -f tsim/compress/compress_col.sim
./test.sh -f tsim/compress/uncompress.sim
./test.sh -f tsim/compress/compressDisable.sim
./test.sh -f tsim/compute/avg.sim
./test.sh -f tsim/compute/block_dist.sim
./test.sh -f tsim/compute/bottom.sim