MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / executeImpl

Method executeImpl

src/Functions/toJSONString.cpp:36–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return true; }
35
36 ColumnPtr
37 executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & /*result_type*/, size_t input_rows_count) const override
38 {
39 auto res = ColumnString::create();
40 ColumnString::Chars & data_to = res->getChars();
41 ColumnString::Offsets & offsets_to = res->getOffsets();
42 offsets_to.resize(input_rows_count);
43
44 auto serializer = arguments[0].type->getDefaultSerialization();
45 WriteBufferFromVector<ColumnString::Chars> json(data_to);
46 for (size_t i = 0; i < input_rows_count; ++i)
47 {
48 serializer->serializeTextJSON(*arguments[0].column, i, json, format_settings);
49 offsets_to[i] = json.count();
50 }
51
52 json.finalize();
53 return res;
54 }
55
56 private:
57 /// Affects only subset of part of settings related to json.

Callers

nothing calls this directly

Calls 8

createFunction · 0.70
getCharsMethod · 0.45
getOffsetsMethod · 0.45
resizeMethod · 0.45
serializeTextJSONMethod · 0.45
countMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected