Uploaded image for project: 'Apache Apex Malhar'
  1. Apache Apex Malhar
  2. APEXMALHAR-2525

YahooFinance example crashes with java.lang.NumberFormatException because YHOO doesn't exist anymore

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.8.0
    • 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.

      Attachments

        Activity

          People

            florianschmidt Florian Schmidt
            florianschmidt Florian Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: