question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Data type promotion does not seem to work

See original GitHub issue

version: 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:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
and-costeacommented, Aug 12, 2019

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?

0reactions
and-costeacommented, Aug 14, 2019

Sure, no worries. Thanks for the help.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found