Fix #801: Use list() instead of c() to preserve integer type in performanceTable#802
Open
eddy-ccc wants to merge 1 commit intoOHDSI:developfrom
Open
Fix #801: Use list() instead of c() to preserve integer type in performanceTable#802eddy-ccc wants to merge 1 commit intoOHDSI:developfrom
eddy-ccc wants to merge 1 commit intoOHDSI:developfrom
Conversation
…performanceTable The c() function coerces all elements to the same type. Since delta, start, and endTime are numeric (double/FLOAT64), c() converts the integer analysisId to numeric as well, even though it was explicitly cast to integer. When DatabaseConnector inserts this data into BigQuery, it sends FLOAT64 parameters, but the achilles_performance.analysis_id column is INT64, causing BigQuery to reject the insert. Using list() preserves each element's original type, keeping analysisId as integer (INT64) for proper BigQuery compatibility.
|
+1 on this PR. This fix is also needed to run DbDiagnostics::executeDbProfile on BigQuery. Thank you @eddy-ccc for posting the fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #801
Problem
BigQuery rejects
achilles_performanceinsert becauseanalysis_idis sent as FLOAT64 instead of INT64, returning error:Root Cause
Line 459 uses
c()which coerces all elements to the same type. Sincedelta,start, andendTimearenumeric (double),
c()converts the integeranalysisIdto numeric.Solution
Changed
c()tolist()which preserves each element's original type.Tested and confirmed working on BigQuery with DatabaseConnector v7.0.0.