Skip to content

Commit 282f3f6

Browse files
committed
Minor cleanup
Signed-off-by: currantw <taylor.curran@improving.com>
1 parent e718b51 commit 282f3f6

File tree

3 files changed

+6
-30
lines changed

3 files changed

+6
-30
lines changed

docs/ppl-lang/functions/ppl-datetime.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ Example:
402402
**Description:**
403403

404404
**Usage:** earliest(string, timestamp) returns whether the timestamp defined by the given relative string is earlier
405-
than or at the same time as the specified timestamp.
405+
than or at the same time as the given timestamp. See [RELATIVE_TIMESTAMP](#relative_timestamp)
406+
for more details on relative timestamp strings.
406407

407408
Argument type: STRING, TIMESTAMP
408409

@@ -550,7 +551,8 @@ Example:
550551
**Description:**
551552

552553
**Usage:** latest(string, timestamp) returns whether the timestamp defined by the given relative string is later
553-
than or at the same time as the specified timestamp. See [relative_timestamp](#relative_timestamp) for more details.
554+
than or at the same time as the given timestamp. See [RELATIVE_TIMESTAMP](#relative_timestamp)
555+
for more details on relative timestamp strings.
554556

555557
Argument type: STRING, TIMESTAMP
556558

docs/ppl-lang/ppl-where-command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ PPL query:
6262
| where case(factor = 2, 'even', factor = 4, 'even', factor = 6, 'even', factor = 8, 'even' else 'odd') = 'even'
6363
| stats count() by factor`
6464
- `source = table | where timestamp >= relative_timestamp("-1d@w6")`
65-
- `source = table | where earliest("-1d@w0", timestamp) and latest("now")`
65+
- `source = table | where earliest("-1d@w0", timestamp) and latest("now", timestamp)`

integ-test/src/integration/scala/org/opensearch/flint/spark/ppl/FlintSparkPPLBuiltInDateTimeFunctionITSuite.scala

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ class FlintSparkPPLBuiltInDateTimeFunctionITSuite
386386
assertSameRows(Seq(Row(23)), frame)
387387

388388
frame = sql(s"""
389-
| source =$testTable
389+
| source=$testTable
390390
| | eval day = day_of_week(relative_timestamp("@w0"))
391391
| | fields day
392392
| | head 1
@@ -430,32 +430,6 @@ class FlintSparkPPLBuiltInDateTimeFunctionITSuite
430430
assertSameRows(Seq(Row(false, true, true)), frame)
431431
}
432432

433-
// TODO #957: Support earliest
434-
ignore("test EARLIEST") {
435-
var frame = sql(s"""
436-
| source = $testTable
437-
| | eval earliest_hour_before = earliest(now(), "-1h")
438-
| | eval earliest_now = earliest(now(), "now")
439-
| | eval earliest_hour_after = earliest(now(), "+1h")
440-
| | fields earliest_hour_before, earliest_now, earliest_hour_after
441-
| | head 1
442-
| """.stripMargin)
443-
assertSameRows(Seq(Row(true), Row(true), Row(false)), frame)
444-
}
445-
446-
// TODO #957: Support latest
447-
ignore("test LATEST") {
448-
var frame = sql(s"""
449-
| source = $testTable
450-
| | eval latest_hour_before = latest(now(), "-1h")
451-
| | eval latest_now = latest(now(), "now")
452-
| | eval latest_hour_after = latest(now(), "+1h")
453-
| | fields latest_hour_before, latest_now, latest_hour_after
454-
| | head 1
455-
| """.stripMargin)
456-
assertSameRows(Seq(Row(false), Row(true), Row(true)), frame)
457-
}
458-
459433
test("test CURRENT_TIME is not supported") {
460434
val ex = intercept[UnsupportedOperationException](sql(s"""
461435
| source = $testTable

0 commit comments

Comments
 (0)