Trino integration fails when migrating to new Presto driver

We connect Metabase to Trino using the workaround described here - https://github.com/metabase/metabase/issues/17532#issuecomment-944883108

It worked using the now deprecated Persto driver. Unfortunately, when upgrading to the new Presto driver the queries fail.

In this example trino is connected to a Postgres 11 instance. The following query (and any other) fails:
select * from dbname.public.tablename
limit 10

The query
select 1

does return the expected result, so it seems that the connectivity is good.

Hi @alexpusch

  1. Post "Diagnostic Info" from Admin > Troubleshooting
  2. Post the full stacktrace from Admin > Troubleshooting > Logs
  3. Post Trino information, version etc.
  4. And check Trino logs for more details

@flamber Thanks for the quick response!

Metabase version 0.41.5

Diganostic info:

{
  "browser-info": {
    "language": "en-GB",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.13+8",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.13",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.13+8",
    "os.name": "Linux",
    "os.version": "5.4.129+",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "bigquery",
      "presto",
      "postgres",
      "snowflake",
      "presto-jdbc",
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "11.13"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.2.23"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2021-12-16",
      "tag": "v0.41.5",
      "branch": "release-x.41.x",
      "hash": "fbfffc6"
    },
    "settings": {
      "report-timezone": "Asia/Jerusalem"
    }
  }
}    

Full stack trace:

