Can't change Timestamp type to other than Day

When summarising by the Timestamp, we previously summarised mostly with monthly timestamps. However, recently it's not possible anymore to select anything else than daily. Our existing questions that we had made before with a monthly timestamp summarization are broken as well now.

See attached image:

If there is another way to do this, please let me know!

Hi @tijn.daelen
Post "Diagnostic Info" from Admin > Troubleshooting.
It sounds like it's a new problem, so when did that start?

@flamber I believe this started to happen in the last 2-3 weeks

@tijn.daelen Post "Diagnostic Info" from Admin > Troubleshooting.

@flamber

{
  "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.55 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": "4.19.112+",
    "user.language": "en",
    "user.timezone": "UTC"
  },
  "metabase-info": {
    "databases": [
      "druid",
      "postgres",
      "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-11-09",
      "tag": "v0.41.2",
      "branch": "release-x.41.x",
      "hash": "ad599fd"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

@tijn.daelen Try running the actual question, so you see results. This should update the fingerprinting information, which is used, when you try to create a nested question.
But since you say 2-3 weeks ago, then that feels like the same time you upgraded. Which version did you upgrade from?

@flamber Thank you for jumping on this so quickly, I appreciate the help!

When I try to edit the existing question that has the monthly timestamp, it apparently works again if I remove the timestamp filter. However, when I remove the "summarize by monthly timestamp" and try to add it again, it still only allows me to add a daily one. Here's a screenrecording: https://storage.googleapis.com/flowaihosting/metabasebug.mov

I'm not sure what version we upgraded from, since probably one of my colleagues did that. I'll ask around and get back to you once I know more about that.

@tijn.daelen Can you post the full stacktrace, when you see the error, from Admin > Troubleshooting > Logs.
I've never seen this before.

@flamber
["--> driver.druid.query_processor$mbql__GT_native.invokeStatic(query_processor.clj:1201)"
"driver.druid.query_processor$mbql__GT_native.invoke(query_processor.clj:1191)"
"driver.druid$fn__87961.invokeStatic(druid.clj:30)"
"driver.druid$fn__87961.invoke(druid.clj:28)"
"query_processor.middleware.mbql_to_native$query__GT_native_form.invokeStatic(mbql_to_native.clj:14)"
"query_processor.middleware.mbql_to_native$query__GT_native_form.invoke(mbql_to_native.clj:9)"
"query_processor.middleware.mbql_to_native$mbql__GT_native$fn__49089.invoke(mbql_to_native.clj:22)"
"query_processor.middleware.check_features$check_features$fn__49575.invoke(check_features.clj:39)"
"query_processor.middleware.limit$limit$fn__47462.invoke(limit.clj:37)"
"query_processor.middleware.cache$maybe_return_cached_results$fn__49949.invoke(cache.clj:204)"
"query_processor.middleware.optimize_temporal_filters$optimize_temporal_filters$fn__50942.invoke(optimize_temporal_filters.clj:204)"
"query_processor.middleware.validate_temporal_bucketing$validate_temporal_bucketing$fn__50986.invoke(validate_temporal_bucketing.clj:50)"
"query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values$fn__49146.invoke(auto_parse_filter_values.clj:43)"
"query_processor.middleware.wrap_value_literals$wrap_value_literals$fn__39248.invoke(wrap_value_literals.clj:161)"
"query_processor.middleware.annotate$add_column_info$fn__43679.invoke(annotate.clj:615)"
"query_processor.middleware.permissions$check_query_permissions$fn__45617.invoke(permissions.clj:108)"
"query_processor.middleware.pre_alias_aggregations$pre_alias_aggregations$fn__50126.invoke(pre_alias_aggregations.clj:40)"
"query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__46015.invoke(cumulative_aggregations.clj:60)"
"query_processor.middleware.visualization_settings$update_viz_settings$fn__45953.invoke(visualization_settings.clj:63)"
"query_processor.middleware.resolve_joined_fields$resolve_joined_fields$fn__47060.invoke(resolve_joined_fields.clj:102)"
"query_processor.middleware.resolve_joins$resolve_joins$fn__50712.invoke(resolve_joins.clj:171)"
"query_processor.middleware.add_implicit_joins$add_implicit_joins$fn__50248.invoke(add_implicit_joins.clj:190)"
"query_processor.middleware.large_int_id$convert_id_to_string$fn__47079.invoke(large_int_id.clj:59)"
"query_processor.middleware.format_rows$format_rows$fn__50300.invoke(format_rows.clj:74)"
"query_processor.middleware.add_default_temporal_unit$add_default_temporal_unit$fn__46451.invoke(add_default_temporal_unit.clj:23)"
"query_processor.middleware.desugar$desugar$fn__45926.invoke(desugar.clj:21)"
"query_processor.middleware.binning$update_binning_strategy$fn__39148.invoke(binning.clj:229)"
"query_processor.middleware.resolve_fields$resolve_fields$fn__45260.invoke(resolve_fields.clj:34)"
"query_processor.middleware.add_dimension_projections$add_remapping$fn__49501.invoke(add_dimension_projections.clj:314)"
"query_processor.middleware.add_implicit_clauses$add_implicit_clauses$fn__49798.invoke(add_implicit_clauses.clj:147)"
"query_processor.middleware.upgrade_field_literals$upgrade_field_literals$fn__47447.invoke(upgrade_field_literals.clj:40)"
"query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__46828.invoke(add_source_metadata.clj:123)"
"query_processor.middleware.reconcile_breakout_and_order_by_bucketing$reconcile_breakout_and_order_by_bucketing$fn__50048.invoke(reconcile_breakout_and_order_by_bucketing.clj:100)"
"query_processor.middleware.auto_bucket_datetimes$auto_bucket_datetimes$fn__48398.invoke(auto_bucket_datetimes.clj:147)"
"query_processor.middleware.resolve_source_table$resolve_source_tables$fn__45241.invoke(resolve_source_table.clj:45)"
"query_processor.middleware.parameters$substitute_parameters$fn__48052.invoke(parameters.clj:111)"
"query_processor.middleware.resolve_referenced$resolve_referenced_card_resources$fn__45314.invoke(resolve_referenced.clj:79)"
"query_processor.middleware.expand_macros$expand_macros$fn__51370.invoke(expand_macros.clj:184)"
"query_processor.middleware.add_timezone_info$add_timezone_info$fn__47831.invoke(add_timezone_info.clj:15)"
"query_processor.middleware.splice_params_in_response$splice_params_in_response$fn__50315.invoke(splice_params_in_response.clj:32)"
"query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__49809$fn__49813.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__49809.invoke(resolve_database_and_driver.clj:25)"
"query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__45864.invoke(fetch_source_query.clj:274)"
"query_processor.middleware.store$initialize_store$fn__46052$fn__46053.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__46052.invoke(store.clj:10)"
"query_processor.middleware.validate$validate_query$fn__50098.invoke(validate.clj:10)"
"query_processor.middleware.normalize_query$normalize$fn__50105.invoke(normalize_query.clj:22)"
"query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__47777.invoke(add_rows_truncated.clj:35)"
"query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__49075.invoke(results_metadata.clj:147)"
"query_processor.middleware.constraints$add_default_userland_constraints$fn__47795.invoke(constraints.clj:42)"
"query_processor.middleware.process_userland_query$process_userland_query$fn__50084.invoke(process_userland_query.clj:146)"
"query_processor.middleware.catch_exceptions$catch_exceptions$fn__50395.invoke(catch_exceptions.clj:169)"
"query_processor.reducible$async_qp$qp_STAR___42499$thunk__42500.invoke(reducible.clj:103)"
"query_processor.reducible$async_qp$qp_STAR___42499$fn__42502.invoke(reducible.clj:108)"]

@tijn.daelen Okay, I cannot reproduce on Druid. Not sure what's going on.
I'll need to see metadata for the Timestamp column.
Go to Admin > Data Model > (db) > (table) > Timestamp :gear:, then the URL should end with .../123/general, where 123 is the field ID.
Then go to the URL /api/field/123 and post it here.

@flamber https://metabase.flowai.app/api/field/3811 returns this:
{"description":null,"database_type":"STRING","semantic_type":"type/CreationTime","table_id":393,"coercion_strategy":null,"table":{"description":null,"entity_type":"entity/EventTable","schema":null,"db":{"description":null,"features":["basic-aggregations","expression-aggregations","set-timezone","case-sensitivity-string-filter-options"],"cache_field_values_schedule":"0 0 0 * * ? *","timezone":null,"auto_run_queries":true,"metadata_sync_schedule":"0 0 * * * ? *","name":"Analytics Druid","caveats":null,"is_full_sync":true,"updated_at":"2021-10-05T21:31:10.139744Z","cache_ttl":null,"details":{"host":"http://druid-analytics-routers.default.svc.cluster.local","port":8088,"tunnel-enabled":false,"let-user-control-scheduling":true},"is_sample":false,"id":3,"is_on_demand":false,"options":null,"engine":"druid","refingerprint":null,"created_at":"2021-04-16T08:21:12.929316Z","points_of_interest":null},"show_in_getting_started":false,"name":"analytics.druid.thread.event","caveats":null,"updated_at":"2021-10-13T13:00:23.800949Z","entity_name":null,"active":true,"id":393,"db_id":3,"visibility_type":null,"field_order":"database","display_name":"Thread Events","created_at":"2021-04-16T08:21:13.134107Z","points_of_interest":null},"name":"timestamp","fingerprint_version":5,"has_field_values":"none","settings":null,"caveats":null,"fk_target_field_id":null,"dimensions":[],"updated_at":"2021-11-10T03:00:32.059372Z","custom_position":0,"effective_type":"type/Text","active":true,"parent_id":null,"id":3811,"last_analyzed":"2021-11-10T03:00:33.652138Z","position":0,"visibility_type":"normal","preview_display":true,"display_name":"Timestamp","database_position":10,"name_field":null,"fingerprint":{"global":{"distinct-count":1,"nil%":1.0},"type":{"type/Text":{"percent-json":0.0,"percent-url":0.0,"percent-email":0.0,"percent-state":0.0,"average-length":0.0}}},"created_at":"2021-04-16T08:21:15.228878Z","base_type":"type/Text","points_of_interest":null}

@tijn.daelen I simply don't know much about Druid, but your Timestamp column is a STRING
I don't even understand how you're able to see the granularity selector. That should not even be shown.
So my guess is that someone changed something on the database, or perhaps removed the casting in Admin > Data Model > (db) > (table) > Timestamp :gear: > Cast field as...

@flamber My colleague also reported this issue: When you go to a questions native query and do something as simple as that:
SELECT *
FROM “analytics.druid.thread.event”
WHERE __time >= CURRENT_TIMESTAMP - INTERVAL ‘1’ DAY
you have an error

@flamber Here's a screenshot of the settings for Timestamp. Anything that should be changed here?


@tijn.daelen What is the actual column type on the database for Timestamp? From what I can see, it's a string, and if that's the case, then you'll need to do casting ("Cast to a specific data type").

@flamber Changing it to the image below solved it! Thanks for all the great support.
image