Add support to NUMBER to Python UDFs#28901
Conversation
| case StandardTypes.DOUBLE -> TrinoType.DOUBLE; | ||
| case StandardTypes.REAL -> TrinoType.REAL; | ||
| case StandardTypes.DECIMAL -> TrinoType.DECIMAL; | ||
| case StandardTypes.DECIMAL, StandardTypes.NUMBER -> TrinoType.DECIMAL; |
There was a problem hiding this comment.
What is the semantics of TrinoType enum?
I don't see javadoc nor usages on it... Why is it safe to present NUMBER as a decimal?
There was a problem hiding this comment.
It's a translation between the host and the wasm environment. Types are covered here: https://github.com/trinodb/trino-wasm-python/blob/master/pyhost.h#L10
There was a problem hiding this comment.
to me this looks like we need to expand that enum when a new trino type is added
| """; | ||
|
|
||
| assertThat(assertions.query( | ||
| query + "SELECT multiply(NUMBER '1.12345', NUMBER '2.54321')")) |
There was a problem hiding this comment.
Can you please add a test with NULL, NaN and ±Infinity?
There was a problem hiding this comment.
NaN and +/- Infinity are not supported by wasm python yet so nothing to test.
There was a problem hiding this comment.
the behavior should still be tested, regardless of current behavior
Description
Additional context and related issues
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: