Data type promotion does not seem to work
See original GitHub issueversion: 3.8.4
Tried to execute (over JDBC):
select sum(l_orderkey) from tpch_sf10000.lineitem
Received:
net.snowflake.client.jdbc.SnowflakeSQLException: Cannot convert value in the driver from type:-5 to type:LONG, value=1799999764967164128007. at net.snowflake.client.jdbc.SnowflakeResultSetV1.getObject(SnowflakeResultSetV1.java:294)
When querying the result set metadata, got:
colName = sum(L_ORDERKEY), colTpe = NUMBER, dataTpe = -5, classTpe = java.lang.Long, precision = 38, scale = 0, isNullable = 1
Seems the Long is not promoted to BigDecimal.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
C++ type promotion below int [duplicate] - Stack Overflow
Integer promotion refers to how any data type smaller than an int is casted to an int (or uint ) when an operation...
Read more >8.2 — Floating-point and integral promotion - Learn C++
All numeric promotions are value-preserving, which means that all values in the original type are representable without loss of data or ...
Read more >Type Promotion in C Language | Learn Now - Emertxe
Type promotion in C is a method to convert any variable from one datatype to another. C allows variables of different datatypes to...
Read more >Automatic Type Promotion in Overloading in Java
The name Type Promotion specifies that a small size datatype can be promoted to a large size datatype. i.e., an Integer data type...
Read more >INT02-C. Understand integer conversion rules
Integer promotions require the promotion of each variable ( c1 and c2 ) to int ... If both operands have the same type,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can set that parameter, but through the same connection we want to issue multiple queries and don’t want to treat all columns that have a scale of 0 as decimals. Should this really be handled at the client side?
Sure, no worries. Thanks for the help.