-
Notifications
You must be signed in to change notification settings - Fork 7
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
Snowflake numeric type issue with Ares Exporter - Achilles::exportToAres - for CDM version 5.4 #366
Comments
I encountered the same issue when exporting data to Ares. After some investigation, I discovered that using the TRY_CAST function in Snowflake was an effective solution. By implementing TRY_CAST across all relevant scripts in the Achilles::exportToAres function, I was able to resolve the issue and ensure smooth data exports to Ares. However, it's important to note that while this solution works well for Snowflake, it may not be suitable for other databases that do not support the TRY_CAST function. This can lead to compatibility issues across different database systems. Therefore, to make the scripts work universally across all databases, a more complex fix might be necessary. Example of the modification: Original script :
Script with TRY_CAST:
Note: The reason TRY_CAST works in this context is because, as mentioned by @heschmidt04, Snowflake attempts to auto-detect data types in tables. The TRY_CAST function includes built-in error handling, allowing the script to continue executing even if type conversion fails, unlike CAST which may halt execution on errors. |
Describe the bug
Ares Exporter fails on numeric type because temp table in memory has autosensing data type conversion issue. A search on github Ares issues didn't yield anything for me if this has happened before in export.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Ares Exporter to write files to output folder.
Is there a possible work around for this part?
Screenshots
DBMS: snowflake
Error: net.snowflake.client.jdbc.SnowflakeSQLException: Numeric value '' is not recognized
Stackoverflow: https://stackoverflow.com/questions/70176093/numeric-value-is-not-recognized
The work around works because the datatype is auto sensed
-- AO_EXPORT_DENOM
-- AO_EXPORT_T1
Desktop (please complete the following information):
R version: R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20
Attached base packages:
Other attached packages:
Additional context
Files that were created from the process are these. No error.txt file in the errors directory.
Mar 15 17:06 dq-result_camel.json
Mar 15 17:06 log_DqDashboard_Snowflake-MGB-OMOP.txt -- binary file??? Not sure why.
Mar 15 17:06 dq-result.json
Mar 15 17:06 datadensity-total.csv
Mar 15 17:06 records-by-domain.csv
The text was updated successfully, but these errors were encountered: