This project is mirrored from https://github.com/metabase/metabase.
Pull mirroring updated .
- Mar 02, 2021
-
-
Ariya Hidayat authored
-
Ariya Hidayat authored
-
Nemanja Glumac authored
-
Ariya Hidayat authored
These new functions are to support MBQL's is-null and is-empty.
-
Ariya Hidayat authored
-
Ariya Hidayat authored
Use the compact syntax tree in the type checker to easily constrain the type for each argument in a function/case expression. This will lead to a correct resolve for every dimension/metric/segment in that subtree associated with each argument.
-
Ariya Hidayat authored
* Custom expression: build a compact version of the syntax tree The Chevrotain-based parser produces a very verbose syntax tree (matching the grammar productions on every step of the way). For instance, a custom expression as simple as "1" results in the following tree: ``` (root) expression relationalExpression additionExpression multiplicationExpression atomicExpression numberLiteral ``` This makes it hard for type-checker to perform its analysis, due to the need to traverse deeply every one of its children (even if there is only one direct child). The compact syntax tree can be constructed from the above representation, which trims the unnecessary intermediate nodes: ``` (root) numberLiteral ```
-
Ariya Hidayat authored
Since it is used a placeholder for a dimension, a metric, or a segment (resolving to one of them is delegated to the compiler), it makes sense to use a more generic and less confusing name.
-
Ariya Hidayat authored
The core logic of MBQL compiler only has an abstract understanding of the environment access (fields like segments, dimensions, and metrics) as resolving those can be delegated accordingly. As a bonus, this makes it very easy to test and to refactor the compiler code.
-
Ariya Hidayat authored
-
Ariya Hidayat authored
-
Ariya Hidayat authored
-
Ariya Hidayat authored
The previous grammar revamp finally allowed some complex expression constructs.
-
Ariya Hidayat authored
* Revamp the grammar of custom expression Handle logical operations (AND, OR, NOT) by having them as part of the grammar productions/rules, instead of only as special cases of filters/aggregations. This finally allows any arithmetic operations inside a filter. In fact, this lets the correct mix-up between any logical and arithmetic operations (including function calls), also by leveraging the type checker to determine the correct type constraints for the terminals (Booleans, expressions, dimensions, metrics, segments, etc). * Be more explicit about skipped (known) regression
-
Ariya Hidayat authored
Use the type-checker to dynamically resolve dimensions as metrics, wherever it is constrained in the right sub-tree for an aggregation.
-
Ariya Hidayat authored
Use the type checker for dynamic resolving of an identifier, i.e. to infer whether it represents a dimension or a segment, based on the type constraints in the sub-expression. This also eliminates the flawed type-based resolving which happens during the parsing time.
-
Ariya Hidayat authored
* Add a barebone type checker for the expression parser * Add more context and other review feedback
-
Ariya Hidayat authored
* Custom expression parser: formalize the tree visitor Also included, a pretty-printer to debug the syntax tree. * Simplify the tree's pretty printer
-
Jeff Evans authored
Switch query execution to use `Statement` instead of `PreparedStatement` when there are no params Add new multimethod to create a `Statement`, rather than `PreparedStatement`, which works similarly, called `statement` Add new multimethod to run a SQL query against a Statement, similar to `execute-query!`, called `execute-statement!` For consistency, rename `execute-query!` to `execute-prepared-statement!` Change `execute-reducible-query` to capture whether the query has params, and if not, using the new multimethods instead Update fetch-results-metadata-test so it replaces execute-select! instead of prepared-statement Adding `statement-supported?` multimethod (defaults to true), to let drivers control whether statements are used at all Updating Oracle driver to not override holdability for `statement`, similar to `prepared-statement`, and bumping module version Updating SparkSQL driver to indicate that statements are not supported, and bumping module version Fixing Redshift test to also override `execute-statement!` so it can capture the SQL for a statement
-
- Mar 01, 2021
-
-
Dalton authored
-
Nemanja Glumac authored
-
Robert Roland authored
* Adding the ability to sync admin groups in EE Adds a LDAP setting for EE to enable to LDAP Administrator group syncs. Adds the setting to admin UI to enable syncing of the admin group. Removes two unused settings from the OSS side. metabase/metabase-enterprise#445 * Apply suggestions from code review Co-authored-by:
Dalton <daltojohnso@users.noreply.github.com> Co-authored-by:
Dalton <daltojohnso@users.noreply.github.com>
-
Jeff Evans authored
Modifying ddl.clj to account for a difference in behavior for honeysql.helpers/columns introduced in honeysql 0.9.7 (see long comment)
-
Tim Macdonald authored
* Combine search scores into one weighted number * Use richer representation of scores Should make the FE debugging bits more robust
-
Nemanja Glumac authored
* Upgrade React to v16 * Upgrade react-hot-loader * Use portal in BodyComponent (#14779) * Use portal in Popover (#14799) * Use portal in Popover * Use SandboxedPortal to stop portal child/parent event propagation React portals bubble events from component childrent to component parents _through_ the portal as though they are attached. This breaks our Triggerable HOC that wraps everything in an anchor tag -- click events inside of an open Popover trigger the "toggle" function in Triggerable, closing the Popover component. Adding an additional div to the code potentially breaks styling, but this seemed better than the alternative of changing/limiting Triggerable. * Fix adding of open class * don't trigger some logic when popover is not open * change wrapper span to a div * rmv explicit bind from handleDismissal fn * add comment explaining reasoning for SandboxedPortal * add comment to explain need for 'maxHeight' state value * Use ReactDOMServer to render html in a contenteditable div (#14869) As part of the react v16 we can no longer rely on a synchronous ReactDOM.render call. Using the third arg callback of ReactDOM.render does not work for reasons unknown to me, but it would likely be race-condition-y anyways due to this being an input field. I'm using ReactDOMServer in order to avoid rewriting the react TokenizedExpression component as html and to avoid associated xss vulnerabilities, etc. * Rename unsafe lifecycles (#14887) * Rename unsafe lifecycles * Fix flow error: Remove unused suppressions * use SandboxedPortal in Modal (#14905) * use SandboxedPortal in Modal * Move modal append container to constructor This breaks the entry animation but it fixes problems with having a popover _inside_ of the modal. Previously, popover was appending its container el before the modal, causing a stacking issue. * remove unstable_renderSubtreeIntoContainer from Tooltip (#14976) Co-authored-by:
Dalton <daltojohnso@users.noreply.github.com>
-
Tim Macdonald authored
-
Cam Saul authored
-
Kyle Doherty authored
* fix default SearcbResult item layout and icon shrinking * tweak text
-
- Feb 26, 2021
-
-
Jeff Evans authored
-
Luis Paolini authored
* Add an error from SQLite * Update docs/troubleshooting-guide/running.md Co-authored-by:
Jeff Bruemmer <jeff@metabase.com> * Added identification of users and processes and explained myself a bit more on the running metabase troubleshooting guide * Update docs/troubleshooting-guide/docker.md Co-authored-by:
Jeff Bruemmer <jeff@metabase.com> * Update docs/troubleshooting-guide/running.md Co-authored-by:
Jeff Bruemmer <jeff@metabase.com> * Update docs/troubleshooting-guide/docker.md Co-authored-by:
Jeff Bruemmer <jeff@metabase.com> Co-authored-by:
Jeff Bruemmer <jeff@metabase.com>
-
Luis Paolini authored
* Update 05-setting-permissions.md Adding a few words about raw query permissions * Update docs/administration-guide/05-setting-permissions.md Co-authored-by:
Jeff Bruemmer <jeff@metabase.com> Co-authored-by:
Jeff Bruemmer <jeff@metabase.com>
-
- Feb 25, 2021
-
-
Cam Saul authored
1. Rename optimize-datetime-filters middleware -> optimize-temporal-filters (it's more accurate, because this also optimizes date or time filter clauses) 2. optimize-temporal-filters middleware now optimizes relative-datetime clauses (which represent a moment in time relative to when the query is ran, e.g. "last month") in addition to absolute-datetime clauses (which represent an absolute moment in time, e.g. 2021-02-15T14:40:00-08:00) . This middleware rewrites queries so we filter against specific temporal ranges without casting the column itself, meaning we can leverage indexes on that column. See #11837 for more details 3. Added new validate-temporal-bucketing middleware that throws an Exception if you try to do something that makes no sense, e.g. bucket a DATE field by :time or a TIME field by :month. This is a better situation then running the query and waiting for the DB to complain. (In practice, I don't think the FE client would let you generate a query like this in the first place) 4. Fix random test failures for MySQL in task-history-cleanup-test
-
Jeff Evans authored
* Implement ssh tunnel reconnection From the connection-with-timezone method of execute, check whether an ssh tunnel that should be open actually is not, and if so, mark the entire pool as invalid (thereby forcing the connection code to rebuild the source and open a new tunnel) Fixing the create-pool! function so that the relevant ssh tunnel entries are kept (in addition to the :datasource) Adding test in ssh-test namespace, which will test that the tunnel is reestablished (for now, running with Postgres driver) * Responding to PR feedback from Dan * Fixing test by adding AcceptAllForwardingFilter forwardingFilter to the mock password server instance * Change with-driver to test-driver * Add ssh tunnel reconnect test that can run against H2 * Implement ssh tunnel reconnection From the connection-with-timezone method of execute, check whether an ssh tunnel that should be open actually is not, and if so, mark the entire pool as invalid (thereby forcing the connection code to rebuild the source and open a new tunnel) Fixing the create-pool! function so that the relevant ssh tunnel entries are kept (in addition to the :datasource) Adding test in ssh-test namespace, which will test that the tunnel is reestablished (for now, running with Postgres driver) * Responding to PR feedback from Dan * Fixing test by adding AcceptAllForwardingFilter forwardingFilter to the mock password server instance * Rebase again to fix merge conflict * Change test-driver to with-driver in hopes of making CodeCov finally happy * Adding new multimethod to ssh namespace, called incorporate-ssh-tunnel-details, for accounting for the Implementing incorporate-ssh-tunnel-details for h2 so update the URI string (:db key) to point to the tunnel entry point Pulled logic for :sql-jdbc implementation of connection-with-timezone out to a new fn, so it can be called elsewhere Updating H2 reconnection test imn light of the changes above Added "!" suffix to name of include-ssh-tunnel to reflect the fact that it does modify global state * Fixing NPE in incorporate-ssh-tunnel-details implementation for :h2 Moving multimethod declaration for incorporate-ssh-tunnel-details to driver namespace * Fix :h2 implementation again * Remove another errant extra line :( * Rebase onto master * Inline the private helper fn back into connection-with-timezone * Remove dead code
-
Cam Saul authored
Background The original version of MBQL (known as the "Structured Query" language at the time, which was a little confusing) just referred to all fields by integer ID. e.g. {:filter ["STARTS_WITH" 1 "abc"]} That made clauses like this ambiguous: {:filter ["=" 1 2]} ; is 2 a Field, or the number 2? To clear up ambiguity and to let you filter Fields against Fields, we added the :field-id clause to make it explicit that you were referring to a Field, not an Integer: {:filter [:= [:field-id 1] [:field-id 2]]} ; Field 1 == Field 2 We soon added a couple of new types of Field clauses, :fk-> and :datetime-field, both of which wrap the original :field-id: ;; refer to Field 2 from a different Table, use Field 1 from the current Table to perform the join [:fk-> [:field-id 1] [:field-id 2]] ;; bucket Field 3 by month [:datetime-field [:field 3] :month] So far things were still pretty reasonable, the worst you'd have to do is something like [:datetime-field [:fk-> [:field-id 1] [:field-id 2]] :month] Things started to get out-of-hand IMO when we continued to add more Field clause types that just wrapped everything else. We added :binning-strategy: [:binning-strategy <field> :num-buckets 10] then :field-literal, to refer to a Field from a nested native source query: [:field-literal "my_field" :type/Text] then we added :joined-field to specify the Table you're explicitly joining against that is the source of a Field: [:joined-field "my_join" [:field-id 4]] This ends up getting really hairy when you combine things. This is an actual real clause you can use right now: [:binning-strategy [:datetime-field [:joined-field "my_join" [:field-literal "my_field" :type/DateTimeWithLocalTZ]] :month] :num-bins 10] And even with all of those clauses, we still can't pass around arbitrary extra information in a way that would make it easy to implement performance optimizations. If we ever try to add another new clause, the whole house of cards is going to come crashing down. The proposal Combine all of the Field clauses into a single new :field clauses with the schema [:field id-or-name options-map] Here are some before & after examples: [:field-id 1] => [:field 1 nil] [:field-literal "my_field" :type/Text] => [:field "my_field" {:base-type :type/Text}] [:datetime-field [:field 1] :month] => [:field 1 {:temporal-unit :month}] [:binning-strategy [:field 1] :num-bins 10] => [:field 1 {:binning {:strategy :num-bins, :num-bins 10}}] [:joined-field "my_join" [:field 1]] => [:field 1 {:join-alias "my_join}] [:fk-> [:field 1] [:field 2]] => [:field 2 {:source-field 1}] [:binning-strategy [:datetime-field [:joined-field "my_join" [:field-literal "my_field" :type/DateTimeWithLocalTZ]] :month] :num-bins 10] => [:field "my_field" {:base-type :type/DateTimeWithLocalTZ, :join-alias "my_join", :binning {:strategy :num-bins, :num-bins 10}}]
-
Tim Macdonald authored
* Use dashboard count in search scoring [Fixes #14945] * Fix sorting priority bug (thanks, Dan!) * Show (hidden) scores in search results for debugging purposes * Bump memory limit for SQL Server on CI c.f. https://metaboat.slack.com/archives/C5XHN8GLW/p1614272426000400
-
Kyle Doherty authored
* basic no results styling * tweaks
-
Tim Macdonald authored
Per Kyle's suggestion
-
Ariya Hidayat authored
-
- Feb 24, 2021
-
-
Dalton authored
-
Tim Macdonald authored
* Refactor various bits of search * Prioritize pinned items in search results [Fixes #14936]
-