マッピング定義(MappingDefinitionタグ)は,「9.9.3 編集用CB定義」で説明した編集用CB定義(DataEditCBDefinitionタグ)の子要素として定義します。
なお,マッピングの処理については,「11.2.2(4) マッピング」,または「11.6.2(3) マッピング」を参照してください。
<MappingDefinition ioType="{INPUT|OUTPUT}">
<source>
<streams>
<stream name="<ストリーム名>"
querygroup="<クエリグループ名>">
<column name="<列名>"
type="{INT|SHORT|BYTE|LONG|BIG_DECIMAL|FLOAT|DOUBLE|STRING |DATE|TIME|TIMESTAMP}"/>
</stream>
</streams>
</source>
<target>
<streams>
<stream name="<ストリーム名>"
querygroup="<クエリグループ名>">
<column name="<列名>"
type="{INT|SHORT|BYTE|LONG|BIG_DECIMAL|FLOAT|DOUBLE|STRING |DATE|TIME|TIMESTAMP}"/>
</stream>
</streams>
<records>
<record name="<レコード名>">
<field name="<フィールド名>" type="{INT|SHORT|BYTE|LONG|BIG_DECIMAL|FLOAT|DOUBLE|STRING |DATE|TIME|TIMESTAMP}"/>
</records>
</target>
<intermediate>
<mappings source="<変換元名>"
querygroup="<クエリグループ名>"
target="<変換先名>">
<map source="<変換元パス式>"
function="<組み込み関数名>" argument1="<第1引数>"
argument2="<第2引数>" target="<変換先パス式>"/>
</mappings>
</intermediate>
</MappingDefinition>
ioType属性の指定値 | マッピングの対象 | sourceタグに指定する内容 |
---|---|---|
INPUT | レコードとストリーム間のマッピング | 空要素タグを指定します。 |
レコード間のマッピング | ||
OUTPUT | レコードとストリーム間のマッピング | streamsタグを指定します。 |
レコード間のマッピング | 空要素タグを指定します。 |
ioType属性の指定値 | マッピングの対象 | targetタグに指定する内容 |
---|---|---|
INPUT | レコードとストリーム間のマッピング | streamsタグを指定します。 |
レコード間のマッピング | recordsタグを指定します。 | |
OUTPUT | レコードとストリーム間のマッピング | 空要素タグを指定します。 |
レコード間のマッピング | recordsタグを指定します。 |
ioType属性の指定値 | マッピングの対象 | source属性に指定する内容 |
---|---|---|
INPUT | レコードとストリーム間のマッピング | 変換元のレコード名を指定します。 |
レコード間のマッピング | ||
OUTPUT | レコードとストリーム間のマッピング | streamタグのname属性に指定したストリーム名を指定します。 |
レコード間のマッピング | 変換元のレコード名を指定します。 |
ioType属性の指定値 | マッピングの対象 | querygroup属性に指定する内容 |
---|---|---|
INPUT | レコードとストリーム間のマッピング | targetタグ下のstreamsタグ内のクエリグループ名を指定します。 |
レコード間のマッピング | 指定しません。 | |
OUTPUT | レコードとストリーム間のマッピング | sourceタグ下のstreamsタグ内のクエリグループ名を指定します。 |
レコード間のマッピング | 指定しません。 |
ioType属性の指定値 | マッピングの対象 | target属性に指定する内容 |
---|---|---|
INPUT | レコードとストリーム間のマッピング | streamタグのname属性に指定したストリーム名を指定します。 |
レコード間のマッピング | recordタグのname属性に指定したレコード名を指定します。 | |
OUTPUT | レコードとストリーム間のマッピング | 変換先のレコード名を指定します。 |
レコード間のマッピング | recordタグのname属性に指定したレコード名を指定します。 |
ioType属性の指定値 | マッピングの対象 | source属性に指定する内容 |
---|---|---|
INPUT | レコードとストリーム間のマッピング | mappingsタグのsource属性に指定したレコード名に属するフィールド名を指定します。 |
レコード間のマッピング | ||
OUTPUT | レコードとストリーム間のマッピング | mappingsタグのsource属性に指定したストリーム名に属するフィールド名を指定します。 |
レコード間のマッピング | mappingsタグのsource属性に指定したレコード名に属するフィールド名を指定します。 |
<?xml version="1.0" encoding="UTF-8"?>
<root:AdaptorCompositionDefinition
<!-- 途中略 -->
xmlns:map="http://www.hitachi.co.jp/soft/xml/sdp/adaptor/definition/callback/MappingDefinition">
<!-- 途中略 -->
<!-- 編集用CB定義 -->
<cb:DataEditCBDefinition class="jp.co.Hitachi.soft.sdp.adaptor.callback.dataedit.mapping.InputMappingCBImpl" name="editor1">
<!-- マッピング定義 -->
<map:MappingDefinition ioType="INPUT">
<map:source/>
<map:target>
<map:streams>
<map:stream name="S1" querygroup="QG1">
<map:column name="id" type="INT"/>
<map:column name="time" type="STRING"/>
<map:column name="name" type="STRING"/>
<map:column name="val" type="INT"/>
</map:stream>
</map:streams>
</map:target>
<map:intermediate>
<map:mappings source="R1" querygroup="QG1" target="S1">
<map:map source="F1" target="id"/>
<map:map source="F2" target="time"/>
<map:map source="F3" target="name"/>
<map:map source="F5" target="val"/>
</map:mappings>
</map:intermediate>
</map:MappingDefinition>
</cb:DataEditCBDefinition>
<?xml version="1.0" encoding="UTF-8"?>
<root:AdaptorCompositionDefinition
<!-- 途中略 -->
xmlns:map="http://www.hitachi.co.jp/soft/xml/sdp/adaptor/definition/callback/MappingDefinition">
<!-- 途中略 -->
<!-- 編集用CB定義 -->
<cb:DataEditCBDefinition class="jp.co.Hitachi.soft.sdp.adaptor.callback.dataedit.mapping.InputMappingCBImpl" name="editor1">
<!-- マッピング定義 -->
<map:MappingDefinition ioType="INPUT">
<map:source/>
<map:target>
<map:records>
<map:record name="RECORD1">
<map:field name="id" type="INT"/>
<map:field name="F21" type="STRING"/>
<map:field name="F22" type="LONG"/>
</map:record>
</map:records>
</map:target>
<map:intermediate>
<map:mappings source="RECORD0" target="RECORD1">
<map:map source="F1" target="id"/>
<map:map function="regexsubstring" argument1="F11"
argument2=".*Data=([0-9]+).*" target="F21"/>
<map:map function="subTime" argument1="F12" argument2=F13" target="F22"/>
</map:mappings>
</map:intermediate>
</map:MappingDefinition>
</cb:DataEditCBDefinition>
<?xml version="1.0" encoding="UTF-8"?>
<root:AdaptorCompositionDefinition
<!-- 途中略 -->
xmlns:map="http://www.hitachi.co.jp/soft/xml/sdp/adaptor/definition/callback/MappingDefinition">
<!-- 途中略 -->
<!-- 編集用CB定義 -->
<cb:DataEditCBDefinition class="jp.co.Hitachi.soft.sdp.adaptor.callback.dataedit.mapping.InputMappingCBImpl" name="editor1">
<!-- マッピング定義 -->
<map:MappingDefinition ioType="INPUT">
<map:source>
<map:streams>
<map:stream name="S1" querygroup="QG1">
<map:column name="id" type="INT"/>
<map:column name="time" type="TIMESTAMP"/>
<map:column name="name" type="STRING"/>
</map:stream>
</map:streams>
</map:source>
<map:target/>
<map:intermediate>
<map:mappings source="S1" querygroup="QG1" target="RECORD1">
<map:map source="id" target="F21"/>
<map:map source="time" target="F22"/>
<map:map source="name" target="F23"/>
</map:mappings>
</map:intermediate>
</map:MappingDefinition>
</cb:DataEditCBDefinition>
<?xml version="1.0" encoding="UTF-8"?>
<root:AdaptorCompositionDefinition
<!-- 途中略 -->
xmlns:map="http://www.hitachi.co.jp/soft/xml/sdp/adaptor/definition/callback/MappingDefinition">
<!-- 途中略 -->
<!-- 編集用CB定義 -->
<cb:DataEditCBDefinition class="jp.co.Hitachi.soft.sdp.adaptor.callback.dataedit.mapping.InputMappingCBImpl" name="editor1">
<!-- マッピング定義 -->
<map:MappingDefinition ioType="INPUT">
<map:source/>
<map:target>
<map:records>
<map:record name="RECORD1">
<map:field name="F21" type="STRING"/>
<map:field name="F22" type="TIMESTAMP"/>
<map:field name="F23" type="LONG"/>
</map:record>
</map:records>
</map:target>
<map:intermediate>
<map:mappings source="RECORD0" target="RECORD1">
<map:map function="regexsubstring" argument1="F11"
argument2=".*Data=([0-9]+).*" target="F21"/>
<map:map function="getTupleTime" target="F22"/>
<map:map function="subTime" argument1="F12" argument2=F13" target="F23"/>
</map:mappings>
</map:intermediate>
</map:MappingDefinition>
</cb:DataEditCBDefinition>