Comments (3)
can you get the query that metabase does to the db when it fires that query?
it seems like it's
SELECT decode(PERC_META,null,' ',to_char(PERC_META,'fm999G990D00') || '%') PERC_META\nFROM SA_ATENA.VW_META_SERVENTIAS S\nWHERE \n (CODIGO_SERVENTIA IS NULL [AND {ZONA_ELEITORAL} IS NULL]) \n[OR (NUM_ZE = LPAD({ZONA_ELEITORAL},3,'0'))]\nAND CD_META = 'META1'*/\n\nSELECT \n META1 PERC_META\nFROM \n SA_ATENA.VW_META_INDICADOR_VALOR_SERVENTIA\nWHERE \n 1=1\n [[AND ZONA_NUMERO = LPAD({{ZONA_ELEITORAL}},3,'0')]]
but I want to know how it's finally compiled before reaching the DW
from metabase.
Hi, thanks for getting back to us. This query is in the log, yes, but we believe it is a Metabase issue in general. Because the error happens with other queries in other databases. In short, from some point onwards all queries in all databases give this same error.
The error below is from the same day and happens with another query accessing another database.
2024-06-05 10:29:54,389 ERROR middleware.catch-exceptions :: Erro ao processar a consulta: ORA-00604: ocorrência de erro a nível de instrução de SQL recursiva 1
ORA-01756: cadeia de caracteres entre aspas/plicas não terminada corretamente
{:database_id 7,
:started_at #t "2024-06-05T10:29:19.644683500-03:00[GMT-03:00]",
:via
[{:status :failed,
:class com.mchange.v2.resourcepool.CannotAcquireResourceException,
:error "A ResourcePool could not acquire a resource from its primary factory or source.",
:stacktrace
["com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1507)"
"com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:644)"
"com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:554)"
"com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:758)"
"com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:685)"
"com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)"
"--> driver.sql_jdbc.execute$do_with_resolved_connection.invokeStatic(execute.clj:334)"
"driver.sql_jdbc.execute$do_with_resolved_connection.invoke(execute.clj:318)"
"driver.sql_jdbc.execute$fn__79305.invokeStatic(execute.clj:383)"
"driver.sql_jdbc.execute$fn__79305.invoke(execute.clj:381)"
"driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:693)"
"driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:679)"
"driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:690)"
"driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:679)"
"driver.sql_jdbc$fn__106894.invokeStatic(sql_jdbc.clj:78)"
"driver.sql_jdbc$fn__106894.invoke(sql_jdbc.clj:76)"
"driver.oracle$fn__121552.invokeStatic(oracle.clj:507)"
"driver.oracle$fn__121552.invoke(oracle.clj:505)"
"query_processor.context$executef.invokeStatic(context.clj:60)"
"query_processor.context$executef.invoke(context.clj:49)"
"query_processor.context.default$default_runf.invokeStatic(default.clj:44)"
"query_processor.context.default$default_runf.invoke(default.clj:42)"
"query_processor.context$runf.invokeStatic(context.clj:46)"
"query_processor.context$runf.invoke(context.clj:40)"
"query_processor.reducible$identity_qp.invokeStatic(reducible.clj:39)"
"query_processor.reducible$identity_qp.invoke(reducible.clj:36)"
"query_processor.middleware.cache$maybe_return_cached_results$maybe_return_cached_results_STAR___72328.invoke(cache.clj:229)"
"query_processor.middleware.permissions$check_query_permissions$fn__66677.invoke(permissions.clj:140)"
"query_processor.middleware.enterprise$check_download_permissions_middleware$fn__72149.invoke(enterprise.clj:51)"
"query_processor.middleware.enterprise$maybe_apply_column_level_perms_check_middleware$fn__72159.invoke(enterprise.clj:64)"
"query_processor.middleware.mbql_to_native$mbql__GT_native$fn__71591.invoke(mbql_to_native.clj:24)"
"query_processor$fn__73496$combined_post_process__73501$combined_post_process_STAR___73502.invoke(query_processor.clj:262)"
"query_processor$fn__73496$combined_pre_process__73497$combined_pre_process_STAR___73498.invoke(query_processor.clj:259)"
"query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__66774.invoke(fetch_source_query.clj:303)"
"query_processor.middleware.resolve_database_and_driver$resolve_driver_and_database_local_values$fn__72239$fn__72243.invoke(resolve_database_and_driver.clj:77)"
"driver$do_with_driver.invokeStatic(driver.clj:97)"
"driver$do_with_driver.invoke(driver.clj:92)"
"query_processor.middleware.resolve_database_and_driver$resolve_driver_and_database_local_values$fn__72239.invoke(resolve_database_and_driver.clj:76)"
"query_processor.middleware.store$initialize_store$fn__67401$fn__67402.invoke(store.clj:14)"
"query_processor.store$do_with_metadata_provider.invokeStatic(store.clj:169)"
"query_processor.store$do_with_metadata_provider.invoke(store.clj:150)"
"query_processor.store$do_with_metadata_provider.invokeStatic(store.clj:158)"
"query_processor.store$do_with_metadata_provider.invoke(store.clj:150)"
"query_processor.middleware.store$initialize_store$fn__67401.invoke(store.clj:13)"
"query_processor.middleware.resolve_database_and_driver$resolve_database$fn__72236.invoke(resolve_database_and_driver.clj:60)"
"query_processor.middleware.normalize_query$normalize$fn__72541.invoke(normalize_query.clj:38)"
"query_processor.middleware.enterprise$fn__72176$handle_audit_app_internal_queries__72177$fn__72179.invoke(enterprise.clj:96)"
"query_processor.middleware.enterprise$handle_audit_app_internal_queries_middleware$fn__72187.invoke(enterprise.clj:103)"
"query_processor.middleware.constraints$mark_needs_default_userland_constraints$fn__71302.invoke(constraints.clj:104)"
"query_processor.middleware.process_userland_query$process_userland_query$fn__72472.invoke(process_userland_query.clj:156)"
"query_processor.middleware.catch_exceptions$catch_exceptions$fn__73073.invoke(catch_exceptions.clj:171)"
"query_processor.reducible$async_qp$qp_STAR___62893$thunk__62895.invoke(reducible.clj:126)"
"query_processor.reducible$async_qp$qp_STAR___62893$fn__62897.invoke(reducible.clj:131)"]}
{:status :failed,
:class java.sql.SQLException,
:error "Connections could not be acquired from the underlying database!",
:stacktrace
["com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)"
"com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:692)"
"com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)"
"--> driver.sql_jdbc.execute$do_with_resolved_connection.invokeStatic(execute.clj:334)"
"driver.sql_jdbc.execute$do_with_resolved_connection.invoke(execute.clj:318)"
"driver.sql_jdbc.execute$fn__79305.invokeStatic(execute.clj:383)"
"driver.sql_jdbc.execute$fn__79305.invoke(execute.clj:381)"
"driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:693)"
"driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:679)"
"driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:690)"
"driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:679)"
"driver.sql_jdbc$fn__106894.invokeStatic(sql_jdbc.clj:78)"
"driver.sql_jdbc$fn__106894.invoke(sql_jdbc.clj:76)"
"driver.oracle$fn__121552.invokeStatic(oracle.clj:507)"
"driver.oracle$fn__121552.invoke(oracle.clj:505)"
"query_processor.context$executef.invokeStatic(context.clj:60)"
"query_processor.context$executef.invoke(context.clj:49)"
"query_processor.context.default$default_runf.invokeStatic(default.clj:44)"
"query_processor.context.default$default_runf.invoke(default.clj:42)"
"query_processor.context$runf.invokeStatic(context.clj:46)"
"query_processor.context$runf.invoke(context.clj:40)"
"query_processor.reducible$identity_qp.invokeStatic(reducible.clj:39)"
"query_processor.reducible$identity_qp.invoke(reducible.clj:36)"
"query_processor.middleware.cache$maybe_return_cached_results$maybe_return_cached_results_STAR___72328.invoke(cache.clj:229)"
"query_processor.middleware.permissions$check_query_permissions$fn__66677.invoke(permissions.clj:140)"
"query_processor.middleware.enterprise$check_download_permissions_middleware$fn__72149.invoke(enterprise.clj:51)"
"query_processor.middleware.enterprise$maybe_apply_column_level_perms_check_middleware$fn__72159.invoke(enterprise.clj:64)"
"query_processor.middleware.mbql_to_native$mbql__GT_native$fn__71591.invoke(mbql_to_native.clj:24)"
"query_processor$fn__73496$combined_post_process__73501$combined_post_process_STAR___73502.invoke(query_processor.clj:262)"
"query_processor$fn__73496$combined_pre_process__73497$combined_pre_process_STAR___73498.invoke(query_processor.clj:259)"
"query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__66774.invoke(fetch_source_query.clj:303)"
"query_processor.middleware.resolve_database_and_driver$resolve_driver_and_database_local_values$fn__72239$fn__72243.invoke(resolve_database_and_driver.clj:77)"
"driver$do_with_driver.invokeStatic(driver.clj:97)"
"driver$do_with_driver.invoke(driver.clj:92)"
"query_processor.middleware.resolve_database_and_driver$resolve_driver_and_database_local_values$fn__72239.invoke(resolve_database_and_driver.clj:76)"
"query_processor.middleware.store$initialize_store$fn__67401$fn__67402.invoke(store.clj:14)"
"query_processor.store$do_with_metadata_provider.invokeStatic(store.clj:169)"
"query_processor.store$do_with_metadata_provider.invoke(store.clj:150)"
"query_processor.store$do_with_metadata_provider.invokeStatic(store.clj:158)"
"query_processor.store$do_with_metadata_provider.invoke(store.clj:150)"
"query_processor.middleware.store$initialize_store$fn__67401.invoke(store.clj:13)"
"query_processor.middleware.resolve_database_and_driver$resolve_database$fn__72236.invoke(resolve_database_and_driver.clj:60)"
"query_processor.middleware.normalize_query$normalize$fn__72541.invoke(normalize_query.clj:38)"
"query_processor.middleware.enterprise$fn__72176$handle_audit_app_internal_queries__72177$fn__72179.invoke(enterprise.clj:96)"
"query_processor.middleware.enterprise$handle_audit_app_internal_queries_middleware$fn__72187.invoke(enterprise.clj:103)"
"query_processor.middleware.constraints$mark_needs_default_userland_constraints$fn__71302.invoke(constraints.clj:104)"
"query_processor.middleware.process_userland_query$process_userland_query$fn__72472.invoke(process_userland_query.clj:156)"
"query_processor.middleware.catch_exceptions$catch_exceptions$fn__73073.invoke(catch_exceptions.clj:171)"
"query_processor.reducible$async_qp$qp_STAR___62893$thunk__62895.invoke(reducible.clj:126)"
"query_processor.reducible$async_qp$qp_STAR___62893$fn__62897.invoke(reducible.clj:131)"],
:state nil}],
:action_id nil,
:state "60000",
:json_query
{:constraints {:max-results 10000, :max-results-bare-rows 2000},
:type :query,
:middleware {:js-int-to-string? true, :ignore-cached-results? false, :process-viz-settings? false},
:viz-settings nil,
:database 7,
:query {:source-table 79241},
:parameters [],
:async? true,
:cache-ttl nil},
:native
{:query
"SELECT * FROM (SELECT \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"ID\" \"ID\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"ORDEM\" \"ORDEM\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"TIPO\" \"TIPO\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"MATRICULA\" \"MATRICULA\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"TITULO\" \"TITULO\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"LOGIN\" \"LOGIN\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"NOME\" \"NOME\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"EMAIL\" \"EMAIL\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"CARGO\" \"CARGO\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"CD_LOTACAO\" \"CD_LOTACAO\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"LOTACAO\" \"LOTACAO\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"SITUACAO\" \"SITUACAO\", \"GUARDIAO\".\"HELPDESK_USUARIOS\".\"ACESSO\" \"ACESSO\" FROM \"GUARDIAO\".\"HELPDESK_USUARIOS\") WHERE rownum <= 2000",
:params nil},
:status :failed,
:class java.sql.SQLException,
:stacktrace
["oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:629)"
"oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:558)"
"oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:553)"
"oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:1376)"
"oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:783)"
"oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:771)"
"oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:298)"
"oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:451)"
"oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTHWithO5Logon(T4CTTIoauthenticate.java:1565)"
"oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:1314)"
"oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:1268)"
"oracle.jdbc.driver.T4CConnection.authenticateWithPassword(T4CConnection.java:1515)"
"oracle.jdbc.driver.T4CConnection.authenticateUserForLogon(T4CConnection.java:1464)"
"oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:676)"
"oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:1088)"
"oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:89)"
"oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:732)"
"oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:648)"
"--> plugins.jdbc_proxy$proxy_driver$reify__84482.connect(jdbc_proxy.clj:37)"
"connection_pool$proxy_data_source$reify__28702.getConnection(connection_pool.clj:29)"],
:card_id 456,
:context :question,
:error
"ORA-00604: ocorrência de erro a nível de instrução de SQL recursiva 1\nORA-01756: cadeia de caracteres entre aspas/plicas não terminada corretamente\n",
:row_count 0,
:running_time 0,
:preprocessed
{:constraints {:max-results 10000, :max-results-bare-rows 2000},
:type :query,
:middleware {:js-int-to-string? true, :ignore-cached-results? false, :process-viz-settings? false},
:info
{:executed-by 18,
:context :question,
:card-id 456,
:card-name "Guardião - Servidores",
:visualization-settings {:table.pivot-column "ORDEM", :table.cell-column "ID"}},
:database 7,
:query
{:source-table 79241,
:fields
[[:field 490681 nil]
[:field 490680 nil]
[:field 490679 nil]
[:field 490685 nil]
[:field 490682 nil]
[:field 490676 nil]
[:field 490677 nil]
[:field 490686 nil]
[:field 490683 nil]
[:field 490687 nil]
[:field 490684 nil]
[:field 490678 nil]
[:field 490675 nil]],
:limit 2000,
:metabase.query-processor.middleware.limit/original-limit nil},
:async? true},
:data {:rows [], :cols []}}
from metabase.
Regarding your question, follow the query below, I just ran it in Metabase without errors.
/*SELECT decode(PERC_META,null,' ',to_char(PERC_META,'fm999G990D00') || '%') PERC_META
FROM SA_ATENA.VW_META_SERVENTIAS S
WHERE
(CODIGO_SERVENTIA IS NULL [AND {ZONA_ELEITORAL} IS NULL])
[OR (NUM_ZE = LPAD({ZONA_ELEITORAL},3,'0'))]
AND CD_META = 'META1'*/
SELECT
META1 PERC_META
FROM
SA_ATENA.VW_META_INDICADOR_VALOR_SERVENTIA
WHERE
1=1
[[AND ZONA_NUMERO = LPAD({{ZONA_ELEITORAL}},3,'0')]]
from metabase.
Related Issues (20)
- Dashboard subscription failed to send pivot tables to slack
- Failed to upgrade v0.44.4 -> v0.49.13 HOT 2
- Store context in `QueryField` table
- Ensure we can find logged parse exceptions in Grafana
- Instrument parsing performance HOT 1
- Do some basic profiling (on big queries, etc.) to make sure we don't use too much memory HOT 1
- Send the queries to starrocks as normal strings without a prepared statement HOT 2
- Slack alert is no longer working due to Slack API change HOT 1
- Error: There was a problem displaying this chart HOT 1
- Ability to lock the side_nav (hide sidebar) for interactive embedding
- Pinned Models lack an icon
- Add Model Icon to Model section inside a collection
- Table background changes when adding it to a dashboard
- Decouple Sort of Legend and Segments of a Stacked Bar HOT 1
- Review styling issues in static dashboards for embedding SDK HOT 1
- Review styling issues for visualizations in questions and dashboards in embedding SDK HOT 1
- special characters on the data will break subscriptions
- Improve `ambiguous column name X` error message to include the line number HOT 2
- [Flaky Test]: scenarios > collection items listing sorting should allow to sort unpinned items by columns asc and desc HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metabase.