velox icon indicating copy to clipboard operation
velox copied to clipboard

Fix loss of precision in timestamp when spilling

Open bikramSingh91 opened this issue 2 years ago • 8 comments

Currently we use a presto compatible serializer when spilling which serializes timestamp to millisecond precision. This results in loss of precision for velox timestamp type since velox stores it in nanosecond precision. This patch ensures that precision is maintained when spilling occurs. It introduces a new 'Options' input parameter to the VectorSerde interface which is a map of key-value pairs. This allows the PrestoSerializer to support serialization with both precisions by allowing the caller to toggle between the two via the input parameter.

Additionally, this also removes a hack inside the test suite which by default downgrades timestamp precision to millisecond when comparing results in order to be compatible with duckDB which is used to verify correctness in some tests.

Test Plan Added unit tests

bikramSingh91 avatar Aug 12 '22 01:08 bikramSingh91

@bikramSingh91 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Aug 12 '22 01:08 facebook-github-bot

@bikramSingh91 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Aug 12 '22 01:08 facebook-github-bot

@bikramSingh91 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Aug 12 '22 01:08 facebook-github-bot

Deploy Preview for meta-velox canceled.

Name Link
Latest commit a95534409e0450e43e085c2dabbc9e7f38d98227
Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/630fd7b04bff8b00096aa6bb

netlify[bot] avatar Aug 26 '22 22:08 netlify[bot]

@bikramSingh91 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Aug 26 '22 22:08 facebook-github-bot

@bikramSingh91 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Aug 27 '22 00:08 facebook-github-bot

@bikramSingh91 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Aug 29 '22 17:08 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D38644631

facebook-github-bot avatar Aug 29 '22 21:08 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D38644631

facebook-github-bot avatar Aug 31 '22 17:08 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D38644631

facebook-github-bot avatar Aug 31 '22 21:08 facebook-github-bot