Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when reading a null Timestamp #17

Closed
kaklakariada opened this issue Jan 12, 2022 · 0 comments · Fixed by #18
Closed

NullPointerException when reading a null Timestamp #17

kaklakariada opened this issue Jan 12, 2022 · 0 comments · Fixed by #18
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kaklakariada
Copy link
Collaborator

kaklakariada commented Jan 12, 2022

When reading a null value from a TIMESTAMP column the driver throws a NullPointerException:

2022-01-12 16:06:21,131 WARN sync.util :: Error fingerprinting Table 23 'EXASOL_STATS.PROFILE_HIDDEN_CURRENT_USER_LAST_DAY'
clojure.lang.ExceptionInfo: Error reducing result rows {:type :qp}
	at metabase.query_processor.context.default$default_reducef$fn__42412.invoke(default.clj:60)
	at metabase.query_processor.context.default$default_reducef.invokeStatic(default.clj:57)
	at metabase.query_processor.context.default$default_reducef.invoke(default.clj:48)
	at metabase.query_processor.context$reducef.invokeStatic(context.clj:69)
	at metabase.query_processor.context$reducef.invoke(context.clj:62)
	at metabase.query_processor.context.default$default_runf$respond_STAR___42416.invoke(default.clj:69)
	at metabase.driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:509)
	at metabase.driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)
	at metabase.driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:496)
	at metabase.driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)
	at metabase.driver.sql_jdbc$fn__85172.invokeStatic(sql_jdbc.clj:54)
	at metabase.driver.sql_jdbc$fn__85172.invoke(sql_jdbc.clj:52)
	at clojure.lang.MultiFn.invoke(MultiFn.java:244)
	at metabase.query_processor.context$executef.invokeStatic(context.clj:59)
	at metabase.query_processor.context$executef.invoke(context.clj:48)
	at metabase.query_processor.context.default$default_runf.invokeStatic(default.clj:68)
	at metabase.query_processor.context.default$default_runf.invoke(default.clj:66)
	at metabase.query_processor.context$runf.invokeStatic(context.clj:45)
	at metabase.query_processor.context$runf.invoke(context.clj:39)
	at metabase.query_processor.reducible$pivot.invokeStatic(reducible.clj:34)
	at metabase.query_processor.reducible$pivot.invoke(reducible.clj:31)
	at metabase.query_processor.middleware.mbql_to_native$mbql__GT_native$fn__49144.invoke(mbql_to_native.clj:25)
	at metabase.query_processor.middleware.check_features$check_features$fn__49630.invoke(check_features.clj:39)
	at metabase.query_processor.middleware.limit$limit$fn__47517.invoke(limit.clj:37)
	at metabase.query_processor.middleware.cache$maybe_return_cached_results$fn__50004.invoke(cache.clj:204)
	at metabase.query_processor.middleware.optimize_temporal_filters$optimize_temporal_filters$fn__50997.invoke(optimize_temporal_filters.clj:204)
	at metabase.query_processor.middleware.validate_temporal_bucketing$validate_temporal_bucketing$fn__51041.invoke(validate_temporal_bucketing.clj:50)
	at metabase.query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values$fn__49201.invoke(auto_parse_filter_values.clj:43)
	at metabase.query_processor.middleware.wrap_value_literals$wrap_value_literals$fn__39249.invoke(wrap_value_literals.clj:161)
	at metabase.query_processor.middleware.annotate$add_column_info$fn__43680.invoke(annotate.clj:620)
	at metabase.query_processor.middleware.permissions$check_query_permissions$fn__45618.invoke(permissions.clj:108)
	at metabase.query_processor.middleware.pre_alias_aggregations$pre_alias_aggregations$fn__50181.invoke(pre_alias_aggregations.clj:40)
	at metabase.query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__46016.invoke(cumulative_aggregations.clj:60)
	at metabase.query_processor.middleware.visualization_settings$update_viz_settings$fn__45954.invoke(visualization_settings.clj:63)
	at metabase.query_processor.middleware.resolve_joined_fields$resolve_joined_fields$fn__47115.invoke(resolve_joined_fields.clj:102)
	at metabase.query_processor.middleware.resolve_joins$resolve_joins$fn__50767.invoke(resolve_joins.clj:171)
	at metabase.query_processor.middleware.add_implicit_joins$add_implicit_joins$fn__50303.invoke(add_implicit_joins.clj:190)
	at metabase.query_processor.middleware.large_int_id$convert_id_to_string$fn__47134.invoke(large_int_id.clj:59)
	at metabase.query_processor.middleware.format_rows$format_rows$fn__50355.invoke(format_rows.clj:74)
	at metabase.query_processor.middleware.add_default_temporal_unit$add_default_temporal_unit$fn__46506.invoke(add_default_temporal_unit.clj:23)
	at metabase.query_processor.middleware.desugar$desugar$fn__45927.invoke(desugar.clj:21)
	at metabase.query_processor.middleware.binning$update_binning_strategy$fn__39149.invoke(binning.clj:229)
	at metabase.query_processor.middleware.resolve_fields$resolve_fields$fn__45261.invoke(resolve_fields.clj:34)
	at metabase.query_processor.middleware.add_dimension_projections$add_remapping$fn__49556.invoke(add_dimension_projections.clj:314)
	at metabase.query_processor.middleware.add_implicit_clauses$add_implicit_clauses$fn__49853.invoke(add_implicit_clauses.clj:147)
	at metabase.query_processor.middleware.upgrade_field_literals$upgrade_field_literals$fn__47502.invoke(upgrade_field_literals.clj:40)
	at metabase.query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__46883.invoke(add_source_metadata.clj:123)
	at metabase.query_processor.middleware.reconcile_breakout_and_order_by_bucketing$reconcile_breakout_and_order_by_bucketing$fn__50103.invoke(reconcile_breakout_and_order_by_bucketing.clj:100)
	at metabase.query_processor.middleware.auto_bucket_datetimes$auto_bucket_datetimes$fn__48453.invoke(auto_bucket_datetimes.clj:147)
	at metabase.query_processor.middleware.resolve_source_table$resolve_source_tables$fn__45242.invoke(resolve_source_table.clj:45)
	at metabase.query_processor.middleware.parameters$substitute_parameters$fn__48107.invoke(parameters.clj:111)
	at metabase.query_processor.middleware.resolve_referenced$resolve_referenced_card_resources$fn__45315.invoke(resolve_referenced.clj:79)
	at metabase.query_processor.middleware.expand_macros$expand_macros$fn__51425.invoke(expand_macros.clj:184)
	at metabase.query_processor.middleware.add_timezone_info$add_timezone_info$fn__47886.invoke(add_timezone_info.clj:15)
	at metabase.query_processor.middleware.splice_params_in_response$splice_params_in_response$fn__50370.invoke(splice_params_in_response.clj:32)
	at metabase.query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__49864$fn__49868.invoke(resolve_database_and_driver.clj:31)
	at metabase.driver$do_with_driver.invokeStatic(driver.clj:60)
	at metabase.driver$do_with_driver.invoke(driver.clj:56)
	at metabase.query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__49864.invoke(resolve_database_and_driver.clj:25)
	at metabase.query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__45865.invoke(fetch_source_query.clj:274)
	at metabase.query_processor.middleware.store$initialize_store$fn__46053$fn__46054.invoke(store.clj:11)
	at metabase.query_processor.store$do_with_store.invokeStatic(store.clj:42)
	at metabase.query_processor.store$do_with_store.invoke(store.clj:38)
	at metabase.query_processor.middleware.store$initialize_store$fn__46053.invoke(store.clj:10)
	at metabase.query_processor.middleware.validate$validate_query$fn__50153.invoke(validate.clj:10)
	at metabase.query_processor.middleware.normalize_query$normalize$fn__50160.invoke(normalize_query.clj:22)
	at metabase.query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__47832.invoke(add_rows_truncated.clj:35)
	at metabase.query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__49130.invoke(results_metadata.clj:143)
	at metabase.query_processor.reducible$async_qp$qp_STAR___42500$thunk__42501.invoke(reducible.clj:103)
	at metabase.query_processor.reducible$async_qp$qp_STAR___42500.invoke(reducible.clj:109)
	at metabase.query_processor.reducible$sync_qp$qp_STAR___42509$fn__42512.invoke(reducible.clj:135)
	at metabase.query_processor.reducible$sync_qp$qp_STAR___42509.invoke(reducible.clj:134)
	at clojure.lang.AFn.applyToHelper(AFn.java:156)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$apply.invoke(core.clj:662)
	at metabase.query_processor$process_query.invokeStatic(query_processor.clj:152)
	at metabase.query_processor$process_query.doInvoke(query_processor.clj:146)
	at clojure.lang.RestFn.invoke(RestFn.java:423)
	at clojure.lang.Var.invoke(Var.java:388)
	at metabase.db.metadata_queries$fn__69432$table_rows_sample__69441$fn__69444.invoke(metadata_queries.clj:144)
	at metabase.db.metadata_queries$fn__69432$table_rows_sample__69441.invoke(metadata_queries.clj:131)
	at metabase.sync.analyze.fingerprint$fn__69499$fingerprint_table_BANG___69504$fn__69505.invoke(fingerprint.clj:66)
	at metabase.sync.analyze.fingerprint$fn__69499$fingerprint_table_BANG___69504.invoke(fingerprint.clj:46)
	at metabase.sync.analyze.fingerprint$fn__69675$fingerprint_fields_BANG___69680$fn__69681$fn__69682.invoke(fingerprint.clj:180)
	at metabase.sync.util$do_with_error_handling.invokeStatic(util.clj:156)
	at metabase.sync.util$do_with_error_handling.invoke(util.clj:149)
	at metabase.sync.analyze.fingerprint$fn__69675$fingerprint_fields_BANG___69680$fn__69681.invoke(fingerprint.clj:178)
	at metabase.sync.analyze.fingerprint$fn__69675$fingerprint_fields_BANG___69680.invoke(fingerprint.clj:174)
	at metabase.sync.analyze.fingerprint$fn__69710$fingerprint_fields_for_db_BANG__STAR___69719$fn__69722$fn__69723$fn__69724.invoke(fingerprint.clj:204)
	at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
	at clojure.core$reduce.invokeStatic(core.clj:6829)
	at clojure.core$reduce.invoke(core.clj:6812)
	at metabase.sync.analyze.fingerprint$fn__69710$fingerprint_fields_for_db_BANG__STAR___69719$fn__69722$fn__69723.invoke(fingerprint.clj:200)
	at metabase.query_processor.store$do_with_store.invokeStatic(store.clj:44)
	at metabase.query_processor.store$do_with_store.invoke(store.clj:38)
	at metabase.sync.analyze.fingerprint$fn__69710$fingerprint_fields_for_db_BANG__STAR___69719$fn__69722.invoke(fingerprint.clj:197)
	at metabase.sync.analyze.fingerprint$fn__69710$fingerprint_fields_for_db_BANG__STAR___69719.invoke(fingerprint.clj:186)
	at metabase.sync.analyze.fingerprint$fn__69710$fingerprint_fields_for_db_BANG__STAR___69719$fn__69720.invoke(fingerprint.clj:191)
	at metabase.sync.analyze.fingerprint$fn__69710$fingerprint_fields_for_db_BANG__STAR___69719.invoke(fingerprint.clj:186)
	at metabase.sync.analyze.fingerprint$fn__69752$fingerprint_fields_for_db_BANG___69757$fn__69758.invoke(fingerprint.clj:218)
	at metabase.sync.analyze.fingerprint$fn__69752$fingerprint_fields_for_db_BANG___69757.invoke(fingerprint.clj:212)
	at metabase.sync.analyze$make_analyze_steps$fn__70065.invoke(analyze.clj:104)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$apply.invoke(core.clj:662)
	at metabase.sync.util$fn__40096$run_step_with_metadata__40101$fn__40105$fn__40107.doInvoke(util.clj:360)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at metabase.sync.util$with_start_and_finish_logging_STAR_.invokeStatic(util.clj:99)
	at metabase.sync.util$with_start_and_finish_logging_STAR_.invoke(util.clj:93)
	at metabase.sync.util$with_start_and_finish_debug_logging.invokeStatic(util.clj:116)
	at metabase.sync.util$with_start_and_finish_debug_logging.invoke(util.clj:113)
	at metabase.sync.util$fn__40096$run_step_with_metadata__40101$fn__40105.invoke(util.clj:355)
	at metabase.sync.util$fn__40096$run_step_with_metadata__40101.invoke(util.clj:350)
	at metabase.sync.util$fn__40287$run_sync_operation__40292$fn__40293$fn__40301.invoke(util.clj:451)
	at metabase.sync.util$fn__40287$run_sync_operation__40292$fn__40293.invoke(util.clj:449)
	at metabase.sync.util$fn__40287$run_sync_operation__40292.invoke(util.clj:443)
	at metabase.sync.analyze$fn__70077$analyze_db_BANG___70082$fn__70083$fn__70084.invoke(analyze.clj:121)
	at metabase.sync.util$do_with_error_handling.invokeStatic(util.clj:156)
	at metabase.sync.util$do_with_error_handling.invoke(util.clj:149)
	at clojure.core$partial$fn__5859.invoke(core.clj:2634)
	at metabase.driver$fn__24548.invokeStatic(driver.clj:555)
	at metabase.driver$fn__24548.invoke(driver.clj:555)
	at clojure.lang.MultiFn.invoke(MultiFn.java:239)
	at metabase.sync.util$sync_in_context$fn__40008.invoke(util.clj:135)
	at metabase.sync.util$with_db_logging_disabled$fn__40005.invoke(util.clj:126)
	at metabase.sync.util$with_start_and_finish_logging_STAR_.invokeStatic(util.clj:99)
	at metabase.sync.util$with_start_and_finish_logging_STAR_.invoke(util.clj:93)
	at metabase.sync.util$with_start_and_finish_logging$fn__39994.invoke(util.clj:111)
	at metabase.sync.util$with_sync_events$fn__39989.invoke(util.clj:85)
	at metabase.sync.util$with_duplicate_ops_prevented$fn__39980.invoke(util.clj:64)
	at metabase.sync.util$do_sync_operation.invokeStatic(util.clj:177)
	at metabase.sync.util$do_sync_operation.invoke(util.clj:174)
	at metabase.sync.analyze$fn__70077$analyze_db_BANG___70082$fn__70083.invoke(analyze.clj:118)
	at metabase.sync.analyze$fn__70077$analyze_db_BANG___70082.invoke(analyze.clj:113)
	at metabase.api.database$fn__77226$fn__77228.invoke(database.clj:653)
	at clojure.core$binding_conveyor_fn$fn__5772.invoke(core.clj:2034)
	at clojure.lang.AFn.call(AFn.java:18)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NullPointerException
	at metabase.driver.exasol$fn__632$fn__633.invoke(exasol.clj:84)
	at clojure.core$juxt$fn__5844$fn__5845.invoke(core.clj:2612)
	at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:63)
	at clojure.core$reduce1.invokeStatic(core.clj:944)
	at clojure.core$juxt$fn__5844.invoke(core.clj:2611)
	at metabase.driver.sql_jdbc.execute$row_thunk$row_thunk_STAR___52477.invoke(execute.clj:458)
	at metabase.query_processor.reducible$reducible_rows$reify__42516.reduce(reducible.clj:158)
	at clojure.core$transduce.invokeStatic(core.clj:6885)
	at clojure.core$transduce.invokeStatic(core.clj:6881)
	at clojure.core$transduce.invoke(core.clj:6872)
	at metabase.query_processor.context.default$default_reducef$fn__42412.invoke(default.clj:58)
	... 142 more

@kaklakariada kaklakariada added bug Something isn't working source:exasol labels Jan 12, 2022
@kaklakariada kaklakariada added this to the MVP milestone Jan 12, 2022
@kaklakariada kaklakariada changed the title NullPointerException when analyzing Exasol DemoDB NullPointerException when reading a null Timestamp Jan 13, 2022
@kaklakariada kaklakariada self-assigned this Jan 13, 2022
kaklakariada added a commit that referenced this issue Jan 13, 2022
…one (#18)

* #17 Don't fail reading null TIMESTAMP, convert Timestamp to UTC timezone

* Remove skipped tests that are fixed now

* Refactoring: replace custom methods with use-legacy-classes-for-read-and-set

* Update changelog

* Apply suggestions from code review

Co-authored-by: jakobbraun <jakob.braun@posteo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant