fix:uniform output csv format with shell output
This commit is contained in:
parent
e30cdd03de
commit
4d3d48d3b7
|
@ -326,6 +326,7 @@ void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, i
|
||||||
char quotationStr[2];
|
char quotationStr[2];
|
||||||
quotationStr[0] = '\"';
|
quotationStr[0] = '\"';
|
||||||
quotationStr[1] = 0;
|
quotationStr[1] = 0;
|
||||||
|
int32_t width;
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
char buf[TSDB_MAX_BYTES_PER_ROW];
|
char buf[TSDB_MAX_BYTES_PER_ROW];
|
||||||
|
@ -358,7 +359,7 @@ void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, i
|
||||||
taosFprintfFile(pFile, "%" PRIu64, *((uint64_t *)val));
|
taosFprintfFile(pFile, "%" PRIu64, *((uint64_t *)val));
|
||||||
break;
|
break;
|
||||||
case TSDB_DATA_TYPE_FLOAT:
|
case TSDB_DATA_TYPE_FLOAT:
|
||||||
int32_t width = SHELL_FLOAT_WIDTH;
|
width = SHELL_FLOAT_WIDTH;
|
||||||
if (tsEnableScience) {
|
if (tsEnableScience) {
|
||||||
taosFprintfFile(pFile, "%*e", width, GET_FLOAT_VAL(val));
|
taosFprintfFile(pFile, "%*e", width, GET_FLOAT_VAL(val));
|
||||||
} else {
|
} else {
|
||||||
|
@ -371,7 +372,7 @@ void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, i
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TSDB_DATA_TYPE_DOUBLE:
|
case TSDB_DATA_TYPE_DOUBLE:
|
||||||
int32_t width = SHELL_DOUBLE_WIDTH;
|
width = SHELL_DOUBLE_WIDTH;
|
||||||
if (tsEnableScience) {
|
if (tsEnableScience) {
|
||||||
snprintf(buf, TSDB_MAX_BYTES_PER_ROW, "%.9e", GET_DOUBLE_VAL(val));
|
snprintf(buf, TSDB_MAX_BYTES_PER_ROW, "%.9e", GET_DOUBLE_VAL(val));
|
||||||
taosFprintfFile(pFile, "%*s", width, buf);
|
taosFprintfFile(pFile, "%*s", width, buf);
|
||||||
|
|
Loading…
Reference in New Issue