HydrologicEngineeringCenter / HydrologicEngineeringCenter/cwms-database

TS Binary storage of irregular time series does not work

Open
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Visual Basic 6.0
Stars
4
Forks
8
Avg merge
8d 20h
Merged PRs (30d)
4

Description

Using the STORE_TS_BINARY call https://github.com/HydrologicEngineeringCenter/cwms-database/blob/47d136e6c7932a1ad8e02c1e2c6c267a08eb4ecc/schema/src/cwms/cwms_text_pkg_body.sql#L3632 to store irregular binary time series data with no existing values in the databse results in odd behavior. The binary data is successfully stored in the AT_BLOB table, but no data is stored in the AT_TSV_BINARY table. It appears the calling method used by CDA passes in a null value for the p_date_times_utc table parameter when there are no existing timestamps/data values, which means there are no timestamps for which to loop through to store the binary data in the AT_TSV_BINARY table. See https://github.com/HydrologicEngineeringCenter/cwms-database/blob/47d136e6c7932a1ad8e02c1e2c6c267a08eb4ecc/schema/src/cwms/cwms_text_pkg_body.sql#L3863 and https://github.com/HydrologicEngineeringCenter/cwms-database/blob/47d136e6c7932a1ad8e02c1e2c6c267a08eb4ecc/schema/src/cwms/cwms_text_pkg_body.sql#L3601 Calling the STORE_TS_BINARY procedure that takes the timestamp data table as input https://github.com/HydrologicEngineeringCenter/cwms-database/blob/47d136e6c7932a1ad8e02c1e2c6c267a08eb4ecc/schema/src/cwms/cwms_text_pkg_body.sql#L3874 is a functional alternative at the moment to get around this issue.

This is the source of a Binary TS data storage bug initially identified in #24

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in schema/src/cwms/cwms_text_pkg_body.sql at the STORE_TS_BINARY procedures around lines 3601, 3632, 3863, and 3874. Compare the overloads and trace the empty-timestamp case described in the issue. Done means irregular binary data with no existing values is stored in both AT_BLOB and AT_TSV_BINARY.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.