Skip to content

Commit

Permalink
fix: replace null with blank
Browse files Browse the repository at this point in the history
  • Loading branch information
DuanKuanJun committed May 22, 2024
1 parent 4f2bc5f commit 44137d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/benchCsv.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ int32_t genRowByField(char* buf, BArray* fields, int16_t fieldCnt, char* binanry
}
}

pos1 += dataGenByField(fd, buf, pos1, prefix, k);
pos1 += dataGenByField(fd, buf, pos1, prefix, k, "");
}

return pos1;
Expand Down
8 changes: 3 additions & 5 deletions src/benchDataMix.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include "benchDataMix.h"
#include <float.h>

#define VAL_NULL "NULL"

#define VBOOL_CNT 3

int32_t inul = 20; // interval null count
Expand Down Expand Up @@ -97,11 +95,11 @@ uint32_t genRadomString(char* val, uint32_t len, char* prefix) {


// data row generate by randowm
uint32_t dataGenByField(Field* fd, char* pstr, uint32_t len, char* prefix, int64_t *k) {
uint32_t dataGenByField(Field* fd, char* pstr, uint32_t len, char* prefix, int64_t *k, char* nullVal) {
uint32_t size = 0;
char val[512] = VAL_NULL;
char val[512] = {0};
if( fd->fillNull && RD(inul) == 0 ) {
size = sprintf(pstr + len, ",%s", VAL_NULL);
size = sprintf(pstr + len, ",%s", nullVal);
return size;
}

Expand Down
4 changes: 3 additions & 1 deletion src/benchInsertMix.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ uint32_t appendRowRuleOld(SSuperTable* stb, char* pstr, uint32_t len, int64_t ti
}

#define GET_IDX(i) info->batCols[i]
#define VAL_NULL "NULL"

uint32_t genRowMixAll(threadInfo* info, SSuperTable* stb, char* pstr, uint32_t len, int64_t ts, int64_t* k) {
uint32_t size = 0;
// first col is ts
Expand Down Expand Up @@ -317,7 +319,7 @@ uint32_t genRowMixAll(threadInfo* info, SSuperTable* stb, char* pstr, uint32_t l
}
}

size += dataGenByField(fd, pstr, len + size, prefix, k);
size += dataGenByField(fd, pstr, len + size, prefix, k, VAL_NULL);
}

// end
Expand Down

0 comments on commit 44137d8

Please sign in to comment.