Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
The yahoofinance example crashes with the following stacktrace:
2017-07-18 10:20:35,471 [1/StockTickInput:StockTickInput] ERROR engine.StreamingContainer run - Operator set [OperatorDeployInfo[id=1,name=StockTickInput,type=INPUT,checkpoint={ffffffffffffffff, 0, 0},inputs=[],outputs=[OperatorDeployInfo.OutputDeployInfo[portName=price,streamId=price,bufferServer=localhost], OperatorDeployInfo.OutputDeployInfo[portName=volume,streamId=vol,bufferServer=localhost], OperatorDeployInfo.OutputDeployInfo[portName=time,streamId=time,bufferServer=localhost]]]] stopped running due to an exception. java.lang.NumberFormatException: For input string: "N/A" at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043) at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) at java.lang.Double.parseDouble(Double.java:538) at java.lang.Double.valueOf(Double.java:502) at org.apache.apex.examples.yahoofinance.StockTickInput.emitTuples(StockTickInput.java:141) at com.datatorrent.stram.engine.InputNode.run(InputNode.java:124) at com.datatorrent.stram.engine.StreamingContainer$2.run(StreamingContainer.java:1428) 2017-07-18 10:20:35,478 [1/StockTickInput:StockTickInput] INFO stram.StramLocalCluster log - container-3 msg: Stopped running due to an exception. java.lang.NumberFormatException: For input string: "N/A" at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043) at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) at java.lang.Double.parseDouble(Double.java:538) at java.lang.Double.valueOf(Double.java:502) at org.apache.apex.examples.yahoofinance.StockTickInput.emitTuples(StockTickInput.java:141) at com.datatorrent.stram.engine.InputNode.run(InputNode.java:124) at com.datatorrent.stram.engine.StreamingContainer$2.run(StreamingContainer.java:1428)
The reason is that Yahoo Inc. (YHOO) is now trading under the name Altaba Inc. (AABA) and therefore the stock ticker does not return any valid information anymore. The response from the Yahoo Finance API looks like this:
"IBM",153.32,2953715,"1:07pm" "GOOG",963.36,595534,"1:07pm" "AAPL",149.6144,10235115,"1:07pm" "YHOO",N/A,0,N/A
The application crashes because the StockTickInput operator can't parse "N/A" as a valid double. Changing all the ticker symbols from YHOO to AABA should fix this.