Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

Passing multiple attributes to a composite operator in a single parameter?

2700050N5R gravatar image
Question by Bruce Glassford  (912) | Mar 04, 2014 at 09:36 AM streamsdevparameterattributescomposite

The Parameters section of the documentation says it can be done.... that composite operators can take a comma delimited series of attributes as a parameter, but if I go into the composite operator syntax, I don't see a way to do it.

Is it actually possible? How do I need to do it?

Or do I have to punt and rewrite my existing composite operator in C++ just to get this feature?

People who like this

  0   Show 1
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
060000R3SX gravatar image Brian M Williams (317)   Mar 04, 2014 at 10:53 AM 0
Share

The answer below is not what he is referring to. With primitive operators, you can pass a comma-separated list of attribute names (e.g Join operators equalityLHS & equalityRHS parameters).

Within the documentation (Reference > Streams Processing Language reference > Operators > Operator invocations > Param Clause), it states that you can do this with Custom operators:

...

a comma-separated list of stream attribute names
a comma-separated list of expressions
a function name
an operator name
a type

... composite operators can also accept parameters of the forms 3, 4, and 5 in the list.

Is there an example of how to do this? passing them the way you would to the Join operator does not seem to work. Is there a special syntax to use when defining the parameter of the composite?

2 answers

  • Sort: 
27000064QT gravatar image
Accepted answer

Answer by hnasgaard (1441) | Mar 05, 2014 at 08:28 AM

I think the answer is, the documentation is incorrect; it can't be done. If you look at the expression modes in Reference -> Streams Processing Language reference -> Operators -> Operator definitions -> Operator Parameters -> Operator Parameter Modes, the expressionModes allowable for a composite parameter are described. One mode is attribute, which allows you to specify a single attribute. There is no syntax for a list<attribute>. If your attribute types are all the same you can sort of do what you want by creating a list, [a,b,c] and using an expressionMode of expression, or expression<list<t>>, where T is the type. How did you want to use the list of attributes within the composite?

Comment
Seth Packham
Bruce Glassford

People who like this

  2   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
2700050N5R gravatar image Bruce Glassford (912)   Mar 05, 2014 at 06:18 PM 0
Share

Thanks - not what I was hoping to hear, but what I figured was the answer.

What I'm trying to do is have a composite where it enhances the tuple based on one attribute (i.e. a lookup based on it), and stores the result in a second. What would be nice is to have something like Sort's fields/order pairing, where there's two lists, so I'd have the parameter with the attributes to look up as a list, and then the parameter with the attributes to store the result as a list.

The expression list would work for the first (what to lookup), but I don't think I can do tuple.$parm[1] = "value" to store the result.

120000HAGM gravatar image

Answer by Stan Bradbury (1290) | Mar 04, 2014 at 09:46 AM

Take a look at the example in this post.

https://www.ibmdw.net/answers/questions/5043/syntax-for-classlibrary-with-multiple-elements//7992

Comment

People who like this

  0   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

Follow this question

No one has followed this question yet.

Answers

Answers & comments

Related questions

Passing multiple values to one parameter of composite operator 1 Answer

Dummy Composite or Stream Alias? 1 Answer

Parameters in Beacon operator 5 Answers

Best approach for operator that requires a parameter with a limited set of values be compatible with getSubmissionTimeValue 3 Answers

Streams 4 not accepting list of tuples as Submission Time Value 4 Answers

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges