Skip to content

Commit 6955fd7

Browse files
mccxjzz-jason
authored andcommitted
add more builtin functions for JSON (#102)
for pingcap/tidb#7546
1 parent 5e46e0e commit 6955fd7

8 files changed

+1791
-1665
lines changed

go-tipb/expression.pb.go

+316-273
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/expression.proto

+12
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,18 @@ enum ScalarFuncSig {
404404
JsonArraySig = 5010;
405405
JsonValidSig = 5011;
406406
JsonContainsSig = 5012;
407+
JsonArrayAppendSig = 5013;
408+
JsonArrayInsertSig = 5014;
409+
JsonMergePatchSig = 5015;
410+
JsonMergePreserveSig = 5016;
411+
JsonContainsPathSig = 5017;
412+
JsonPrettySig = 5018;
413+
JsonQuoteSig = 5019;
414+
JsonSearchSig = 5020;
415+
JsonStorageSizeSig = 5021;
416+
JsonDepthSig = 5022;
417+
JsonKeysSig = 5023;
418+
JsonLengthSig = 5024;
407419

408420
/*time*/
409421
DateFormatSig = 6001;

src/analyze.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3041,7 +3041,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
30413041
\x18\x01\x20\x03(\rR\x08counters\"1\n\x08CMSketch\x12%\n\x04rows\x18\x01\
30423042
\x20\x03(\x0b2\x11.tipb.CMSketchRowR\x04rows*,\n\x0bAnalyzeType\x12\r\n\
30433043
\tTypeIndex\x10\0\x12\x0e\n\nTypeColumn\x10\x01B%\n\x15com.pingcap.tidb.\
3044-
tipbP\x01\xe0\xe2\x1e\x01\xc8\xe2\x1e\x01\xd0\xe2\x1e\x01J\xd5,\n\x06\
3044+
tipbP\x01\xe0\xe2\x1e\x01\xd0\xe2\x1e\x01\xc8\xe2\x1e\x01J\xd5,\n\x06\
30453045
\x12\x04\0\0n\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\
30463046
\x03\x02\x08\x0c\n\x08\n\x01\x08\x12\x03\x04\0\"\n\x0b\n\x04\x08\xe7\x07\
30473047
\0\x12\x03\x04\0\"\n\x0c\n\x05\x08\xe7\x07\0\x02\x12\x03\x04\x07\x1a\n\r\

src/checksum.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
595595
\x08totalKvsB\x04\xc8\xde\x1f\0\x12%\n\x0btotal_bytes\x18\x03\x20\x01(\
596596
\x04R\ntotalBytesB\x04\xc8\xde\x1f\0*&\n\x0eChecksumScanOn\x12\t\n\x05Ta\
597597
ble\x10\0\x12\t\n\x05Index\x10\x01*\"\n\x11ChecksumAlgorithm\x12\r\n\tCr\
598-
c64_Xor\x10\0B%\n\x15com.pingcap.tidb.tipbP\x01\xe0\xe2\x1e\x01\xc8\xe2\
599-
\x1e\x01\xd0\xe2\x1e\x01J\xb6\r\n\x06\x12\x04\0\0\x20\x01\n\x08\n\x01\
598+
c64_Xor\x10\0B%\n\x15com.pingcap.tidb.tipbP\x01\xc8\xe2\x1e\x01\xd0\xe2\
599+
\x1e\x01\xe0\xe2\x1e\x01J\xb6\r\n\x06\x12\x04\0\0\x20\x01\n\x08\n\x01\
600600
\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x02\x08\x0c\n\x08\n\x01\x08\
601601
\x12\x03\x04\0\"\n\x0b\n\x04\x08\xe7\x07\0\x12\x03\x04\0\"\n\x0c\n\x05\
602602
\x08\xe7\x07\0\x02\x12\x03\x04\x07\x1a\n\r\n\x06\x08\xe7\x07\0\x02\0\x12\

src/executor.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2212,8 +2212,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
22122212
\x01\n\x08ExecType\x12\x11\n\rTypeTableScan\x10\0\x12\x11\n\rTypeIndexSc\
22132213
an\x10\x01\x12\x11\n\rTypeSelection\x10\x02\x12\x13\n\x0fTypeAggregation\
22142214
\x10\x03\x12\x0c\n\x08TypeTopN\x10\x04\x12\r\n\tTypeLimit\x10\x05\x12\
2215-
\x11\n\rTypeStreamAgg\x10\x06B%\n\x15com.pingcap.tidb.tipbP\x01\xc8\xe2\
2216-
\x1e\x01\xd0\xe2\x1e\x01\xe0\xe2\x1e\x01J\xcb\x1e\n\x06\x12\x04\0\0O\x01\
2215+
\x11\n\rTypeStreamAgg\x10\x06B%\n\x15com.pingcap.tidb.tipbP\x01\xe0\xe2\
2216+
\x1e\x01\xc8\xe2\x1e\x01\xd0\xe2\x1e\x01J\xcb\x1e\n\x06\x12\x04\0\0O\x01\
22172217
\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x02\x08\x0c\n\
22182218
\x08\n\x01\x08\x12\x03\x04\0\"\n\x0b\n\x04\x08\xe7\x07\0\x12\x03\x04\0\"\
22192219
\n\x0c\n\x05\x08\xe7\x07\0\x02\x12\x03\x04\x07\x1a\n\r\n\x06\x08\xe7\x07\

src/expression.rs

+1,455-1,384
Large diffs are not rendered by default.

src/schema.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
12481248
foR\x07columns\x12\x1c\n\x06unique\x18\x04\x20\x01(\x08R\x06uniqueB\x04\
12491249
\xc8\xde\x1f\0\"0\n\x08KeyRange\x12\x10\n\x03low\x18\x01\x20\x01(\x0cR\
12501250
\x03low\x12\x12\n\x04high\x18\x02\x20\x01(\x0cR\x04highB%\n\x15com.pingc\
1251-
ap.tidb.tipbP\x01\xc8\xe2\x1e\x01\xe0\xe2\x1e\x01\xd0\xe2\x1e\x01J\xe9\
1251+
ap.tidb.tipbP\x01\xe0\xe2\x1e\x01\xd0\xe2\x1e\x01\xc8\xe2\x1e\x01J\xe9\
12521252
\x17\n\x06\x12\x04\0\0)\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\
12531253
\x02\x12\x03\x02\x08\x0c\n\x08\n\x01\x08\x12\x03\x04\0\"\n\x0b\n\x04\x08\
12541254
\xe7\x07\0\x12\x03\x04\0\"\n\x0c\n\x05\x08\xe7\x07\0\x02\x12\x03\x04\x07\

src/select.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2327,8 +2327,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
23272327
\x12'\n\x08warnings\x18\x04\x20\x03(\x0b2\x0b.tipb.ErrorR\x08warnings\
23282328
\x12#\n\routput_counts\x18\x05\x20\x03(\x03R\x0coutputCounts\x12#\n\rwar\
23292329
ning_count\x18\x06\x20\x01(\x03R\x0cwarningCount\x12]\n\x0erow_batch_dat\
2330-
a\x18\x07\x20\x01(\x0cR\x0crowBatchDataB7\xc8\xde\x1f\0\xda\xde\x1f/gith\
2331-
ub.com/pingcap/tipb/sharedbytes.SharedBytes\"\x8f\x01\n\x05Chunk\x12T\n\
2330+
a\x18\x07\x20\x01(\x0cR\x0crowBatchDataB7\xda\xde\x1f/github.com/pingcap\
2331+
/tipb/sharedbytes.SharedBytes\xc8\xde\x1f\0\"\x8f\x01\n\x05Chunk\x12T\n\
23322332
\trows_data\x18\x03\x20\x01(\x0cR\x08rowsDataB7\xda\xde\x1f/github.com/p\
23332333
ingcap/tipb/sharedbytes.SharedBytes\xc8\xde\x1f\0\x120\n\trows_meta\x18\
23342334
\x04\x20\x03(\x0b2\r.tipb.RowMetaR\x08rowsMetaB\x04\xc8\xde\x1f\0\"E\n\

0 commit comments

Comments
 (0)