mirror of
https://github.com/minio/minio.git
synced 2025-11-11 22:40:14 -05:00
Fix JSON parser handling for certain objects (#7162)
This PR also adds some comments and simplifies the code. Primary handling is done to ensure that we make sure to honor cached buffer. Added unit tests as well Fixes #7141
This commit is contained in:
committed by
Nitish Tiwari
parent
d203e7e1cc
commit
85e939636f
12
pkg/s3select/json/data/10.json
Normal file
12
pkg/s3select/json/data/10.json
Normal file
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"key_1": "value",
|
||||
"key_2": "value"
|
||||
}
|
||||
]
|
||||
[
|
||||
{
|
||||
"key_1": "value2",
|
||||
"key_2": "value3"
|
||||
}
|
||||
]
|
||||
8
pkg/s3select/json/data/11.json
Normal file
8
pkg/s3select/json/data/11.json
Normal file
@@ -0,0 +1,8 @@
|
||||
"a"
|
||||
1
|
||||
3.145
|
||||
["a"]
|
||||
{}
|
||||
{
|
||||
"a": 1
|
||||
}
|
||||
5
pkg/s3select/json/data/12.json
Normal file
5
pkg/s3select/json/data/12.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"a": 1
|
||||
}{
|
||||
"b": 2
|
||||
}
|
||||
1
pkg/s3select/json/data/2.json
Normal file
1
pkg/s3select/json/data/2.json
Normal file
@@ -0,0 +1 @@
|
||||
{"text": "hello world\\n2nd line"}
|
||||
1
pkg/s3select/json/data/3.json
Normal file
1
pkg/s3select/json/data/3.json
Normal file
@@ -0,0 +1 @@
|
||||
{"hello":"wor{l}d"}
|
||||
26
pkg/s3select/json/data/4.json
Normal file
26
pkg/s3select/json/data/4.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"id": "0001",
|
||||
"type": "donut",
|
||||
"name": "Cake",
|
||||
"ppu": 0.55,
|
||||
"batters":
|
||||
{
|
||||
"batter":
|
||||
[
|
||||
{ "id": "1001", "type": "Regular" },
|
||||
{ "id": "1002", "type": "Chocolate" },
|
||||
{ "id": "1003", "type": "Blueberry" },
|
||||
{ "id": "1004", "type": "Devil's Food" }
|
||||
]
|
||||
},
|
||||
"topping":
|
||||
[
|
||||
{ "id": "5001", "type": "None" },
|
||||
{ "id": "5002", "type": "Glazed" },
|
||||
{ "id": "5005", "type": "Sugar" },
|
||||
{ "id": "5007", "type": "Powdered Sugar" },
|
||||
{ "id": "5006", "type": "Chocolate with Sprinkles" },
|
||||
{ "id": "5003", "type": "Chocolate" },
|
||||
{ "id": "5004", "type": "Maple" }
|
||||
]
|
||||
}
|
||||
5
pkg/s3select/json/data/5.json
Normal file
5
pkg/s3select/json/data/5.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"foo": {
|
||||
"bar": "baz"
|
||||
}
|
||||
}
|
||||
1
pkg/s3select/json/data/6.json
Normal file
1
pkg/s3select/json/data/6.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "name": "John", "age":28, "hobby": { "name": "chess", "type": "boardgame" }}
|
||||
3
pkg/s3select/json/data/7.json
Normal file
3
pkg/s3select/json/data/7.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{"name":"Michael", "age": 31}
|
||||
{"name":"Andy", "age": 30}
|
||||
{"name":"Justin", "age": 19}
|
||||
2
pkg/s3select/json/data/8.json
Normal file
2
pkg/s3select/json/data/8.json
Normal file
@@ -0,0 +1,2 @@
|
||||
{"a":"}"
|
||||
}
|
||||
6
pkg/s3select/json/data/9.json
Normal file
6
pkg/s3select/json/data/9.json
Normal file
@@ -0,0 +1,6 @@
|
||||
[
|
||||
{
|
||||
"key_1": "value",
|
||||
"key_2": "value"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user