Skip to content
Snippets Groups Projects
Unverified Commit 5933f3b7 authored by metamben's avatar metamben Committed by GitHub
Browse files

Add date and time extract sugar functions to MLv2 (#30467)

Fixes #29909.
parent 99c36465
Branches
Tags
No related merge requests found
......@@ -35,6 +35,12 @@
#_:datetime2 [:schema [:ref ::expression/temporal]]
#_:unit [:ref ::temporal-bucketing/unit.date-time.truncate])
(doseq [temporal-extract-op #{:get-second :get-minute :get-hour
:get-day :get-day-of-week
:get-month :get-quarter :get-year}]
(mbql-clause/define-tuple-mbql-clause temporal-extract-op :- :type/Integer
#_:datetime [:schema [:ref ::expression/temporal]]))
(mbql-clause/define-tuple-mbql-clause :get-week :- :type/Integer
#_:datetime [:schema [:ref ::expression/temporal]]
;; TODO should this be in the options map?
......
......@@ -41,10 +41,6 @@
(mbql.u/match-one joins
{:fields (join-fields :guard (partial not= :none))}
"#29904"))
;; #29909: these clauses are not implemented yet.
(mbql.u/match-one legacy-query
#{:get-year :get-quarter :get-month :get-day :get-day-of-week :get-hour :get-minute :get-second}
"#29909")
;; #29938: conversion for `:case` with default value does not work correctly
(mbql.u/match-one legacy-query
:case
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment