Pivot tables not working in v0.38.0-rc1 and v0.38.0-preview

Hi,

I tried the new pivot tables visualization in both 0.38.0 versions but they don’t work. Spinning, spinning and then “We’re experiencing server issues.”

Is there a bug? Has anyone gotten this feature to work? I’ve been waiting for this feature for a long time…

The Docker container log last few lines are:

“query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__46110.invoke(fetch_source_query.clj:267)”,
“query_processor.middleware.store$initialize_store$fn__47831$fn__47832.invoke(store.clj:11)”,
“query_processor.store$do_with_store.invokeStatic(store.clj:46)”,
“query_processor.store$do_with_store.invoke(store.clj:40)”,
“query_processor.middleware.store$initialize_store$fn__47831.invoke(store.clj:10)”,
“query_processor.middleware.cache$maybe_return_cached_results$fn__45150.invoke(cache.clj:214)”,
“query_processor.middleware.validate$validate_query$fn__47840.invoke(validate.clj:10)”,
“query_processor.middleware.normalize_query$normalize$fn__46234.invoke(normalize_query.clj:22)”,
“query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__43914.invoke(add_rows_truncated.clj:36)”,
“query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__47807.invoke(results_metadata.clj:147)”,
“query_processor.middleware.constraints$add_default_userland_constraints$fn__45513.invoke(constraints.clj:42)”,
“query_processor.middleware.process_userland_query$process_userland_query$fn__46975.invoke(process_userland_query.clj:136)”,
“query_processor.middleware.catch_exceptions$catch_exceptions$fn__45456.invoke(catch_exceptions.clj:174)”,
“query_processor.reducible$async_qp$qp_STAR___36611$thunk__36612.invoke(reducible.clj:103)”,
“query_processor.reducible$async_qp$qp_STAR___36611.invoke(reducible.clj:109)”,
“query_processor.reducible$sync_qp$qp_STAR___36620$fn__36623.invoke(reducible.clj:135)”,
“query_processor.reducible$sync_qp$qp_STAR___36620.invoke(reducible.clj:134)”,
“query_processor$process_userland_query.invokeStatic(query_processor.clj:238)”,
“query_processor$process_userland_query.doInvoke(query_processor.clj:234)”,
“query_processor$fn__47886$process_query_and_save_execution_BANG___47895$fn__47898.invoke(query_processor.clj:250)”,
“query_processor$fn__47886$process_query_and_save_execution_BANG___47895.invoke(query_processor.clj:242)”,
“query_processor$fn__47930$process_query_and_save_with_max_results_constraints_BANG___47939$fn__47942.invoke(query_processor.clj:262)”,
“query_processor$fn__47930$process_query_and_save_with_max_results_constraints_BANG___47939.invoke(query_processor.clj:255)”,
“api.dataset$fn__49120$fn__49123.invoke(dataset.clj:59)”,
“query_processor.streaming$streaming_response_STAR_$fn__49101$fn__49102.invoke(streaming.clj:73)”,
“query_processor.streaming$streaming_response_STAR_$fn__49101.invoke(streaming.clj:72)”,
“async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:66)”,
“async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:64)”,
“async.streaming_response$do_f_async$fn__24641.invoke(streaming_response.clj:85)”],
:context :ad-hoc,
:error “Broken pipe”,
:row_count 0,
:running_time 0,
:preprocessed,
{:database 4,
:query,
{:source-table 20,
:aggregation [[:aggregation-options [:sum [:field-id 542]] {:name “sum”}]],
:breakout [[:field-id 536] [:field-id 550] [:field-id 552]],
:order-by [[:asc [:field-id 536]] [:asc [:field-id 550]] [:asc [:field-id 552]]]},
:type :query,
:middleware {:js-int-to-string? true, :add-default-userland-constraints? true},
:info,
{:executed-by 1,
:context :ad-hoc,
:nested? false,
:query-hash [-55, 19, -72, 81, -46, -121, 105, 57, -77, 58, 103, -18, -89, 116, -116, -58, 77, -106, 28, 24, -37, -111, -64, -47, -93, -91, 74, -117, -40, -117, -12, -127]},
:constraints {:max-results 10000, :max-results-bare-rows 2000}},
:data {:rows [], :cols []}},
,
2020-12-18 15:17:51,724 DEBUG middleware.log :: POST /api/dataset 202 [ASYNC: canceled] 5.1 s (11 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:00,787 DEBUG middleware.log :: GET /api/session/properties 200 33.8 ms (2 DB calls) App DB connections: 2/7 Jetty threads: 7/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:00,819 DEBUG middleware.log :: GET /api/user/current 200 58.4 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 7/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:00,877 DEBUG middleware.log :: GET /api/database 200 16.8 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:00,931 DEBUG middleware.log :: GET /api/collection/root/items 200 40.0 ms (6 DB calls) App DB connections: 1/7 Jetty threads: 6/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:01,035 DEBUG middleware.log :: GET /api/collection/root 200 19.2 ms (2 DB calls) App DB connections: 1/7 Jetty threads: 5/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:05,398 DEBUG middleware.log :: GET /api/collection/tree 200 22.4 ms (3 DB calls) App DB connections: 1/7 Jetty threads: 7/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:05,431 DEBUG middleware.log :: GET /api/collection/65/items 200 61.1 ms (8 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:05,518 DEBUG middleware.log :: GET /api/collection/65 200 15.2 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:11,349 DEBUG middleware.log :: GET /api/search 200 97.4 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:25,439 DEBUG middleware.log :: GET /api/collection 200 12.5 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:45,860 INFO api.card :: Card results metadata passed in to API is MISSING. Running query to fetch correct metadata.,
2020-12-18 15:18:47,198 DEBUG middleware.log :: POST /api/card 202 [ASYNC: completed] 1.5 s (35 DB calls) App DB connections: 3/7 Jetty threads: 4/50 (3 idle, 0 queued) (57 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:18:52,177 DEBUG middleware.log :: POST /api/dataset 202 [ASYNC: completed] 991.3 ms (11 DB calls) App DB connections: 1/7 Jetty threads: 4/50 (3 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:19:07,441 DEBUG middleware.log :: POST /api/advanced_computation/pivot/dataset 202 [ASYNC: completed] 145.0 ms (13 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (4 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:26:11,934 DEBUG middleware.log :: GET /api/user/current 200 13.9 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 7/50 (0 idle, 0 queued) (55 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:26:11,957 DEBUG middleware.log :: GET /api/session/properties 200 18.8 ms (2 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (0 idle, 0 queued) (56 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:26:12,059 DEBUG middleware.log :: GET /api/database 200 61.9 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 7/50 (2 idle, 0 queued) (59 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:26:12,552 DEBUG middleware.log :: GET /api/table/20/query_metadata 200 476.2 ms (9 DB calls) App DB connections: 1/7 Jetty threads: 7/50 (0 idle, 0 queued) (60 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:26:12,582 DEBUG middleware.log :: GET /api/database 200 495.7 ms (12 DB calls) App DB connections: 0/7 Jetty threads: 7/50 (0 idle, 0 queued) (60 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:26:12,602 DEBUG middleware.log :: GET /api/database 200 547.0 ms (4 DB calls) App DB connections: 0/7 Jetty threads: 7/50 (0 idle, 0 queued) (61 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:26:12,995 DEBUG middleware.log :: POST /api/advanced_computation/pivot/dataset 202 [ASYNC: completed] 167.6 ms (12 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (2 idle, 0 queued) (64 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:09,677 DEBUG middleware.log :: GET /api/session/properties 200 19.6 ms (2 DB calls) App DB connections: 1/7 Jetty threads: 7/50 (0 idle, 0 queued) (56 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:09,730 DEBUG middleware.log :: GET /api/user/current 200 81.1 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (0 idle, 0 queued) (58 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:09,829 DEBUG middleware.log :: GET /api/database 200 51.5 ms (3 DB calls) App DB connections: 2/7 Jetty threads: 8/50 (1 idle, 0 queued) (60 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:09,927 DEBUG middleware.log :: GET /api/card/801 200 87.2 ms (6 DB calls) App DB connections: 1/7 Jetty threads: 7/50 (0 idle, 0 queued) (62 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:09,964 DEBUG middleware.log :: GET /api/database 200 172.5 ms (4 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (0 idle, 0 queued) (62 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:09,966 DEBUG middleware.log :: GET /api/database 200 165.4 ms (13 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (0 idle, 0 queued) (62 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:10,029 DEBUG middleware.log :: GET /api/alert/question/801 200 14.9 ms (1 DB calls) App DB connections: 1/7 Jetty threads: 7/50 (1 idle, 0 queued) (62 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:10,153 DEBUG middleware.log :: GET /api/table/20/query_metadata 200 120.5 ms (8 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (1 idle, 0 queued) (62 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:10,257 DEBUG middleware.log :: GET /api/collection/65 200 15.3 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (2 idle, 0 queued) (62 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:10,410 INFO api.card :: Question’s average execution duration is 1.7 s; using ‘magic’ TTL of 2.8 mins :floppy_disk:,
2020-12-18 15:38:12,063 INFO middleware.cache :: Query took 1.6 s to run; minimum for cache eligibility is 30.0 s,
2020-12-18 15:38:12,206 DEBUG middleware.log :: POST /api/card/801/query 202 [ASYNC: completed] 1.8 s (13 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (2 idle, 0 queued) (66 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:38:14,950 DEBUG middleware.log :: POST /api/advanced_computation/pivot/dataset 202 [ASYNC: completed] 203.4 ms (13 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (2 idle, 0 queued) (67 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:10,183 DEBUG middleware.log :: GET /api/user/current 200 11.0 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (2 idle, 0 queued) (60 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:10,185 DEBUG middleware.log :: GET /api/session/properties 200 14.4 ms (2 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (2 idle, 0 queued) (61 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:10,264 DEBUG middleware.log :: GET /api/database 200 21.1 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 7/50 (0 idle, 0 queued) (62 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:10,405 DEBUG middleware.log :: GET /api/card/801 200 101.2 ms (6 DB calls) App DB connections: 1/7 Jetty threads: 9/50 (0 idle, 0 queued) (65 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:10,439 DEBUG middleware.log :: GET /api/database 200 175.0 ms (4 DB calls) App DB connections: 1/7 Jetty threads: 7/50 (1 idle, 0 queued) (66 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:10,454 DEBUG middleware.log :: GET /api/database 200 155.3 ms (13 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (1 idle, 0 queued) (66 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:10,580 DEBUG middleware.log :: GET /api/table/20/query_metadata 200 90.8 ms (8 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (2 idle, 0 queued) (66 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:10,943 DEBUG middleware.log :: POST /api/advanced_computation/pivot/dataset 202 [ASYNC: completed] 174.9 ms (12 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (3 idle, 0 queued) (67 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:28,035 DEBUG middleware.log :: GET /api/card/801 200 64.2 ms (6 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (3 idle, 0 queued) (67 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:28,085 DEBUG middleware.log :: GET /api/alert/question/801 200 4.0 ms (1 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (3 idle, 0 queued) (67 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:28,113 DEBUG middleware.log :: GET /api/collection/65 200 9.3 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (3 idle, 0 queued) (67 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:40:28,229 INFO api.card :: Question’s average execution duration is 1.7 s; using ‘magic’ TTL of 2.8 mins :floppy_disk:,
2020-12-18 15:40:29,756 INFO middleware.cache :: Query took 1.5 s to run; minimum for cache eligibility is 30.0 s,
2020-12-18 15:40:29,809 DEBUG middleware.log :: POST /api/card/801/query 202 [ASYNC: completed] 1.6 s (13 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (3 idle, 0 queued) (72 total active threads) Queries in flight: 0 (0 queued),
2020-12-18 15:41:53,507 DEBUG middleware.log :: POST /api/advanced_computation/pivot/dataset 202 [ASYNC: completed] 182.7 ms (13 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (5 idle, 0 queued) (66 total active threads) Queries in flight: 0 (0 queued),

Hi @crunchtoinfo
It looks like the query request was cancelled after 5 seconds (5.1 s).
Please post “Diagnostic Info” from Admin > Troubleshooting, and which database you are querying.
And the entire stacktrace, when the pivot fails.

Hi @flamber

Here is the Diagnostic info:
{
“browser-info”: {
“language”: “en-GB”,
“platform”: “Win32”,
“userAgent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36”,
“vendor”: “Google Inc.”
},
“system-info”: {
“file.encoding”: “UTF-8”,
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.7+10”,
“java.vendor”: “AdoptOpenJDK”,
“java.vendor.url”: “https://adoptopenjdk.net/”,
“java.version”: “11.0.7”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.7+10”,
“os.name”: “Linux”,
“os.version”: “5.4.0-56-generic”,
“user.language”: “en”,
“user.timezone”: “GMT”
},
“metabase-info”: {
“databases”: [
“googleanalytics”,
“mysql”,
“druid”,
“postgres”,
“h2”
],
“hosting-env”: “unknown”,
“application-database”: “postgres”,
“application-database-details”: {
“database”: {
“name”: “PostgreSQL”,
“version”: “12.3 (Debian 12.3-1.pgdg100+1)”
},
“jdbc-driver”: {
“name”: “PostgreSQL JDBC Driver”,
“version”: “42.2.8”
}
},
“run-mode”: “prod”,
“version”: {
“date”: “2020-12-17”,
“tag”: “v0.38.0-rc1”,
“branch”: “master”,
“hash”: “e8b0bcc”
},
“settings”: {
“report-timezone”: “Europe/Athens”
}
}
}

I am not sure how to get the stacktrace - please point to instructions. Here is the logs info. First I show the question with simple table visualization and I get these log lines:
[56ea5b7c-6eba-4b93-9bd3-105e089ef66d] 2020-12-19T22:30:06+02:00 INFO metabase.api.card Question’s average execution duration is 2.3 s; using ‘magic’ TTL of 3.9 mins :floppy_disk:
[56ea5b7c-6eba-4b93-9bd3-105e089ef66d] 2020-12-19T22:30:07+02:00 INFO metabase.query-processor.middleware.cache Query took 1.2 s to run; minimum for cache eligibility is 30.0 s
[56ea5b7c-6eba-4b93-9bd3-105e089ef66d] 2020-12-19T22:30:07+02:00 DEBUG metabase.middleware.log POST /api/card/801/query 202 [ASYNC: completed] 1.3 s (13 DB calls) App DB connections: 1/13 Jetty threads: 4/50 (2 idle, 0 queued) (71 total active threads) Queries in flight: 0 (0 queued)
[56ea5b7c-6eba-4b93-9bd3-105e089ef66d] 2020-12-19T22:30:27+02:00 DEBUG metabase.middleware.log POST /api/advanced_computation/pivot/dataset 202 [ASYNC: completed] 148.6 ms (13 DB calls) App DB connections: 0/13 Jetty threads: 4/50 (2 idle, 0 queued) (72 total active threads) Queries in flight: 0 (0 queued)

Then I switch to pivot table visuallization and it keeps spinning “DOING SCIENCE” and these log lines appear. Nothing else happens:

[56ea5b7c-6eba-4b93-9bd3-105e089ef66d] 2020-12-19T22:30:06+02:00 INFO metabase.api.card Question’s average execution duration is 2.3 s; using ‘magic’ TTL of 3.9 mins :floppy_disk:
[56ea5b7c-6eba-4b93-9bd3-105e089ef66d] 2020-12-19T22:30:07+02:00 INFO metabase.query-processor.middleware.cache Query took 1.2 s to run; minimum for cache eligibility is 30.0 s
[56ea5b7c-6eba-4b93-9bd3-105e089ef66d] 2020-12-19T22:30:07+02:00 DEBUG metabase.middleware.log POST /api/card/801/query 202 [ASYNC: completed] 1.3 s (13 DB calls) App DB connections: 1/13 Jetty threads: 4/50 (2 idle, 0 queued) (71 total active threads) Queries in flight: 0 (0 queued)
[56ea5b7c-6eba-4b93-9bd3-105e089ef66d] 2020-12-19T22:30:27+02:00 DEBUG metabase.middleware.log POST /api/advanced_computation/pivot/dataset 202 [ASYNC: completed] 148.6 ms (13 DB calls) App DB connections: 0/13 Jetty threads: 4/50 (2 idle, 0 queued) (72 total active threads) Queries in flight: 0 (0 queued)

Please let me know if there is anything else I could do. Please tell me how to get the stack trace. The instance is running in Docker.

BR, crunchtoinfo

BTW, I went through the troubleshooting guide (https://www.metabase.com/docs/latest/troubleshooting-guide/bugs.html) and then I found that pivot tables work in my instance with the sample data. It took a little bit more than expected - about 20 seconds.

The question on my data is slightly more complex and I am going to let it run all night to see if something comes out of it.

-crunchtoinfo

@crunchtoinfo There isn’t any stacktrace errors in your last logs, so I guess that was a different problem or you browsed away from an ongoing query, which will cause an error like that.

Check your database for slow logs or enable debugging to help figuring out if the problem is missing indexes in your database.

How do you get pivot to take 20 seconds with Sample Dataset? Please post steps to reproduce.

Hi @flamber, I have advanced a little.

First of all pivot tables work OK on my mysql tables but on postgres - not. I have a table with list of invoices and I am counting rows by year and putting in pivot visualization.

The backend reports success:

[82ca2a3e-ecc9-42a6-b69f-9ee185485dd0] 2020-12-20T21:18:04+02:00 DEBUG metabase.middleware.log POST /api/advanced_computation/pivot/dataset 202 [ASYNC: completed] 54.7 ms (13 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (1 idle, 0 queued) (119 total active threads) Queries in flight: 0 (0 queued)

However I get this error in the Javascript console. Maybe this is causing the spinning wheel?

app-main.bundle.js?03ba840f424b45724296:5 Uncaught (in promise) TypeError: Cannot read property ‘cols’ of undefined
at app-main.bundle.js?03ba840f424b45724296:5
at Array.map ()
at Q (app-main.bundle.js?03ba840f424b45724296:5)
at Object.getProps (app-main.bundle.js?03ba840f424b45724296:5)
at app-main.bundle.js?03ba840f424b45724296:5
at app-main.bundle.js?03ba840f424b45724296:5
at Array.map ()
at t.getSettingsWidgets (app-main.bundle.js?03ba840f424b45724296:5)
at t.getSettingsWidgetsForSeries (app-main.bundle.js?03ba840f424b45724296:5)
at t.value (app-main.bundle.js?03ba840f424b45724296:5)

BR,
crunchtoinfo

@crunchtoinfo Interesting. I’m sure the JS error is the reason it doesn’t finishes, but I’m unsure of the cause behind that. I have a feeling that it’s related to your dataset or the column types.
Can you post the request and response data from POST /api/advanced_computation/pivot/dataset ? You can find that data in the browser developer Network-tab.

Hi @flamber,

Mysql table work but postres does not. So I made the mysql and postgres data model the same in Metabase admin panel. Day, month and year are category and ttl is a number. I was hoping this would fix things, but no. Here is the question screen grab:

The POST response is:
Do you want the request as well (Headers in Initiator subtab in Chrome dev tools)?:

{"via":[{"type":"org.postgresql.util.PSQLException","message":"ERROR: column "source.pivot-grouping" must appear in the GROUP BY clause or be used in an aggregate function\n Position: 131","at":["org.postgresql.core.v3.QueryExecutorImpl","receiveErrorResponse","QueryExecutorImpl.java",2497]}],"trace":[["org.postgresql.core.v3.QueryExecutorImpl","receiveErrorResponse","QueryExecutorImpl.java",2497],["org.postgresql.core.v3.QueryExecutorImpl","processResults","QueryExecutorImpl.java",2233],["org.postgresql.core.v3.QueryExecutorImpl","execute","QueryExecutorImpl.java",310],["org.postgresql.jdbc.PgStatement","executeInternal","PgStatement.java",446],["org.postgresql.jdbc.PgStatement","execute","PgStatement.java",370],["org.postgresql.jdbc.PgPreparedStatement","executeWithFlags","PgPreparedStatement.java",149],["org.postgresql.jdbc.PgPreparedStatement","executeQuery","PgPreparedStatement.java",108],["com.mchange.v2.c3p0.impl.NewProxyPreparedStatement","executeQuery","NewProxyPreparedStatement.java",431],["metabase.driver.sql_jdbc.execute$fn__77048","invokeStatic","execute.clj",266],["metabase.driver.sql_jdbc.execute$fn__77048","invoke","execute.clj",264],["clojure.lang.MultiFn","invoke","MultiFn.java",234],["metabase.driver.sql_jdbc.execute$execute_reducible_query","invokeStatic","execute.clj",391],["metabase.driver.sql_jdbc.execute$execute_reducible_query","invoke","execute.clj",376],["metabase.driver.sql_jdbc.execute$execute_reducible_query","invokeStatic","execute.clj",385],["metabase.driver.sql_jdbc.execute$execute_reducible_query","invoke","execute.clj",376],["metabase.driver.sql_jdbc$fn__78557","invokeStatic","sql_jdbc.clj",49],["metabase.driver.sql_jdbc$fn__78557","invoke","sql_jdbc.clj",47],["clojure.lang.MultiFn","invoke","MultiFn.java",244],["metabase.query_processor.context$executef","invokeStatic","context.clj",59],["metabase.query_processor.context$executef","invoke","context.clj",48],["metabase.query_processor.context.default$default_runf","invokeStatic","default.clj",69],["metabase.query_processor.context.default$default_runf","invoke","default.clj",67],["metabase.query_processor.context$runf","invokeStatic","context.clj",45],["metabase.query_processor.context$runf","invoke","context.clj",39],["metabase.query_processor.reducible$pivot","invokeStatic","reducible.clj",34],["metabase.query_processor.reducible$pivot","invoke","reducible.clj",31],["metabase.query_processor.middleware.mbql_to_native$mbql__GT_native$fn__46221","invoke","mbql_to_native.clj",26],["metabase.query_processor.middleware.check_features$check_features$fn__45497","invoke","check_features.clj",42],["metabase.query_processor.middleware.optimize_datetime_filters$optimize_datetime_filters$fn__46386","invoke","optimize_datetime_filters.clj",133],["metabase.query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values$fn__44298","invoke","auto_parse_filter_values.clj",44],["metabase.query_processor.middleware.wrap_value_literals$wrap_value_literals$fn__39953","invoke","wrap_value_literals.clj",149],["metabase.query_processor.middleware.annotate$add_column_info$fn__39816","invoke","annotate.clj",575],["metabase.query_processor.middleware.permissions$check_query_permissions$fn__45372","invoke","permissions.clj",70],["metabase.query_processor.middleware.pre_alias_aggregations$pre_alias_aggregations$fn__46904","invoke","pre_alias_aggregations.clj",40],["metabase.query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__45570","invoke","cumulative_aggregations.clj",61],["metabase.query_processor.middleware.resolve_joined_fields$resolve_joined_fields$fn__47141","invoke","resolve_joined_fields.clj",36],["metabase.query_processor.middleware.resolve_joins$resolve_joins$fn__47460","invoke","resolve_joins.clj",183],["metabase.query_processor.middleware.add_implicit_joins$add_implicit_joins$fn__43896","invoke","add_implicit_joins.clj",254],["metabase.query_processor.middleware.large_int_id$convert_id_to_string$fn__46182","invoke","large_int_id.clj",44],["metabase.query_processor.middleware.limit$limit$fn__46207","invoke","limit.clj",38],["metabase.query_processor.middleware.format_rows$format_rows$fn__46162","invoke","format_rows.clj",75],["metabase.query_processor.middleware.desugar$desugar$fn__45636","invoke","desugar.clj",22],["metabase.query_processor.middleware.binning$update_binning_strategy$fn__44657","invoke","binning.clj",229],["metabase.query_processor.middleware.resolve_fields$resolve_fields$fn__45174","invoke","resolve_fields.clj",24],["metabase.query_processor.middleware.add_dimension_projections$add_remapping$fn__43444","invoke","add_dimension_projections.clj",318],["metabase.query_processor.middleware.add_implicit_clauses$add_implicit_clauses$fn__43647","invoke","add_implicit_clauses.clj",141],["metabase.query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__44045","invoke","add_source_metadata.clj",105],["metabase.query_processor.middleware.reconcile_breakout_and_order_by_bucketing$reconcile_breakout_and_order_by_bucketing$fn__47101","invoke","reconcile_breakout_and_order_by_bucketing.clj",98],["metabase.query_processor.middleware.auto_bucket_datetimes$auto_bucket_datetimes$fn__44245","invoke","auto_bucket_datetimes.clj",140],["metabase.query_processor.middleware.resolve_source_table$resolve_source_tables$fn__45221","invoke","resolve_source_table.clj",46],["metabase.query_processor.middleware.parameters$substitute_parameters$fn__46886","invoke","parameters.clj",114],["metabase.query_processor.middleware.resolve_referenced$resolve_referenced_card_resources$fn__45273","invoke","resolve_referenced.clj",80],["metabase.query_processor.middleware.expand_macros$expand_macros$fn__45892","invoke","expand_macros.clj",158],["metabase.query_processor.middleware.add_timezone_info$add_timezone_info$fn__44054","invoke","add_timezone_info.clj",15],["metabase.query_processor.middleware.splice_params_in_response$splice_params_in_response$fn__47822","invoke","splice_params_in_response.clj",32],["metabase.query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__47112$fn__47116","invoke","resolve_database_and_driver.clj",33],["metabase.driver$do_with_driver","invokeStatic","driver.clj",61],["metabase.driver$do_with_driver","invoke","driver.clj",57],["metabase.query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__47112","invoke","resolve_database_and_driver.clj",27],["metabase.query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__46110","invoke","fetch_source_query.clj",267],["metabase.query_processor.middleware.store$initialize_store$fn__47831$fn__47832","invoke","store.clj",11],["metabase.query_processor.store$do_with_store","invokeStatic","store.clj",44],["metabase.query_processor.store$do_with_store","invoke","store.clj",40],["metabase.query_processor.middleware.store$initialize_store$fn__47831","invoke","store.clj",10],["metabase.query_processor.middleware.cache$maybe_return_cached_results$fn__45150","invoke","cache.clj",214],["metabase.query_processor.middleware.validate$validate_query$fn__47840","invoke","validate.clj",10],["metabase.query_processor.middleware.normalize_query$normalize$fn__46234","invoke","normalize_query.clj",22],["metabase.query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__43914","invoke","add_rows_truncated.clj",36],["metabase.query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__47807","invoke","results_metadata.clj",147],["metabase.query_processor.reducible$async_qp$qp_STAR___36611$thunk__36612","invoke","reducible.clj",103],["metabase.query_processor.reducible$async_qp$qp_STAR___36611$fn__36614","invoke","reducible.clj",108],["clojure.core$binding_conveyor_fn$fn__5754","invoke","core.clj",2030],["clojure.lang.AFn","call","AFn.java",18],["java.util.concurrent.FutureTask","run",null,-1],["java.util.concurrent.ThreadPoolExecutor","runWorker",null,-1],["java.util.concurrent.ThreadPoolExecutor$Worker","run",null,-1],["java.lang.Thread","run",null,-1]],"cause":"ERROR: column "source.pivot-grouping" must appear in the GROUP BY clause or be used in an aggregate function\n Position: 131","_status":500}

@crunchtoinfo Well, that is a combo of things going wrong, which makes it a lot harder to troubleshoot.
I have created an issue for it:
https://github.com/metabase/metabase/issues/14148 - upvote by clicking :+1: on the first post

1 Like