{:database_id 28,
:started_at #t "2021-12-26T12:21:19.570678Z[GMT]",
:via
[{:status :failed,
  :class com.facebook.presto.jdbc.internal.jackson.databind.exc.ValueInstantiationException,
  :error
  "Cannot construct instance of `com.facebook.presto.jdbc.internal.client.QueryResults`, problem: Illegal base64 character 2d\n at [Source: (String)\"{\"id\":\"20211226_122119_03896_h2kdn\",\"infoUri\":\"http://trinoHost/ui/query.html?20211226_122119_03896_h2kdn\",\"partialCancelUri\":\"http://trinoHost/v1/statement/executing/partialCancel/20211226_122119_03896_h2kdn/1/y8ac908b606810a5c37b705dd754e09b27c68459e/1\",\"nextUri\":\"http://trinoHost/v1/statement/executing/20211226_122119_03896_h2kdn/y8ac908b606810a5c37b705dd754e09b27c68459e/1\",\"columns\":[{\"name\":\"id\",\"type\":\"uuid\",\"typeSignature\":{\"rawType\":\"uuid\",\"arguments\":[]}}],\"da\"[truncated 898 chars]; line: 1, column: 1397]",
  :stacktrace
  ["com.facebook.presto.jdbc.internal.jackson.databind.exc.ValueInstantiationException.from(ValueInstantiationException.java:47)"
    "com.facebook.presto.jdbc.internal.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:1732)"
    "com.facebook.presto.jdbc.internal.jackson.databind.deser.std.StdValueInstantiator.wrapAsJsonMappingException(StdValueInstantiator.java:491)"
    "com.facebook.presto.jdbc.internal.jackson.databind.deser.std.StdValueInstantiator.rewrapCtorProblem(StdValueInstantiator.java:514)"
    "com.facebook.presto.jdbc.internal.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:285)"
    "com.facebook.presto.jdbc.internal.jackson.databind.deser.ValueInstantiator.createFromObjectWith(ValueInstantiator.java:229)"
    "com.facebook.presto.jdbc.internal.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:198)"
    "com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:488)"
    "com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1287)"
    "com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326)"
    "com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)"
    "com.facebook.presto.jdbc.internal.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1719)"
    "com.facebook.presto.jdbc.internal.jackson.databind.ObjectReader.readValue(ObjectReader.java:1261)"
    "com.facebook.presto.jdbc.internal.com.facebook.airlift.json.JsonCodec.fromJson(JsonCodec.java:137)"
    "com.facebook.presto.jdbc.internal.client.JsonResponse.<init>(JsonResponse.java:67)"
    "com.facebook.presto.jdbc.internal.client.JsonResponse.execute(JsonResponse.java:144)"
    "com.facebook.presto.jdbc.internal.client.StatementClientV1.advance(StatementClientV1.java:406)"
    "com.facebook.presto.jdbc.PrestoResultSet.getColumns(PrestoResultSet.java:1743)"
    "com.facebook.presto.jdbc.PrestoResultSet.<init>(PrestoResultSet.java:121)"
    "com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:272)"
    "com.facebook.presto.jdbc.PrestoStatement.execute(PrestoStatement.java:230)"
    "com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75)"
    "--> driver.sql_jdbc.execute$fn__52357.invokeStatic(execute.clj:368)"
    "driver.sql_jdbc.execute$fn__52357.invoke(execute.clj:366)"
    "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invokeStatic(execute.clj:376)"
    "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invoke(execute.clj:373)"
    "driver.sql_jdbc.execute$execute_reducible_query$fn__52437.invoke(execute.clj:502)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:501)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:496)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
    "driver.sql_jdbc$fn__85100.invokeStatic(sql_jdbc.clj:54)"
    "driver.sql_jdbc$fn__85100.invoke(sql_jdbc.clj:52)"
    "query_processor.context$executef.invokeStatic(context.clj:59)"
    "query_processor.context$executef.invoke(context.clj:48)"
    "query_processor.context.default$default_runf.invokeStatic(default.clj:68)"
    "query_processor.context.default$default_runf.invoke(default.clj:66)"
    "query_processor.context$runf.invokeStatic(context.clj:45)"
    "query_processor.context$runf.invoke(context.clj:39)"
    "query_processor.reducible$pivot.invokeStatic(reducible.clj:34)"
    "query_processor.reducible$pivot.invoke(reducible.clj:31)"
    "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__49090.invoke(mbql_to_native.clj:25)"
    "query_processor.middleware.check_features$check_features$fn__49576.invoke(check_features.clj:39)"
    "query_processor.middleware.limit$limit$fn__47463.invoke(limit.clj:37)"
    "query_processor.middleware.cache$maybe_return_cached_results$fn__49950.invoke(cache.clj:204)"
    "query_processor.middleware.optimize_temporal_filters$optimize_temporal_filters$fn__50943.invoke(optimize_temporal_filters.clj:204)"
    "query_processor.middleware.validate_temporal_bucketing$validate_temporal_bucketing$fn__50987.invoke(validate_temporal_bucketing.clj:50)"
    "query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values$fn__49147.invoke(auto_parse_filter_values.clj:43)"
    "query_processor.middleware.wrap_value_literals$wrap_value_literals$fn__39249.invoke(wrap_value_literals.clj:161)"
    "query_processor.middleware.annotate$add_column_info$fn__43680.invoke(annotate.clj:615)"
    "query_processor.middleware.permissions$check_query_permissions$fn__45618.invoke(permissions.clj:108)"
    "query_processor.middleware.pre_alias_aggregations$pre_alias_aggregations$fn__50127.invoke(pre_alias_aggregations.clj:40)"
    "query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__46016.invoke(cumulative_aggregations.clj:60)"
    "query_processor.middleware.visualization_settings$update_viz_settings$fn__45954.invoke(visualization_settings.clj:63)"
    "query_processor.middleware.resolve_joined_fields$resolve_joined_fields$fn__47061.invoke(resolve_joined_fields.clj:102)"
    "query_processor.middleware.resolve_joins$resolve_joins$fn__50713.invoke(resolve_joins.clj:171)"
    "query_processor.middleware.add_implicit_joins$add_implicit_joins$fn__50249.invoke(add_implicit_joins.clj:190)"
    "query_processor.middleware.large_int_id$convert_id_to_string$fn__47080.invoke(large_int_id.clj:59)"
    "query_processor.middleware.format_rows$format_rows$fn__50301.invoke(format_rows.clj:74)"
    "query_processor.middleware.add_default_temporal_unit$add_default_temporal_unit$fn__46452.invoke(add_default_temporal_unit.clj:23)"
    "query_processor.middleware.desugar$desugar$fn__45927.invoke(desugar.clj:21)"
    "query_processor.middleware.binning$update_binning_strategy$fn__39149.invoke(binning.clj:229)"
    "query_processor.middleware.resolve_fields$resolve_fields$fn__45261.invoke(resolve_fields.clj:34)"
    "query_processor.middleware.add_dimension_projections$add_remapping$fn__49502.invoke(add_dimension_projections.clj:312)"
    "query_processor.middleware.add_implicit_clauses$add_implicit_clauses$fn__49799.invoke(add_implicit_clauses.clj:147)"
    "query_processor.middleware.upgrade_field_literals$upgrade_field_literals$fn__47448.invoke(upgrade_field_literals.clj:40)"
    "query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__46829.invoke(add_source_metadata.clj:123)"
    "query_processor.middleware.reconcile_breakout_and_order_by_bucketing$reconcile_breakout_and_order_by_bucketing$fn__50049.invoke(reconcile_breakout_and_order_by_bucketing.clj:100)"
    "query_processor.middleware.auto_bucket_datetimes$auto_bucket_datetimes$fn__48399.invoke(auto_bucket_datetimes.clj:147)"
    "query_processor.middleware.resolve_source_table$resolve_source_tables$fn__45242.invoke(resolve_source_table.clj:45)"
    "query_processor.middleware.parameters$substitute_parameters$fn__48053.invoke(parameters.clj:111)"
    "query_processor.middleware.resolve_referenced$resolve_referenced_card_resources$fn__45315.invoke(resolve_referenced.clj:79)"
    "query_processor.middleware.expand_macros$expand_macros$fn__51371.invoke(expand_macros.clj:184)"
    "query_processor.middleware.add_timezone_info$add_timezone_info$fn__47832.invoke(add_timezone_info.clj:15)"
    "query_processor.middleware.splice_params_in_response$splice_params_in_response$fn__50316.invoke(splice_params_in_response.clj:32)"
    "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__49810$fn__49814.invoke(resolve_database_and_driver.clj:31)"
    "driver$do_with_driver.invokeStatic(driver.clj:60)"
    "driver$do_with_driver.invoke(driver.clj:56)"
    "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__49810.invoke(resolve_database_and_driver.clj:25)"
    "query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__45865.invoke(fetch_source_query.clj:274)"
    "query_processor.middleware.store$initialize_store$fn__46053$fn__46054.invoke(store.clj:11)"
    "query_processor.store$do_with_store.invokeStatic(store.clj:44)"
    "query_processor.store$do_with_store.invoke(store.clj:38)"
    "query_processor.middleware.store$initialize_store$fn__46053.invoke(store.clj:10)"
    "query_processor.middleware.validate$validate_query$fn__50099.invoke(validate.clj:10)"
    "query_processor.middleware.normalize_query$normalize$fn__50106.invoke(normalize_query.clj:22)"
    "query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__47778.invoke(add_rows_truncated.clj:35)"
    "query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__49076.invoke(results_metadata.clj:147)"
    "query_processor.middleware.constraints$add_default_userland_constraints$fn__47796.invoke(constraints.clj:42)"
    "query_processor.middleware.process_userland_query$process_userland_query$fn__50085.invoke(process_userland_query.clj:146)"
    "query_processor.middleware.catch_exceptions$catch_exceptions$fn__50396.invoke(catch_exceptions.clj:169)"
    "query_processor.reducible$async_qp$qp_STAR___42500$thunk__42501.invoke(reducible.clj:103)"
    "query_processor.reducible$async_qp$qp_STAR___42500.invoke(reducible.clj:109)"
    "query_processor.reducible$sync_qp$qp_STAR___42509$fn__42512.invoke(reducible.clj:135)"
    "query_processor.reducible$sync_qp$qp_STAR___42509.invoke(reducible.clj:134)"
    "query_processor$process_userland_query.invokeStatic(query_processor.clj:243)"
    "query_processor$process_userland_query.doInvoke(query_processor.clj:239)"
    "query_processor$fn__51419$process_query_and_save_execution_BANG___51428$fn__51431.invoke(query_processor.clj:255)"
    "query_processor$fn__51419$process_query_and_save_execution_BANG___51428.invoke(query_processor.clj:247)"
    "query_processor$fn__51463$process_query_and_save_with_max_results_constraints_BANG___51472$fn__51475.invoke(query_processor.clj:267)"
    "query_processor$fn__51463$process_query_and_save_with_max_results_constraints_BANG___51472.invoke(query_processor.clj:260)"
    "api.dataset$run_query_async$fn__57811.invoke(dataset.clj:64)"
    "query_processor.streaming$streaming_response_STAR_$fn__38058$fn__38059.invoke(streaming.clj:148)"
    "query_processor.streaming$streaming_response_STAR_$fn__38058.invoke(streaming.clj:147)"
    "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:65)"
    "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:63)"
    "async.streaming_response$do_f_async$fn__25229.invoke(streaming_response.clj:84)"]}
  {:status :failed,
  :class java.lang.IllegalArgumentException,
  :error "Invalid JSON string for [simple type, class com.facebook.presto.jdbc.internal.client.QueryResults]",
  :stacktrace
  ["com.facebook.presto.jdbc.internal.com.facebook.airlift.json.JsonCodec.fromJson(JsonCodec.java:140)"
    "com.facebook.presto.jdbc.internal.client.JsonResponse.<init>(JsonResponse.java:67)"
    "com.facebook.presto.jdbc.internal.client.JsonResponse.execute(JsonResponse.java:144)"
    "com.facebook.presto.jdbc.internal.client.StatementClientV1.advance(StatementClientV1.java:406)"
    "com.facebook.presto.jdbc.PrestoResultSet.getColumns(PrestoResultSet.java:1743)"
    "com.facebook.presto.jdbc.PrestoResultSet.<init>(PrestoResultSet.java:121)"
    "com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:272)"
    "com.facebook.presto.jdbc.PrestoStatement.execute(PrestoStatement.java:230)"
    "com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75)"
    "--> driver.sql_jdbc.execute$fn__52357.invokeStatic(execute.clj:368)"
    "driver.sql_jdbc.execute$fn__52357.invoke(execute.clj:366)"
    "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invokeStatic(execute.clj:376)"
    "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invoke(execute.clj:373)"
    "driver.sql_jdbc.execute$execute_reducible_query$fn__52437.invoke(execute.clj:502)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:501)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:496)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
    "driver.sql_jdbc$fn__85100.invokeStatic(sql_jdbc.clj:54)"
    "driver.sql_jdbc$fn__85100.invoke(sql_jdbc.clj:52)"
    ...
    "query_processor.middleware.store$initialize_store$fn__46053.invoke(store.clj:10)"
    "query_processor.middleware.validate$validate_query$fn__50099.invoke(validate.clj:10)"
    "query_processor.middleware.normalize_query$normalize$fn__50106.invoke(normalize_query.clj:22)"
    "query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__47778.invoke(add_rows_truncated.clj:35)"
    "query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__49076.invoke(results_metadata.clj:147)"
    "query_processor.middleware.constraints$add_default_userland_constraints$fn__47796.invoke(constraints.clj:42)"
    "query_processor.middleware.process_userland_query$process_userland_query$fn__50085.invoke(process_userland_query.clj:146)"
    "query_processor.middleware.catch_exceptions$catch_exceptions$fn__50396.invoke(catch_exceptions.clj:169)"
    "query_processor.reducible$async_qp$qp_STAR___42500$thunk__42501.invoke(reducible.clj:103)"
    "query_processor.reducible$async_qp$qp_STAR___42500.invoke(reducible.clj:109)"
    "query_processor.reducible$sync_qp$qp_STAR___42509$fn__42512.invoke(reducible.clj:135)"
    "query_processor.reducible$sync_qp$qp_STAR___42509.invoke(reducible.clj:134)"
    "query_processor$process_userland_query.invokeStatic(query_processor.clj:243)"
    "query_processor$process_userland_query.doInvoke(query_processor.clj:239)"
    "query_processor$fn__51419$process_query_and_save_execution_BANG___51428$fn__51431.invoke(query_processor.clj:255)"
    "query_processor$fn__51419$process_query_and_save_execution_BANG___51428.invoke(query_processor.clj:247)"
    "query_processor$fn__51463$process_query_and_save_with_max_results_constraints_BANG___51472$fn__51475.invoke(query_processor.clj:267)"
    "query_processor$fn__51463$process_query_and_save_with_max_results_constraints_BANG___51472.invoke(query_processor.clj:260)"
    "api.dataset$run_query_async$fn__57811.invoke(dataset.clj:64)"
    "query_processor.streaming$streaming_response_STAR_$fn__38058$fn__38059.invoke(streaming.clj:148)"
    "query_processor.streaming$streaming_response_STAR_$fn__38058.invoke(streaming.clj:147)"
    "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:65)"
    "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:63)"
    "async.streaming_response$do_f_async$fn__25229.invoke(streaming_response.clj:84)"]}
  {:status :failed,
  :class java.lang.IllegalArgumentException,
  :error
  "Unable to create class com.facebook.presto.jdbc.internal.client.QueryResults from JSON response:\n[{\"id\":\"20211226_122119_03896_h2kdn\",\"infoUri\":\"http://trinoHost/ui/query.html?20211226_122119_03896_h2kdn\",\"partialCancelUri\":\"http://trinoHost/v1/statement/executing/partialCancel/20211226_122119_03896_h2kdn/1/y8ac908b606810a5c37b705dd754e09b27c68459e/1\",\"nextUri\":\"http://trinoHost/v1/statement/executing/20211226_122119_03896_h2kdn/y8ac908b606810a5c37b705dd754e09b27c68459e/1\",\"columns\":[{\"name\":\"id\",\"type\":\"uuid\",\"typeSignature\":{\"rawType\":\"uuid\",\"arguments\":[]}}],\"data\":[[\"0f231d51-711c-4c39-86f6-6e4a77f37448\"]],\"stats\":{\"state\":\"RUNNING\",\"queued\":false,\"scheduled\":true,\"nodes\":1,\"totalSplits\":2,\"queuedSplits\":1,\"runningSplits\":1,\"completedSplits\":0,\"cpuTimeMillis\":0,\"wallTimeMillis\":0,\"queuedTimeMillis\":0,\"elapsedTimeMillis\":83,\"processedRows\":0,\"processedBytes\":0,\"physicalInputBytes\":0,\"peakMemoryBytes\":0,\"spilledBytes\":0,\"rootStage\":{\"stageId\":\"0\",\"state\":\"RUNNING\",\"done\":false,\"nodes\":1,\"totalSplits\":1,\"queuedSplits\":1,\"runningSplits\":0,\"completedSplits\":0,\"cpuTimeMillis\":0,\"wallTimeMillis\":0,\"processedRows\":0,\"processedBytes\":0,\"physicalInputBytes\":0,\"subStages\":[{\"stageId\":\"1\",\"state\":\"FLUSHING\",\"done\":false,\"nodes\":1,\"totalSplits\":1,\"queuedSplits\":0,\"runningSplits\":1,\"completedSplits\":0,\"cpuTimeMillis\":0,\"wallTimeMillis\":0,\"processedRows\":0,\"processedBytes\":0,\"physicalInputBytes\":0,\"subStages\":[]}]},\"progressPercentage\":0.0},\"warnings\":[]}\n]",
  :stacktrace
  ["com.facebook.presto.jdbc.internal.client.JsonResponse.<init>(JsonResponse.java:70)"
    "com.facebook.presto.jdbc.internal.client.JsonResponse.execute(JsonResponse.java:144)"
    "com.facebook.presto.jdbc.internal.client.StatementClientV1.advance(StatementClientV1.java:406)"
    "com.facebook.presto.jdbc.PrestoResultSet.getColumns(PrestoResultSet.java:1743)"
    "com.facebook.presto.jdbc.Presto`Set.<init>(PrestoResultSet.java:121)"
    "com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:272)"
    "com.facebook.presto.jdbc.PrestoStatement.execute(PrestoStatement.java:230)"
    "com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75)"
    "--> driver.sql_jdbc.execute$fn__52357.invokeStatic(execute.clj:368)"
    "driver.sql_jdbc.execute$fn__52357.invoke(execute.clj:366)"
    "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invokeStatic(execute.clj:376)"
    "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invoke(execute.clj:373)"
    "driver.sql_jdbc.execute$execute_reducible_query$fn__52437.invoke(execute.clj:502)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:501)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:496)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
    "driver.sql_jdbc$fn__85100.invokeStatic(sql_jdbc.clj:54)"
    "driver.sql_jdbc$fn__85100.invoke(sql_jdbc.clj:52)"
    "query_processor.context$executef.invokeStatic(context.clj:59)"
    "query_processor.context$executef.invoke(context.clj:48)"
    "query_processor.context.default$default_runf.invokeStatic(default.clj:68)"
    "query_processor.context.default$default_runf.invoke(default.clj:66)"
    "query_processor.context$runf.invokeStatic(context.clj:45)"
    "query_processor.context$runf.invoke(context.clj:39)"
    "query_processor.reducible$pivot.invokeStatic(reducible.clj:34)"
    "query_processor.reducible$pivot.invoke(reducible.clj:31)"
    "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__49090.invoke(mbql_to_native.clj:25)"
    ...
    "query_processor.reducible$sync_qp$qp_STAR___42509$fn__42512.invoke(reducible.clj:135)"
    "query_processor.reducible$sync_qp$qp_STAR___42509.invoke(reducible.clj:134)"
    "query_processor$process_userland_query.invokeStatic(query_processor.clj:243)"
    "query_processor$process_userland_query.doInvoke(query_processor.clj:239)"
    "query_processor$fn__51419$process_query_and_save_execution_BANG___51428$fn__51431.invoke(query_processor.clj:255)"
    "query_processor$fn__51419$process_query_and_save_execution_BANG___51428.invoke(query_processor.clj:247)"
    "query_processor$fn__51463$process_query_and_save_with_max_results_constraints_BANG___51472$fn__51475.invoke(query_processor.clj:267)"
    "query_processor$fn__51463$process_query_and_save_with_max_results_constraints_BANG___51472.invoke(query_processor.clj:260)"
    "api.dataset$run_query_async$fn__57811.invoke(dataset.clj:64)"
    "query_processor.streaming$streaming_response_STAR_$fn__38058$fn__38059.invoke(streaming.clj:148)"
    "query_processor.streaming$streaming_response_STAR_$fn__38058.invoke(streaming.clj:147)"
    "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:65)"
    "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:63)"
    "async.streaming_response$do_f_async$fn__25229.invoke(streaming_response.clj:84)"]}
  {:status :failed,
  :class java.lang.RuntimeException,
  :error
  "Error fetching next at http://trinoHost/v1/statement/executing/20211226_122119_03896_h2kdn/y8bc48c16c215c4b52abd87aa462e42c935524b49/0 returned an invalid response: JsonResponse{statusCode=200, statusMessage=OK, headers={content-type=[application/json], date=[Sun, 26 Dec 2021 12:21:19 GMT], vary=[Accept-Encoding, User-Agent], x-content-type-options=[nosniff]}, hasValue=false} [Error: {\"id\":\"20211226_122119_03896_h2kdn\",\"infoUri\":\"http://trinoHost/ui/query.html?20211226_122119_03896_h2kdn\",\"partialCancelUri\":\"http://trinoHost/v1/statement/executing/partialCancel/20211226_122119_03896_h2kdn/1/y8ac908b606810a5c37b705dd754e09b27c68459e/1\",\"nextUri\":\"http://trinoHost/v1/statement/executing/20211226_122119_03896_h2kdn/y8ac908b606810a5c37b705dd754e09b27c68459e/1\",\"columns\":[{\"name\":\"id\",\"type\":\"uuid\",\"typeSignature\":{\"rawType\":\"uuid\",\"arguments\":[]}}],\"data\":[[\"0f231d51-711c-4c39-86f6-6e4a77f37448\"]],\"stats\":{\"state\":\"RUNNING\",\"queued\":false,\"scheduled\":true,\"nodes\":1,\"totalSplits\":2,\"queuedSplits\":1,\"runningSplits\":1,\"completedSplits\":0,\"cpuTimeMillis\":0,\"wallTimeMillis\":0,\"queuedTimeMillis\":0,\"elapsedTimeMillis\":83,\"processedRows\":0,\"processedBytes\":0,\"physicalInputBytes\":0,\"peakMemoryBytes\":0,\"spilledBytes\":0,\"rootStage\":{\"stageId\":\"0\",\"state\":\"RUNNING\",\"done\":false,\"nodes\":1,\"totalSplits\":1,\"queuedSplits\":1,\"runningSplits\":0,\"completedSplits\":0,\"cpuTimeMillis\":0,\"wallTimeMillis\":0,\"processedRows\":0,\"processedBytes\":0,\"physicalInputBytes\":0,\"subStages\":[{\"stageId\":\"1\",\"state\":\"FLUSHING\",\"done\":false,\"nodes\":1,\"totalSplits\":1,\"queuedSplits\":0,\"runningSplits\":1,\"completedSplits\":0,\"cpuTimeMillis\":0,\"wallTimeMillis\":0,\"processedRows\":0,\"processedBytes\":0,\"physicalInputBytes\":0,\"subStages\":[]}]},\"progressPercentage\":0.0},\"warnings\":[]}\n]",
  :stacktrace
  ["com.facebook.presto.jdbc.internal.client.StatementClientV1.requestFailedException(StatementClientV1.java:497)"
    "com.facebook.presto.jdbc.internal.client.StatementClientV1.advance(StatementClientV1.java:420)"
    "com.facebook.presto.jdbc.PrestoResultSet.getColumns(PrestoResultSet.java:1743)"
    "com.facebook.presto.jdbc.PrestoResultSet.<init>(PrestoResultSet.java:121)"
    "com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:272)"
    "com.facebook.presto.jdbc.PrestoStatement.execute(PrestoStatement.java:230)"
    "com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75)"
    "--> driver.sql_jdbc.execute$fn__52357.invokeStatic(execute.clj:368)"
    "driver.sql_jdbc.execute$fn__52357.invoke(execute.clj:366)"
    "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invokeStatic(execute.clj:376)"
    "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invoke(execute.clj:373)"
    "driver.sql_jdbc.execute$execute_reducible_query$fn__52437.invoke(execute.clj:502)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:501)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:496)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
    "driver.sql_jdbc$fn__85100.invokeStatic(sql_jdbc.clj:54)"
    "driver.sql_jdbc$fn__85100.invoke(sql_jdbc.clj:52)"
    "query_processor.context$executef.invokeStatic(context.clj:59)"
    "query_processor.context$executef.invoke(context.clj:48)"
    "query_processor.context.default$default_runf.invokeStatic(default.clj:68)"
    "query_processor.context.default$default_runf.invoke(default.clj:66)"
    "query_processor.context$runf.invokeStatic(context.clj:45)"
    "query_processor.context$runf.invoke(context.clj:39)"
    "query_processor.reducible$pivot.invokeStatic(reducible.clj:34)"
    "query_processor.reducible$pivot.invoke(reducible.clj:31)"
    "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__49090.invoke(mbql_to_native.clj:25)"
    "query_processor.middleware.check_features$check_features$fn__49576.invoke(check_features.clj:39)"
    "query_processor.middleware.limit$limit$fn__47463.invoke(limit.clj:37)"
    "query_processor.middleware.cache$maybe_return_cached_results$fn__49950.invoke(cache.clj:204)"
    ...
    "query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__49076.invoke(results_metadata.clj:147)"
    "query_processor.middleware.constraints$add_default_userland_constraints$fn__47796.invoke(constraints.clj:42)"
    "query_processor.middleware.process_userland_query$process_userland_query$fn__50085.invoke(process_userland_query.clj:146)"
    "query_processor.middleware.catch_exceptions$catch_exceptions$fn__50396.invoke(catch_exceptions.clj:169)"
    "query_processor.reducible$async_qp$qp_STAR___42500$thunk__42501.invoke(reducible.clj:103)"
    "query_processor.reducible$async_qp$qp_STAR___42500.invoke(reducible.clj:109)"
    "query_processor.reducible$sync_qp$qp_STAR___42509$fn__42512.invoke(reducible.clj:135)"
    "query_processor.reducible$sync_qp$qp_STAR___42509.invoke(reducible.clj:134)"
    "query_processor$process_userland_query.invokeStatic(query_processor.clj:243)"
    "query_processor$process_userland_query.doInvoke(query_processor.clj:239)"
    "query_processor$fn__51419$process_query_and_save_execution_BANG___51428$fn__51431.invoke(query_processor.clj:255)"
    "query_processor$fn__51419$process_query_and_save_execution_BANG___51428.invoke(query_processor.clj:247)"
    "query_processor$fn__51463$process_query_and_save_with_max_results_constraints_BANG___51472$fn__51475.invoke(query_processor.clj:267)"
    "query_processor$fn__51463$process_query_and_save_with_max_results_constraints_BANG___51472.invoke(query_processor.clj:260)"
    "api.dataset$run_query_async$fn__57811.invoke(dataset.clj:64)"
    "query_processor.streaming$streaming_response_STAR_$fn__38058$fn__38059.invoke(streaming.clj:148)"
    "query_processor.streaming$streaming_response_STAR_$fn__38058.invoke(streaming.clj:147)"
    "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:65)"
    "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:63)"
    "async.streaming_response$do_f_async$fn__25229.invoke(streaming_response.clj:84)"]}
  {:status :failed,
  :class java.sql.SQLException,
  :error "Error executing query",
  :stacktrace
  ["com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:307)"
    "com.facebook.presto.jdbc.PrestoStatement.execute(PrestoStatement.java:230)"
    "com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75)"
    "--> driver.sql_jdbc.execute$fn__52357.invokeStatic(execute.clj:368)"
    "driver.sql_jdbc.execute$fn__52357.invoke(execute.clj:366)"
    "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invokeStatic(execute.clj:376)"
    "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invoke(execute.clj:373)"
    "driver.sql_jdbc.execute$execute_reducible_query$fn__52437.invoke(execute.clj:502)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:501)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:496)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
    "driver.sql_jdbc$fn__85100.invokeStatic(sql_jdbc.clj:54)"
    "driver.sql_jdbc$fn__85100.invoke(sql_jdbc.clj:52)"
    "query_processor.context$executef.invokeStatic(context.clj:59)"
    "query_processor.context$executef.invoke(context.clj:48)"
    "query_processor.context.default$default_runf.invokeStatic(default.clj:68)"
    "query_processor.context.default$default_runf.invoke(default.clj:66)"
    "query_processor.context$runf.invokeStatic(context.clj:45)"
    "query_processor.context$runf.invoke(context.clj:39)"
    "query_processor.reducible$pivot.invokeStatic(reducible.clj:34)"
    "query_processor.reducible$pivot.invoke(reducible.clj:31)"
    "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__49090.invoke(mbql_to_native.clj:25)"
    "query_processor.middleware.check_features$check_features$fn__49576.invoke(check_features.clj:39)"
    "query_processor.middleware.limit$limit$fn__47463.invoke(limit.clj:37)"
    "query_processor.middleware.cache$maybe_return_cached_results$fn__49950.invoke(cache.clj:204)"
    "query_processor.middleware.optimize_temporal_filters$optimize_temporal_filters$fn__50943.invoke(optimize_temporal_filters.clj:204)"
    "query_processor.middleware.validate_temporal_bucketing$validate_temporal_bucketing$fn__50987.invoke(validate_temporal_bucketing.clj:50)"
    "query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values$fn__49147.invoke(auto_parse_filter_values.clj:43)"
    "query_processor.middleware.wrap_value_literals$wrap_value_literals$fn__39249.invoke(wrap_value_literals.clj:161)"
    "query_processor.middleware.annotate$add_column_info$fn__43680.invoke(annotate.clj:615)"
    "query_processor.middleware.permissions$check_query_permissions$fn__45618.invoke(permissions.clj:108)"
    "query_processor.middleware.pre_alias_aggregations$pre_alias_aggregations$fn__50127.invoke(pre_alias_aggregations.clj:40)"
    "query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__46016.invoke(cumulative_aggregations.clj:60)"
    "query_processor.middleware.visualization_settings$update_viz_settings$fn__45954.invoke(visualization_settings.clj:63)"
    "query_processor.middleware.resolve_joined_fields$resolve_joined_fields$fn__47061.invoke(resolve_joined_fields.clj:102)"
    "query_processor.middleware.resolve_joins$resolve_joins$fn__50713.invoke(resolve_joins.clj:171)"
    "query_processor.middleware.add_implicit_joins$add_implicit_joins$fn__50249.invoke(add_implicit_joins.clj:190)"
    "query_processor.middleware.large_int_id$convert_id_to_string$fn__47080.invoke(large_int_id.clj:59)"
    "query_processor.middleware.format_rows$format_rows$fn__50301.invoke(format_rows.clj:74)"
    "query_processor.middleware.add_default_temporal_unit$add_default_temporal_unit$fn__46452.invoke(add_default_temporal_unit.clj:23)"
    "query_processor.middleware.desugar$desugar$fn__45927.invoke(desugar.clj:21)"
    "query_processor.middleware.binning$update_binning_strategy$fn__39149.invoke(binning.clj:229)"
    "query_processor.middleware.resolve_fields$resolve_fields$fn__45261.invoke(resolve_fields.clj:34)"
    "query_processor.middleware.add_dimension_projections$add_remapping$fn__49502.invoke(add_dimension_projections.clj:312)"
    "query_processor.middleware.add_implicit_clauses$add_implicit_clauses$fn__49799.invoke(add_implicit_clauses.clj:147)"
    ...
    "query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__47778.invoke(add_rows_truncated.clj:35)"
    "query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__49076.invoke(results_metadata.clj:147)"
    "query_processor.middleware.constraints$add_default_userland_constraints$fn__47796.invoke(constraints.clj:42)"
    "query_processor.middleware.process_userland_query$process_userland_query$fn__50085.invoke(process_userland_query.clj:146)"
    "query_processor.middleware.catch_exceptions$catch_exceptions$fn__50396.invoke(catch_exceptions.clj:169)"
    "query_processor.reducible$async_qp$qp_STAR___42500$thunk__42501.invoke(reducible.clj:103)"
    "query_processor.reducible$async_qp$qp_STAR___42500.invoke(reducible.clj:109)"
    "query_processor.reducible$sync_qp$qp_STAR___42509$fn__42512.invoke(reducible.clj:135)"
    "query_processor.reducible$sync_qp$qp_STAR___42509.invoke(reducible.clj:134)"
    "query_processor$process_userland_query.invokeStatic(query_processor.clj:243)"
    "query_processor$process_userland_query.doInvoke(query_processor.clj:239)"
    "query_processor$fn__51419$process_query_and_save_execution_BANG___51428$fn__51431.invoke(query_processor.clj:255)"
    "query_processor$fn__51419$process_query_and_save_execution_BANG___51428.invoke(query_processor.clj:247)"
    "query_processor$fn__51463$process_query_and_save_with_max_results_constraints_BANG___51472$fn__51475.invoke(query_processor.clj:267)"
    "query_processor$fn__51463$process_query_and_save_with_max_results_constraints_BANG___51472.invoke(query_processor.clj:260)"
    "api.dataset$run_query_async$fn__57811.invoke(dataset.clj:64)"
    "query_processor.streaming$streaming_response_STAR_$fn__38058$fn__38059.invoke(streaming.clj:148)"
    "query_processor.streaming$streaming_response_STAR_$fn__38058.invoke(streaming.clj:147)"
    "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:65)"
    "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:63)"
    "async.streaming_response$do_f_async$fn__25229.invoke(streaming_response.clj:84)"],
  :error_type :invalid-query,
  :ex-data
  {:sql
    "-- Metabase:: userID: 2 queryType: native queryHash: c8453ea72b05e18ca86b1f92e53199b906768c54a40b6e23d360d03197dfa5ab\nselect id from public.products\nlimit 1",
    :params nil,
    :type :invalid-query}}],
:error_type :invalid-query,
:json_query
{:type "native",
  :native {:query "select id from public.products\nlimit 1", :template-tags {}},
  :database 28,
  :parameters [],
  :middleware {:js-int-to-string? true, :add-default-userland-constraints? true}},
:status :failed,
:class java.lang.IllegalArgumentException,
:stacktrace
["java.base/java.util.Base64$Decoder.decode0(Unknown Source)"
  "java.base/java.util.Base64$Decoder.decode(Unknown Source)"
  "java.base/java.util.Base64$Decoder.decode(Unknown Source)"
  "com.facebook.presto.jdbc.internal.client.FixJsonDataUtils.fixValue(FixJsonDataUtils.java:195)"
  "com.facebook.presto.jdbc.internal.client.FixJsonDataUtils.fixData(FixJsonDataUtils.java:79)"
  "com.facebook.presto.jdbc.internal.client.QueryResults.<init>(QueryResults.java:70)"
  "jdk.internal.reflect.GeneratedConstructorAccessor590.newInstance(Unknown Source)"
  "java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)"
  "java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)"
  "com.facebook.presto.jdbc.internal.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:124)"
  "com.facebook.presto.jdbc.internal.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:283)"
  "com.facebook.presto.jdbc.internal.jackson.databind.deser.ValueInstantiator.createFromObjectWith(ValueInstantiator.java:229)"
  "com.facebook.presto.jdbc.internal.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:198)"
  "com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:488)"
  "com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1287)"
  "com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326)"
  "com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)"
  "com.facebook.presto.jdbc.internal.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1719)"
  "com.facebook.presto.jdbc.internal.jackson.databind.ObjectReader.readValue(ObjectReader.java:1261)"
  "com.facebook.presto.jdbc.internal.com.facebook.airlift.json.JsonCodec.fromJson(JsonCodec.java:137)"
  "com.facebook.presto.jdbc.internal.client.JsonResponse.<init>(JsonResponse.java:67)"
  "com.facebook.presto.jdbc.internal.client.JsonResponse.execute(JsonResponse.java:144)"
  "com.facebook.presto.jdbc.internal.client.StatementClientV1.advance(StatementClientV1.java:406)"
  "com.facebook.presto.jdbc.PrestoResultSet.getColumns(PrestoResultSet.java:1743)"
  "com.facebook.presto.jdbc.PrestoResultSet.<init>(PrestoResultSet.java:121)"
  "com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:272)"
  "com.facebook.presto.jdbc.PrestoStatement.execute(PrestoStatement.java:230)"
  "com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75)"
  "--> driver.sql_jdbc.execute$fn__52357.invokeStatic(execute.clj:368)"
  "driver.sql_jdbc.execute$fn__52357.invoke(execute.clj:366)"
  "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invokeStatic(execute.clj:376)"
  "driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invoke(execute.clj:373)"
  "driver.sql_jdbc.execute$execute_reducible_query$fn__52437.invoke(execute.clj:502)"
  "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:501)"
  "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
  "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:496)"
  "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
  "driver.sql_jdbc$fn__85100.invokeStatic(sql_jdbc.clj:54)"
  "driver.sql_jdbc$fn__85100.invoke(sql_jdbc.clj:52)"
  "query_processor.context$executef.invokeStatic(context.clj:59)"
  "query_processor.context$executef.invoke(context.clj:48)"
  "query_processor.context.default$default_runf.invokeStatic(default.clj:68)"
  ...
  "api.dataset$run_query_async$fn__57811.invoke(dataset.clj:64)"
  "query_processor.streaming$streaming_response_STAR_$fn__38058$fn__38059.invoke(streaming.clj:148)"
  "query_processor.streaming$streaming_response_STAR_$fn__38058.invoke(streaming.clj:147)"
  "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:65)"
  "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:63)"
  "async.streaming_response$do_f_async$fn__25229.invoke(streaming_response.clj:84)"],
:card_id nil,
:context :ad-hoc,
:error "Error executing query",
:row_count 0,
:running_time 0,
:data {:rows [], :cols []}}

