summaryrefslogtreecommitdiffstats
path: root/sqlglot/executor
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-01-23 05:06:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-01-23 05:06:14 +0000
commit38e6461a8afbd7cb83709ddb998f03d40ba87755 (patch)
tree64b68a893a3b946111b9cab69503f83ca233c335 /sqlglot/executor
parentReleasing debian version 20.4.0-1. (diff)
downloadsqlglot-38e6461a8afbd7cb83709ddb998f03d40ba87755.tar.xz
sqlglot-38e6461a8afbd7cb83709ddb998f03d40ba87755.zip
Merging upstream version 20.9.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/executor')
-rw-r--r--sqlglot/executor/env.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sqlglot/executor/env.py b/sqlglot/executor/env.py
index b79a551..6c01edc 100644
--- a/sqlglot/executor/env.py
+++ b/sqlglot/executor/env.py
@@ -132,11 +132,10 @@ def ordered(this, desc, nulls_first):
@null_if_any
def interval(this, unit):
- unit = unit.lower()
- plural = unit + "s"
+ plural = unit + "S"
if plural in Generator.TIME_PART_SINGULARS:
unit = plural
- return datetime.timedelta(**{unit: float(this)})
+ return datetime.timedelta(**{unit.lower(): float(this)})
@null_if_any("this", "expression")
@@ -176,6 +175,7 @@ ENV = {
"DOT": null_if_any(lambda e, this: e[this]),
"EQ": null_if_any(lambda this, e: this == e),
"EXTRACT": null_if_any(lambda this, e: getattr(e, this)),
+ "GETPATH": null_if_any(lambda this, e: this.get(e)),
"GT": null_if_any(lambda this, e: this > e),
"GTE": null_if_any(lambda this, e: this >= e),
"IF": lambda predicate, true, false: true if predicate else false,