IBMStreams / streamsx.topology

Develop streaming applications for IBM Streams in Python, Java & Scala.
http://ibmstreams.github.io/streamsx.topology
Apache License 2.0
29 stars 43 forks source link

[Python] ERROR: Input stream alias identical to input stream name #1017

Closed cancilla closed 7 years ago

cancilla commented 7 years ago

I cloned the repo yesterday (May 8, 2017) and I am using the python topology from the master branch.

I have the following notebook cells:

Cell 1:

import sys
sys.path.append("/home/streamsadmin/git/streamsx.topology/com.ibm.streamsx.topology/opt/python/packages")

Cell 2:

def ident_func(tuple):
    return tuple

Cell 3:

from streamsx.topology import schema
from streamsx.topology.topology import Topology
import streamsx.topology.context
import json

topo = Topology("observation_visualization")

data = topo.subscribe('some_topic', schema.CommonSchema.Json) \
            .transform(ident_func) \
            .sink(print)

streamsx.topology.context.submit("DISTRIBUTED", topo)

The submission fails with the following errors:

May 09, 2017 7:59:00 AM com.ibm.streamsx.topology.internal.streams.InvokeMakeToolkit invoke
INFO: Invoking spl-make-toolkit
May 09, 2017 7:59:00 AM com.ibm.streamsx.topology.internal.streams.InvokeMakeToolkit invoke
INFO: /opt/ibm/InfoSphere_Streams/4.2.0.0/bin/spl-make-toolkit --make-operator -i /home/streamsadmin/git/streamsx.health/samples/SimpleJupyterDemo/notebooks/tk2459320530487866919
May 09, 2017 7:59:00 AM com.ibm.streamsx.topology.internal.streams.InvokeMakeToolkit invoke
INFO: spl-make-toolkit complete: return code=0
May 09, 2017 7:59:00 AM com.ibm.streamsx.topology.internal.streams.InvokeSc getToolkitPath
INFO: ToolkitPath:/home/streamsadmin/git/streamsx.topology/com.ibm.streamsx.topology:/opt/ibm/InfoSphere_Streams/4.2.0.0/toolkits
May 09, 2017 7:59:00 AM com.ibm.streamsx.topology.internal.streams.InvokeSc invoke
INFO: Invoking SPL compiler (sc) for main composite: ipythoninput12605787ad34c5::repo
May 09, 2017 7:59:00 AM com.ibm.streamsx.topology.internal.streams.InvokeSc invoke
INFO: /opt/ibm/InfoSphere_Streams/4.2.0.0/bin/sc --rebuild-toolkits --optimized-code-generation --num-make-threads=4 -M ipythoninput12605787ad34c5::repo -t /home/streamsadmin/git/streamsx.topology/com.ibm.streamsx.topology:/opt/ibm/InfoSphere_Streams/4.2.0.0/toolkits
May 09, 2017 7:59:03 AM com.ibm.streamsx.topology.internal.process.ProcessOutputToLogger run
SEVERE: ipythoninput12605787ad34c5/repo.spl:17:118: CDISP0086E ERROR: The following input stream alias is identical to an input stream name: Op_OUT0.
May 09, 2017 7:59:03 AM com.ibm.streamsx.topology.internal.process.ProcessOutputToLogger run
SEVERE: ipythoninput12605787ad34c5/repo.spl:31:88: CDISP0086E ERROR: The following input stream alias is identical to an input stream name: ident_func.
May 09, 2017 7:59:03 AM com.ibm.streamsx.topology.internal.process.ProcessOutputToLogger run
SEVERE:
May 09, 2017 7:59:03 AM com.ibm.streamsx.topology.internal.process.ProcessOutputToLogger run
SEVERE: CDISP0092E ERROR: Because of previous compilation errors, the compile process cannot continue.
May 09, 2017 7:59:03 AM com.ibm.streamsx.topology.internal.streams.InvokeSc invoke
INFO: SPL compiler complete: return code=1
Exception in thread "main" java.lang.Exception: SPL compilation failed!
at com.ibm.streamsx.topology.internal.streams.InvokeSc.invoke(InvokeSc.java:133)
at com.ibm.streamsx.topology.internal.context.BundleStreamsContext.doSPLCompile(BundleStreamsContext.java:108)
at com.ibm.streamsx.topology.internal.context.BundleStreamsContext.submit(BundleStreamsContext.java:78)
at com.ibm.streamsx.topology.internal.context.DistributedStreamsContext.submit(DistributedStreamsContext.java:64)
at com.ibm.streamsx.topology.context.StreamsContextSubmit.main(StreamsContextSubmit.java:30)

The generated SPL appears to be incorrect:

namespace ipythoninput12605787ad34c5;
public composite repo
{
graph
@spl_note(id="__spl_sourcelocation", text="{\"file\":\"<ipython-input-12-605787ad34c5>\",\"method\":\"<module>\",\"line\":8,\"topology.method\":\"subscribe\"}")
  ( stream<rstring jsonString> Op_OUT0) as Op = com.ibm.streamsx.topology.topic::Subscribe  ( ) 
  {
    param
      streamType: tuple<rstring jsonString>;
      topic: "some_topic";
  config
    streamViewability: true;
   placement:       partitionColocation("__jaa_isolateId0")
    ;   
  }

  ( stream<blob __spl_po> ident_func) as ident_func = com.ibm.streamsx.topology.functional.python::Map  ( Op_OUT0 as Op_OUT0)
  {
    param
      pyCallable: "gANjc3RyZWFtc3gudG9wb2xvZ3kuZnVuY3Rpb25zCl9DYWxsYWJsZQpxACmBcQF9cQJYCQAAAF9jYWxsYWJsZXEDY2RpbGwuZGlsbApfY3JlYXRlX2Z1bmN0aW9uCnEEKGNkaWxsLmRpbGwKX2xvYWRfdHlwZQpxBVgIAAAAQ29kZVR5cGVxBoVxB1JxCChLAUsASwFLAUtDQwR8AABTcQlOhXEKKVgFAAAAdHVwbGVxC4VxDFgfAAAAPGlweXRob24taW5wdXQtMTAtMGRlYjg2Y2E2ZTQzPnENWAoAAABpZGVudF9mdW5jcQ5LAUMCAAFxDykpdHEQUnERfXESaA5OTn1xE3RxFFJxFXNiLg==";
      pyModule: "streamsx.topology.functions";
      toolkitDir: getThisToolkitDir();
      pyName: "_Callable";
  config
    streamViewability: false;
   placement:       partitionColocation("__jaa_isolateId0")
    ;   
  }

@spl_note(id="__spl_sourcelocation", text="{\"file\":\"/home/streamsadmin/git/streamsx.topology/com.ibm.streamsx.topology/opt/python/packages/streamsx/topology/topology.py\",\"method\":\"sink\",\"line\":447,\"class\":\"Stream\",\"topology.method\":\"for_each\"}")
  ( ) as print = com.ibm.streamsx.topology.functional.python::ForEach  ( ident_func as ident_func)
  {
    param
      pyModule: "builtins";
      toolkitDir: getThisToolkitDir();
      pyName: "print";
  config
    streamViewability: true;
   placement:       partitionColocation("__jaa_isolateId0")
    ;   
  }

}
ddebrunner commented 7 years ago

I can't reproduce this.

What version of streams were you using?

ddebrunner commented 7 years ago

closing - no response.