• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #4720

08 Sep 2025 08:43AM UTC coverage: 58.139% (-0.6%) from 58.762%
#4720

push

travis-ci

web-flow
Merge pull request #32881 from taosdata/enh/add-new-windows-ci

fix(ci): update workflow reference to use new Windows CI YAML

133181 of 292179 branches covered (45.58%)

Branch coverage included in aggregate %.

201691 of 283811 relevant lines covered (71.07%)

5442780.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.52
/source/libs/scalar/inc/sclvector.h
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#ifndef _TD_COMMON_BIN_SCALAR_OPERATOR_H_
17
#define _TD_COMMON_BIN_SCALAR_OPERATOR_H_
18

19
#ifdef __cplusplus
20
extern "C" {
21
#endif
22

23
typedef struct SSclVectorConvCtx {
24
  const SScalarParam* pIn;
25
  SScalarParam* pOut;
26
  int32_t startIndex; 
27
  int32_t endIndex;
28
  int16_t inType;
29
  int16_t outType;
30
} SSclVectorConvCtx;
31

32
typedef int32_t (*_getDoubleValue_fn_t)(void *src, int32_t index, double *out);
33

34
static FORCE_INLINE int32_t getVectorDoubleValue_TINYINT(void *src, int32_t index, double *out) {
4,218,947✔
35
  *out = (double)*((int8_t *)src + index);
4,218,947✔
36
  return TSDB_CODE_SUCCESS;
4,218,947✔
37
}
38
static FORCE_INLINE int32_t getVectorDoubleValue_UTINYINT(void *src, int32_t index, double *out) {
261,740✔
39
  *out = (double)*((uint8_t *)src + index);
261,740✔
40
  return TSDB_CODE_SUCCESS;
261,740✔
41
}
42
static FORCE_INLINE int32_t getVectorDoubleValue_SMALLINT(void *src, int32_t index, double *out) {
3,481,673✔
43
  *out = (double)*((int16_t *)src + index);
3,481,673✔
44
  return TSDB_CODE_SUCCESS;
3,481,673✔
45
}
46
static FORCE_INLINE int32_t getVectorDoubleValue_USMALLINT(void *src, int32_t index, double *out) {
16✔
47
  *out = (double)*((uint16_t *)src + index);
16✔
48
  return TSDB_CODE_SUCCESS;
16✔
49
}
50
static FORCE_INLINE int32_t getVectorDoubleValue_INT(void *src, int32_t index, double *out) {
15,625,466✔
51
  *out = (double)*((int32_t *)src + index);
15,625,466✔
52
  return TSDB_CODE_SUCCESS;
15,625,466✔
53
}
54
static FORCE_INLINE int32_t getVectorDoubleValue_UINT(void *src, int32_t index, double *out) {
25,857✔
55
  *out = (double)*((uint32_t *)src + index);
25,857✔
56
  return TSDB_CODE_SUCCESS;
25,857✔
57
}
58
static FORCE_INLINE int32_t getVectorDoubleValue_BIGINT(void *src, int32_t index, double *out) {
88,906,336✔
59
  *out = (double)*((int64_t *)src + index);
88,906,336✔
60
  return TSDB_CODE_SUCCESS;
88,906,336✔
61
}
62
static FORCE_INLINE int32_t getVectorDoubleValue_UBIGINT(void *src, int32_t index, double *out) {
26,209✔
63
  *out = (double)*((uint64_t *)src + index);
26,209✔
64
  return TSDB_CODE_SUCCESS;
26,209✔
65
}
66
static FORCE_INLINE int32_t getVectorDoubleValue_FLOAT(void *src, int32_t index, double *out) {
3,504,550✔
67
  *out = (double)*((float *)src + index);
3,504,550✔
68
  return TSDB_CODE_SUCCESS;
3,504,550✔
69
}
70
static FORCE_INLINE int32_t getVectorDoubleValue_DOUBLE(void *src, int32_t index, double *out) {
43,455,674✔
71
  *out = (double)*((double *)src + index);
43,455,674✔
72
  return TSDB_CODE_SUCCESS;
43,455,674✔
73
}
74
static FORCE_INLINE int32_t getVectorDoubleValue_BOOL(void *src, int32_t index, double *out) {
173,032✔
75
  *out = (double)*((bool *)src + index);
173,032✔
76
  return TSDB_CODE_SUCCESS;
173,032✔
77
}
78

79
int32_t getVectorDoubleValue_JSON(void *src, int32_t index, double *out);
80

81
static FORCE_INLINE int32_t getVectorDoubleValueFn(int32_t srcType, _getDoubleValue_fn_t *p) {
82
  *p = NULL;
4,873,122✔
83
  if (srcType == TSDB_DATA_TYPE_TINYINT) {
4,873,122!
84
    *p = getVectorDoubleValue_TINYINT;
338,627✔
85
  } else if (srcType == TSDB_DATA_TYPE_UTINYINT) {
4,534,495!
86
    *p = getVectorDoubleValue_UTINYINT;
827✔
87
  } else if (srcType == TSDB_DATA_TYPE_SMALLINT) {
4,533,668!
88
    *p = getVectorDoubleValue_SMALLINT;
287,698✔
89
  } else if (srcType == TSDB_DATA_TYPE_USMALLINT) {
4,245,970!
90
    *p = getVectorDoubleValue_USMALLINT;
19✔
91
  } else if (srcType == TSDB_DATA_TYPE_INT) {
4,245,951!
92
    *p = getVectorDoubleValue_INT;
524,527✔
93
  } else if (srcType == TSDB_DATA_TYPE_UINT) {
3,721,424!
94
    *p = getVectorDoubleValue_UINT;
655✔
95
  } else if (srcType == TSDB_DATA_TYPE_BIGINT) {
3,720,769✔
96
    *p = getVectorDoubleValue_BIGINT;
865,989✔
97
  } else if (srcType == TSDB_DATA_TYPE_UBIGINT) {
2,854,780!
98
    *p = getVectorDoubleValue_UBIGINT;
889✔
99
  } else if (srcType == TSDB_DATA_TYPE_FLOAT) {
2,853,891!
100
    *p = getVectorDoubleValue_FLOAT;
288,808✔
101
  } else if (srcType == TSDB_DATA_TYPE_DOUBLE) {
2,565,083!
102
    *p = getVectorDoubleValue_DOUBLE;
2,499,895✔
103
  } else if (srcType == TSDB_DATA_TYPE_TIMESTAMP) {
65,267!
104
    *p = getVectorDoubleValue_BIGINT;
13,488✔
105
  } else if (srcType == TSDB_DATA_TYPE_JSON) {
51,779!
106
    *p = getVectorDoubleValue_JSON;
346✔
107
  } else if (srcType == TSDB_DATA_TYPE_BOOL) {
51,433!
108
    *p = getVectorDoubleValue_BOOL;
51,589✔
109
  } else if (srcType == TSDB_DATA_TYPE_NULL) {
×
110
    *p = NULL;
24✔
111
  } else {
112
    *p = NULL;
×
113
    return TSDB_CODE_SCALAR_CONVERT_ERROR;
×
114
  }
115
  return TSDB_CODE_SUCCESS;
4,873,381✔
116
}
117

118
typedef int32_t (*_bufConverteFunc)(char *buf, SScalarParam *pOut, int32_t outType, int32_t *overflow);
119
typedef int32_t (*_bin_scalar_fn_t)(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *output, int32_t order);
120
_bin_scalar_fn_t getBinScalarOperatorFn(int32_t binOperator);
121

122
int32_t vectorAssignRange(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *pOut, int32_t rowStartIdx, int32_t rowEndIdx, int32_t _ord);
123

124
#ifdef __cplusplus
125
}
126
#endif
127

128
#endif /*_TD_COMMON_BIN_SCALAR_OPERATOR_H_*/
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc