Fetching structs containing datetimes fails silently
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- sql, typescript
- Domain
- databases
Research direction
Start with lib/result/JsonResult.ts at the referenced lines 89 and 121, then reproduce the failure using the supplied struct containing created_at and updated_at datetime values. Verify how parsing falls back to defaultValue, and define done as handling this input without silent loss while addressing whether a warning should be logged.
Written by the indexing model from the issue text.
Description
If the data being parsed contains datetimes, it fails and returns defaultValue. Example error and data are below:
SyntaxError: Unexpected number in JSON at position 39
at JSON.parse (<anonymous>)
at JsonResult.toJSON (./databricks-sql-nodejs/dist/result/JsonResult.js:93:25)
at JsonResult.convertData (./databricks-sql-nodejs/dist/result/JsonResult.js:64:29)
at ./databricks-sql-nodejs/dist/result/JsonResult.js:47:25
at Array.map (<anonymous>)
at JsonResult.getSchemaValues (./databricks-sql-nodejs/dist/result/JsonResult.js:43:35)
at ./databricks-sql-nodejs/dist/result/JsonResult.js:27:62
at Array.reduce (<anonymous>)
at JsonResult.getRows (./databricks-sql-nodejs/dist/result/JsonResult.js:27:28)
at ./databricks-sql-nodejs/dist/result/JsonResult.js:16:31
The string that's failing to parse is below (partially scrubbed)
'{"id":414247,"created_at":2021-12-21 21:33:59.339,"updated_at":2021-12-21 21:33:59.339,"deleted_at":null,"s3_bucket":"thebucket","s3_key":"c411f24d-1b4a-4eb0-b25b-d2287c7ba3c0"}'
Also, would it make sense to at least log a warning if parsing fails and returns the default value?
- Dominant language
- TypeScript
- Stars
- 36
- Forks
- 50
- Avg merge
- 13h 46m
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databricks/databricks-sql-nodejs
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
engineer-bot
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
databricks/databricks-sql-nodejs#274 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in databricks/databricks-sql-nodejs
Similar issues
-
S: triage
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
fix(errors): EHOSTUNREACH from a happy-eyeballs connect is reported as a resolver error (STAMP-80) Open
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
snapshot-labs/stamp#666 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
GauravKarakoti/SecureFlow#1070 · 1 comment ·
-
comp/desktop P3 type/bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
NousResearch/hermes-agent#118866 ·