Skip to content

Fix UNIX_TIMESTAMP transpilation: add CAST(... AS TIMESTAMP) and remo…#225

Merged
gauravdawar-e6 merged 1 commit intoe6data:mainfrom
tkaunlaky-e6:fix/unix-timestamp-cast-to-timestamp
Mar 4, 2026
Merged

Fix UNIX_TIMESTAMP transpilation: add CAST(... AS TIMESTAMP) and remo…#225
gauravdawar-e6 merged 1 commit intoe6data:mainfrom
tkaunlaky-e6:fix/unix-timestamp-cast-to-timestamp

Conversation

@tkaunlaky-e6
Copy link

…ve FLOOR

E6's TO_UNIX_TIMESTAMP only accepts TIMESTAMP/DATE types, not integers or strings. This wraps the argument in CAST(... AS TIMESTAMP) for the no-format branch. Also removes the redundant FLOOR wrapper since E6 returns milliseconds as a long and integer division by 1000 already truncates.

Before: FLOOR(TO_UNIX_TIMESTAMP(column) / 1000)
After: TO_UNIX_TIMESTAMP(CAST(column AS TIMESTAMP)) / 1000

…ve FLOOR

E6's TO_UNIX_TIMESTAMP only accepts TIMESTAMP/DATE types, not integers
or strings. This wraps the argument in CAST(... AS TIMESTAMP) for the
no-format branch. Also removes the redundant FLOOR wrapper since E6
returns milliseconds as a long and integer division by 1000 already
truncates.

Before: FLOOR(TO_UNIX_TIMESTAMP(column) / 1000)
After:  TO_UNIX_TIMESTAMP(CAST(column AS TIMESTAMP)) / 1000
@gauravdawar-e6 gauravdawar-e6 self-requested a review March 4, 2026 11:22
@gauravdawar-e6 gauravdawar-e6 merged commit a54dc6a into e6data:main Mar 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants