Using reserved words as field names in StreamBase

Using reserved words as field names in StreamBase

book

Article ID: KB0083277

calendar_today

Updated On:

Products Versions
TIBCO Streaming -

Description

I have a stream with a schema field named "as" which is required from my data provider, but is a StreamBase reserved word. I can't refer to that field in EventFlow expressions due to typecheck errors. How can I correct this?

Resolution

StreamBase expression-language keywords are documented in the Help here:
  TIBCO StreamBase Documentation > StreamBase References > StreamBase Expression Language Features
  Section: "Reserved Words"

To name a field the same as a keyword, you may "escape" the name using the notation (example): #"as"

This is described in the Help here:
  TIBCO StreamBase Documentation > StreamBase References > StreamBase Expression Language Features
  Section: "Escaped Identifier Syntax"

StreamBase adapters will consume keyword-named fields from external sources if you provide the escaped field name in the adapter schema. Similarly when using an output adapter, the field will be renamed back to the simple un-escaped word for presentation to the external service. This does required the escaped name to be used for all internal logic as long as the keyword-named field is preserved in the tuple schema.
 

Issue/Introduction

Using escape-syntax to use a reserved word as a field name.