https://pinot.apache.org/ logo
#pinot-dev
Title
# pinot-dev
g

Grace Walkuski

08/10/2021, 9:02 PM
Hello! I’m using the pinot client and am getting this exception
Copy code
Caused by: java.lang.NumberFormatException: For input string: "20619889534"
	at java.lang.NumberFormatException.forInputString(Unknown Source) ~[?:?]
	at java.lang.Integer.parseInt(Unknown Source) ~[?:?]
	at java.lang.Integer.parseInt(Unknown Source) ~[?:?]
	at org.apache.pinot.client.AbstractResultSet.getInt(AbstractResultSet.java:58) ~[pinot-java-client-0.7.1.jar:0.7.1-e22be7c3a39e840321d3658e7505f21768b228d6]
	at org.apache.pinot.client.PinotResultSet.getInt(PinotResultSet.java:263) ~[pinot-jdbc-client-0.7.1.jar:0.7.1-e22be7c3a39e840321d3658e7505f21768b228d6]
and I believe it it because 20,619,889,534 is larger than the maximum integer: 2,147,483,647 Is there a solution on my side so I can get around this?
m

Mayank

08/10/2021, 9:24 PM
Could you expand the stack trace a bit? I am trying to see who is calling the
getInt
, and can that be replaced by
getLong
g

Grace Walkuski

08/10/2021, 9:26 PM
Yea! Here’s some more of the stackTrace.
Copy code
java.lang.NumberFormatException: For input string: "20619889534"
	at java.lang.NumberFormatException.forInputString(Unknown Source) ~[?:?]
	at java.lang.Integer.parseInt(Unknown Source) ~[?:?]
	at java.lang.Integer.parseInt(Unknown Source) ~[?:?]
	at org.apache.pinot.client.AbstractResultSet.getInt(AbstractResultSet.java:58) ~[pinot-java-client-0.7.1.jar:0.7.1-e22be7c3a39e840321d3658e7505f21768b228d6]
	at org.apache.pinot.client.PinotResultSet.getInt(PinotResultSet.java:263) ~[pinot-jdbc-client-0.7.1.jar:0.7.1-e22be7c3a39e840321d3658e7505f21768b228d6]
	at org.jooq.tools.jdbc.DefaultResultSet.getInt(DefaultResultSet.java:134) ~[jooq-3.12.1.jar:?]
	at org.jooq.impl.CursorImpl$CursorResultSet.getInt(CursorImpl.java:773) ~[jooq-3.12.1.jar:?]
	at org.jooq.impl.DefaultBinding$DefaultIntegerBinding.get0(DefaultBinding.java:2440) ~[jooq-3.12.1.jar:?]
	at org.jooq.impl.DefaultBinding$DefaultIntegerBinding.get0(DefaultBinding.java:2412) ~[jooq-3.12.1.jar:?]
	at org.jooq.impl.DefaultBinding$AbstractBinding.get(DefaultBinding.java:824) ~[jooq-3.12.1.jar:?]
	at org.jooq.impl.CursorImpl$CursorIterator$CursorRecordInitialiser.setValue(CursorImpl.java:1725) ~[jooq-3.12.1.jar:?]
	at org.jooq.impl.CursorImpl$CursorIterator$CursorRecordInitialiser.operate(CursorImpl.java:1685) ~[jooq-3.12.1.jar:?]
	at org.jooq.impl.CursorImpl$CursorIterator$CursorRecordInitialiser.operate(CursorImpl.java:1650) ~[jooq-3.12.1.jar:?]
	at org.jooq.impl.RecordDelegate.operate(RecordDelegate.java:130) ~[jooq-3.12.1.jar:?]
	at org.jooq.impl.CursorImpl$CursorIterator.fetchNext(CursorImpl.java:1614) ~[jooq-3.12.1.jar:?]
we are using Jooq to build the queries which is what is calling getInt. I will try and see if I can get Jooq to call getLong instead…
m

Mayank

08/10/2021, 9:35 PM
I see. Pinot response returns the metadata, which has datatype in it. I am unsure how you are using jooq, but ideally we need to look at the data type in the result metadata and use the appropriate api. Alternatively, folks simply just use String/Long/Double to avoid data type checks.
g

Grace Walkuski

08/10/2021, 9:36 PM
Ok, this case is for a
count(field_name)
which i feel like would always be an int. How can I make it be a Long?
m

Mayank

08/10/2021, 9:43 PM
Pinot always returns
long
for
count
queries.
g

Grace Walkuski

08/10/2021, 9:44 PM
Oh! Ok great