Skip to content
Snippets Groups Projects
Commit 2a53cf7b authored by Cam Saül's avatar Cam Saül Committed by GitHub
Browse files

Merge pull request #4941 from metabase/fix-bucketing-by-minutes-on-postgres

Fix filtering by minutes on Postgres [ci drivers]
parents adbbe9eb c52de1c5
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,10 @@
:main ^:skip-aot metabase.core
:manifest {"Liquibase-Package" "liquibase.change,liquibase.changelog,liquibase.database,liquibase.parser,liquibase.precondition,liquibase.datatype,liquibase.serializer,liquibase.sqlgenerator,liquibase.executor,liquibase.snapshot,liquibase.logging,liquibase.diff,liquibase.structure,liquibase.structurecompare,liquibase.lockservice,liquibase.sdk,liquibase.ext"}
:target-path "target/%s"
:jvm-opts ["-server" ; Run JVM in server mode as opposed to client -- see http://stackoverflow.com/questions/198577/real-differences-between-java-server-and-java-client for a good explanation of this
:jvm-opts ["-XX:MaxPermSize=256m" ; give the JVM a little more PermGen space to avoid PermGen OutOfMemoryErrors
"-Xverify:none" ; disable bytecode verification when running in dev so it starts slightly faster
"-XX:+CMSClassUnloadingEnabled" ; let Clojure's dynamically generated temporary classes be GC'ed from PermGen
"-XX:+UseConcMarkSweepGC" ; Concurrent Mark Sweep GC needs to be used for Class Unloading (above)
"-Djava.awt.headless=true"] ; prevent Java icon from randomly popping up in dock when running `lein ring server`
:javac-options ["-target" "1.7", "-source" "1.7"]
:uberjar-name "metabase.jar"
......@@ -122,10 +125,7 @@
:env {:mb-run-mode "dev"}
:jvm-opts ["-Dlogfile.path=target/log"
"-Xms1024m" ; give JVM a decent heap size to start with
"-Xmx2048m" ; hard limit of 2GB so we stop hitting the 4GB container limit on CircleCI
"-Xverify:none" ; disable bytecode verification when running in dev so it starts slightly faster
"-XX:+CMSClassUnloadingEnabled" ; let Clojure's dynamically generated temporary classes be GC'ed from PermGen
"-XX:+UseConcMarkSweepGC"] ; Concurrent Mark Sweep GC needs to be used for Class Unloading (above)
"-Xmx2048m"] ; hard limit of 2GB so we stop hitting the 4GB container limit on CircleCI
:aot [metabase.logger]} ; Log appender class needs to be compiled for log4j to use it
:reflection-warnings {:global-vars {*warn-on-reflection* true}} ; run `lein check-reflection-warnings` to check for reflection warnings
:expectations {:injections [(require 'metabase.test-setup)]
......
......@@ -114,8 +114,8 @@
:seconds (hsql/call :to_timestamp expr)
:milliseconds (recur (hx// expr 1000) :seconds)))
(defn- date-trunc [unit expr] (hsql/call :date_trunc (hx/literal unit) expr))
(defn- extract [unit expr] (hsql/call :extract unit expr))
(defn- date-trunc [unit expr] (hsql/call :date_trunc (hx/literal unit) (hx/cast :timestamp expr)))
(defn- extract [unit expr] (hsql/call :extract unit (hx/cast :timestamp expr)))
(def ^:private extract-integer (comp hx/->integer extract))
......
......@@ -343,3 +343,11 @@
(ql/aggregation (ql/count))
(ql/filter (ql/and (ql/not (ql/> $id 32))
(ql/contains $name "BBQ")))))))
;; make sure that filtering with dates truncating to minutes works (#4632)
(expect-with-non-timeseries-dbs [107] (first-row
(format-rows-by [int]
(data/run-query checkins
(ql/aggregation (ql/count))
(ql/filter (ql/between (ql/datetime-field $date :minute) "2015-01-01T12:30:00" "2015-05-31"))))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment