Field Level Schema name/suffix


#1

If I have a type like this:

entity type SmartBulb extends LightBulb  mixes MetricEvaluatable type key "SMRT_BLB" {

/**
* This bulb's historical measurements, persisting results into a new table
* named "SMRT_BLB_ADDTL_TBL_NME" (will concatenate schema names with '_')
*/
fieldName2: [AnotherType] schema name "ADDTL_TBL_NME"
/**
* This bulb's historical measurements, persisting results into a new table
* named "SMRT_BLBTBL_NME" (will concatenate schema names without any delimiter)
*/
fieldName3: [AnotherType] schema suffix "TBL_NME"
}

And assuming the schema name for LightBulb is LGHT_BLB

What will the following be:

  1. Will fieldName2 store results in a table named LGHT_BLB_SMRT_BLB_ADDTL_TBL_NME or SMRT_BLB_ADDTL_TBL_NME
  2. Will fieldName3 store results in a table named LGHT_BLBSMRT_BLBTBL_NME or SMRT_BLBTBL_NME

or is there a larger misunderstanding?


#2

@steveders First off, you should use “schema suffix” rather than “schema name” and use very short values (e.g. 2 to 3 characters). Otherwise the names will be too long (30 total character limit). Now to answer your question, the child table names will be:

LGHT_BLB_<schema name/suffix for the field>


#3

Thanks @trothwein.

So the Schema Name for SmartBulb, “SMRT_BLB”, will not be included in the child table names, only the extended type(s) and the field level schema name?


#4

@steveders “SMRT_BLB” isn’t a schema name in SmartBulb. It is a type key which is a totally different thing. Schema names/suffixes contribute to the names of the schema objects (e.g. tables/columns). Type keys contribute to the typeIdent field for extendable types so we can tell what each instance is.