@alexpusch
3. Post Trino information, version etc.
4. And check Trino logs for more details

It's borking because of some base64 decoding, but I cannot really see why this is happening.

Trino version is 364

I do not see any additional hints in the Trino logs

Any other steps I can take to try to debug this?

@alexpusch Try using DBeaver.io with the PrestoDB 0.260 driver, which is the same as Metabase.

query via DBeaver works as expected.
In addition, Trino logs shows Metabase run queries as successful. It seems that the error originates at query response on Metabases side

@alexpusch Please post screenshot of the connection test, so it shows all the version information.
And can you include the entire query response, as well as the query response for select 1 ?

image

The query responses just look normal in DBeavers UI. Is there some raw output that will help you?

A relevant find - querying against big query connector does work with the new driver

@alexpusch I don't know where the problem is. You will have to provide steps-to-reproduce on datasets that everyone has access to or try debugging the query working/failing responses.

I said that you should use the PrestoDB JDBC 0.260 driver in DBeaver, since that is what Metabase is also using.
You are comparing apples to oranges by using a completely different driver.

I don't understand what you mean about BigQuery. Are you talking about anything related to Trino, if yes, then it's relevant, if no, then it's not relevant at all.

But if it works with the old Presto driver in Metabase, then just use that and hope that we'll figure out what the problem is before it's being deprecated.

@flamber I understand, I'll try to create a reproducible environment.
big query - I meant that when querying Trino big query connector the query works.

Thank for the help!

@flamber

I have created a simple env that shows the issue - https://github.com/alexpusch/metabase-trino-postgres-issue
It contains a simple docker compose env with Trino, Postgres, and Metabase. Instructions inside

Turns out the query errors out for field of type uuid.

There is an additional issue I've noticed with the Trino integration - in the tables data model (admin - > data model) some, or all, fields have "no semantic type" which makes it harder to create fields filters in metabase questions

@alexpusch Both the new and old Presto driver are using the same type inference:
https://github.com/metabase/metabase/blob/master/modules/drivers/presto-common/src/metabase/driver/presto_common.clj#L25
So interesting if this fails specifically for Trino with the new Presto driver.

I guess you can reproduce with just running this in Metabase?
select 'fcb8284c-1bd4-4d50-b5df-09a091b01d8c'::uuid as myuuid

But you can create an issue for this, since you have now fully debugged the problem.

The Data Model gets set based on the metadata returned from the database. Again, I don't think this is anyway related to Trino or the Metabase old/new Presto drivers.