Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 5481085

Browse files
committed
add a few more tests (+ tested them manually)
1 parent 61be4cd commit 5481085

File tree

1 file changed

+93
-8
lines changed

1 file changed

+93
-8
lines changed

platform/testdata/requests.go

Lines changed: 93 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,6 +2402,28 @@ Men\\'s Clothing \\\\ %' LIMIT 10`},
24022402
[]string{},
24032403
},
24042404
{ // [44]
2405+
// DateTime64(3 or 9) are "normal"/standard. We check weird one like 2.
2406+
"ids, 1 value, different DateTime format: with timezone, precision: 2",
2407+
`{
2408+
"query": {
2409+
"ids": {
2410+
"values": ["323032352d30372d30362030393a33383a30332e3132202b3030303020555443qqq3635363236333330333833373335333633363331333736333335333736353632363333313337333233313330363536353330333236313332363633323631333833323634333833313333333033333636333933353332333033363631333533363335333833323333363233393333333733333635333733353338333736333632"]
2411+
}
2412+
},
2413+
"track_total_hits": false
2414+
}`,
2415+
[]string{`"@timestamp" = toDateTime64('2025-07-06 09:38:03.12',2)`},
2416+
model.ListAllFields,
2417+
[]string{
2418+
`SELECT "message" ` +
2419+
`FROM ` + TableName + ` ` +
2420+
`WHERE "@timestamp" = toDateTime64('2025-07-06 09:38:03.12',2) ` +
2421+
`LIMIT 10`,
2422+
},
2423+
[]string{},
2424+
},
2425+
{ // [45]
2426+
// important test, DateTime64(3) is pretty standard
24052427
"ids, 1 value, different DateTime format: with timezone, precision: 3",
24062428
`{
24072429
"query": {
@@ -2421,7 +2443,70 @@ Men\\'s Clothing \\\\ %' LIMIT 10`},
24212443
},
24222444
[]string{},
24232445
},
2424-
{ // [45]
2446+
{ // [46]
2447+
// important test, DateTime64(9) is pretty standard
2448+
"ids, 1 value, different DateTime format: with timezone, precision: 9",
2449+
`{
2450+
"query": {
2451+
"ids": {
2452+
"values": ["323032352d30372d30362031303a31313a30332e313233343536373839202b3030303020555443qqq3338363633373635363433333334333333353331333936333334363336333634333836313632363136343634333633343634363433393337333333393338333933323634333533393334333936333635363333353338333233313331363436313337333533333338333133333339333933383335333033393636363633343636"]
2453+
}
2454+
},
2455+
"track_total_hits": false
2456+
}`,
2457+
[]string{`"@timestamp" = toDateTime64('2025-07-06 10:11:03.123456789',9)`},
2458+
model.ListAllFields,
2459+
[]string{
2460+
`SELECT "message" ` +
2461+
`FROM ` + TableName + ` ` +
2462+
`WHERE "@timestamp" = toDateTime64('2025-07-06 10:11:03.123456789',9) ` +
2463+
`LIMIT 10`,
2464+
},
2465+
[]string{},
2466+
},
2467+
{ // [47]
2468+
// DateTime64(3 or 9) are "normal"/standard. We check weird one like 7.
2469+
"ids, 1 value, different DateTime format: with timezone, precision: 7",
2470+
`{
2471+
"query": {
2472+
"ids": {
2473+
"values": ["323032352d30372d30362030393a33363a30332e32353531323336202b3030303020555443qqq3338333636363634333733363634333533363333333336363339333736343330363136323334363136343631363533333336363133313636333236323337333936313632333133323335333733363632363633313335333136323334333336333636333833373333363333343331363336313330333133363636333136353631"]
2474+
}
2475+
},
2476+
"track_total_hits": false
2477+
}`,
2478+
[]string{`"@timestamp" = toDateTime64('2025-07-06 09:36:03.2551236',7)`},
2479+
model.ListAllFields,
2480+
[]string{
2481+
`SELECT "message" ` +
2482+
`FROM ` + TableName + ` ` +
2483+
`WHERE "@timestamp" = toDateTime64('2025-07-06 09:36:03.2551236',7) ` +
2484+
`LIMIT 10`,
2485+
},
2486+
[]string{},
2487+
},
2488+
{ // [48]
2489+
// DateTime64(3 or 9) are "normal"/standard. We check weird one like 7.
2490+
"ids, 1 value, different DateTime format: with timezone, precision: 7, but timestamp with only 1 (.1)",
2491+
`{
2492+
"query": {
2493+
"ids": {
2494+
"values": ["323032352d30372d30362030393a33383a30332e31202b3030303020555443qqq3339333533343339333033303332333533363631333033323333333936363335333636333339363436363632333336323336363233383332333233353335363233343631363436363332363433383331363636333636333033353333333833363631333533333338333133303334333336313634333733393631363333333633"]
2495+
}
2496+
},
2497+
"track_total_hits": false
2498+
}`,
2499+
[]string{`"@timestamp" = toDateTime64('2025-07-06 09:38:03.1',1)`},
2500+
model.ListAllFields,
2501+
[]string{
2502+
`SELECT "message" ` +
2503+
`FROM ` + TableName + ` ` +
2504+
`WHERE "@timestamp" = toDateTime64('2025-07-06 09:38:03.1',1) ` +
2505+
`LIMIT 10`,
2506+
},
2507+
[]string{},
2508+
},
2509+
{ // [49]
24252510
"ids, 2+ values",
24262511
`{
24272512
"query": {
@@ -2444,7 +2529,7 @@ Men\\'s Clothing \\\\ %' LIMIT 10`},
24442529
},
24452530
[]string{},
24462531
},
2447-
{ // [46]
2532+
{ // [50]
24482533
"ids with DateTime64(9) (trailing zeroes)",
24492534
`{
24502535
"query": {
@@ -2464,7 +2549,7 @@ Men\\'s Clothing \\\\ %' LIMIT 10`},
24642549
},
24652550
[]string{},
24662551
},
2467-
{ // [46]
2552+
{ // [51]
24682553
"ids with DateTime64(9) (no trailing zeroes)",
24692554
`{
24702555
"query": {
@@ -2484,7 +2569,7 @@ Men\\'s Clothing \\\\ %' LIMIT 10`},
24842569
},
24852570
[]string{},
24862571
},
2487-
{ // [47]
2572+
{ // [52]
24882573
"ids with DateTime64(0)",
24892574
`{
24902575
"query": {
@@ -2505,7 +2590,7 @@ Men\\'s Clothing \\\\ %' LIMIT 10`},
25052590
},
25062591
[]string{},
25072592
},
2508-
{ // [48]
2593+
{ // [53]
25092594
"ids with DateTime64(1)",
25102595
`{
25112596
"query": {
@@ -2525,7 +2610,7 @@ Men\\'s Clothing \\\\ %' LIMIT 10`},
25252610
},
25262611
[]string{},
25272612
},
2528-
{ // [49]
2613+
{ // [54]
25292614
Name: "range with int as datetime. when all query tests use transformers, expected results should be different",
25302615
QueryJson: `
25312616
{
@@ -2555,7 +2640,7 @@ Men\\'s Clothing \\\\ %' LIMIT 10`},
25552640
`LIMIT 10`,
25562641
},
25572642
},
2558-
{ // [50]
2643+
{ // [55]
25592644
Name: "range with int not as datetime. when all query tests use transformers, expected results should be different",
25602645
QueryJson: `
25612646
{
@@ -2584,7 +2669,7 @@ Men\\'s Clothing \\\\ %' LIMIT 10`},
25842669
`LIMIT 10`,
25852670
},
25862671
},
2587-
{ // [51]
2672+
{ // [56]
25882673
"_index term",
25892674
`{
25902675
"query": { /*one comment */

0 commit comments

Comments
 (0)