...
In this case, dropdown will be populated with supported data types, and user will select one out of that. It will ensure the proper data type is entered.
Note : Currently we couldn't find a widget, that will provide the above mentioned combination (two text boxes and one drop down). The GroupbyAggregate plugin has a widget with 2 text-boxes and a drop-down.
1st text box - xpathMappings
drop-down - field type
2nd text box - fieldName
But the keyword "as" present in the widget may be confusing to the user.
Or
Second Approach(Implemented):
Use two widgets as mentioned below:
...
Also, the description will include the supported data types, which will help user to enter the correct or expected types for particular field.
Note : This will require extra validations to check if the correct value for field type is entered.
Assumptions:
For every structured record received to the transform plugin, the output will also be a single structured record.
...
- For defining the output field types, field names and xpath value, following approach can be used:
- Common widget with 2 text boxes and a drop down or
- key value widget to take the output field name and xpath expression, and a second output schema widget
User is able to specify what should happen when there is error in processing. Errors could be:
IllegalCharacter
Type conversion error
NULL or EMPTY value for non nullable column value
Requirement: User is NOT able to XPaths that are arrays. It should be runtime error.
Understanding: xPath returning multiple nodes with same name. Suppose we have below input:
<Cities>
Code Block language xml <Cities> <City>Paris</City>
<City>Lyon</City>
<City>Marseille</City>
</Cities>
And user wants to extract city ['Paris', 'Lyon', 'Marseille'] and provides xPath till /Cities /City. Then as per our use case, we should throw an error.
a. Is this understanding correct or are we missing anything on xPath arrays?
In case, user chooses to write the error records to a separate dataset, then record will be emitted using emitter.emitError() in transform method.
Is the understanding correct?
...