pyrooka / metabase-cubejs-driver

Connect Metabase with Cube.js.
GNU Affero General Public License v3.0
4 stars 6 forks source link

Broken negating filters when used two or more for the same field #58

Closed pyrooka closed 4 years ago

pyrooka commented 4 years ago

Describe the bug When using is not filter for the same field with two or more values it will broke the native query generation.

To Reproduce Use two or more is not filter for the same field.

Expected behavior Exclude all the negated value from the result.

Screenshots image

Version: v0.10.0

Additional context

metabase_1  | 04-01 11:02:58 WARN middleware.process-userland-query :: Query failure {:status :failed,
metabase_1  |  :class java.lang.IllegalArgumentException,
metabase_1  |  :error "No matching clause: notEquals",
metabase_1  |  :stacktrace
metabase_1  |  ("--> driver.cubejs.query_processor$datetime_filter_optimizer$iter__646__650$fn__651$fn__652.invoke(query_processor.clj:224)"
metabase_1  |   "driver.cubejs.query_processor$datetime_filter_optimizer$iter__646__650$fn__651.invoke(query_processor.clj:213)"
metabase_1  |   "driver.cubejs.query_processor$datetime_filter_optimizer.invokeStatic(query_processor.clj:205)"
metabase_1  |   "driver.cubejs.query_processor$datetime_filter_optimizer.invoke(query_processor.clj:202)"
metabase_1  |   "driver.cubejs.query_processor$transform_filters.invokeStatic(query_processor.clj:251)"
metabase_1  |   "driver.cubejs.query_processor$transform_filters.invoke(query_processor.clj:245)"
metabase_1  |   "driver.cubejs.query_processor$mbql__GT_cubejs.invokeStatic(query_processor.clj:365)"
metabase_1  |   "driver.cubejs.query_processor$mbql__GT_cubejs.invoke(query_processor.clj:360)"
metabase_1  |   "driver.cubejs$fn__947.invokeStatic(cubejs.clj:103)"
metabase_1  |   "driver.cubejs$fn__947.invoke(cubejs.clj:100)"
metabase_1  |   "query_processor.middleware.mbql_to_native$query__GT_native_form$fn__37448.invoke(mbql_to_native.clj:17)"
metabase_1  |   "query_processor.middleware.mbql_to_native$query__GT_native_form.invokeStatic(mbql_to_native.clj:16)"
metabase_1  |   "query_processor.middleware.mbql_to_native$query__GT_native_form.invoke(mbql_to_native.clj:11)"
metabase_1  |   "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__37455.invoke(mbql_to_native.clj:36)"
metabase_1  |   "query_processor.middleware.annotate$result_rows_maps__GT_vectors$fn__40562.invoke(annotate.clj:541)"
metabase_1  |   "query_processor.middleware.annotate$add_column_info$fn__40468.invoke(annotate.clj:485)"
metabase_1  |   "query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__41503.invoke(cumulative_aggregations.clj:57)"
metabase_1  |   "query_processor.middleware.resolve_joins$resolve_joins$fn__43430.invoke(resolve_joins.clj:184)"
metabase_1  |   "query_processor.middleware.limit$limit$fn__42138.invoke(limit.clj:19)"
metabase_1  |   "query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__46195.invoke(results_metadata.clj:87)"
metabase_1  |   "query_processor.middleware.format_rows$format_rows$fn__42126.invoke(format_rows.clj:76)"
metabase_1  |   "query_processor.middleware.add_dimension_projections$add_remapping$fn__38215.invoke(add_dimension_projections.clj:234)"
metabase_1  |   "query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__38866.invoke(add_source_metadata.clj:107)"
metabase_1  |   "query_processor.middleware.resolve_source_table$resolve_source_tables$fn__43480.invoke(resolve_source_table.clj:46)"
metabase_1  |   "query_processor.middleware.add_row_count_and_status$add_row_count_and_status$fn__38703.invoke(add_row_count_and_status.clj:16)"
metabase_1  |   "query_processor.middleware.driver_specific$process_query_in_context$fn__41578.invoke(driver_specific.clj:12)"
metabase_1  |   "query_processor.middleware.resolve_driver$resolve_driver$fn__43094.invoke(resolve_driver.clj:22)"
metabase_1  |   "query_processor.middleware.store$initialize_store$fn__46220$fn__46221.invoke(store.clj:11)"
metabase_1  |   "query_processor.store$do_with_store.invokeStatic(store.clj:46)"
metabase_1  |   "query_processor.store$do_with_store.invoke(store.clj:40)"
metabase_1  |   "query_processor.middleware.store$initialize_store$fn__46220.invoke(store.clj:10)"
metabase_1  |   "query_processor.middleware.async$async__GT_sync$fn__37366.invoke(async.clj:23)"
metabase_1  |   "query_processor.middleware.async_wait$runnable$fn__40619.invoke(async_wait.clj:89)")