ApplyMapping class
Applies a mapping in a DynamicFrame
.
Example
We recommend that you use the DynamicFrame.apply_mapping()
method to apply a mapping in a DynamicFrame
. To view a code example, see Example: Use apply_mapping to rename fields and change field types.
Methods
__call__(frame, mappings, transformation_ctx = "", info = "", stageThreshold = 0, totalThreshold = 0)
Applies a declarative mapping to a specified DynamicFrame
.
-
frame
– TheDynamicFrame
to apply the mapping to (required). -
mappings
– A list of mapping tuples (required). Each consists of: (source column, source type, target column, target type).If the source column has a dot "
.
" in the name, you must place back-ticks "``
" around it. For example, to mapthis.old.name
(string) tothisNewName
, you would use the following tuple:("`this.old.name`", "string", "thisNewName", "string")
-
transformation_ctx
– A unique string that is used to identify state information (optional). -
info
– A string that is associated with errors in the transformation (optional). -
stageThreshold
– The maximum number of errors that can occur in the transformation before it errors out (optional). The default is zero. -
totalThreshold
– The maximum number of errors that can occur overall before processing errors out (optional). The default is zero.
Returns only the fields of the DynamicFrame
that are specified in the
"mapping" tuples.
apply(cls, *args, **kwargs)
Inherited from GlueTransform
apply.
name(cls)
Inherited from GlueTransform
name.
describeArgs(cls)
Inherited from GlueTransform
describeArgs.
describeReturn(cls)
Inherited from GlueTransform
describeReturn.
describeTransform(cls)
Inherited from GlueTransform
describeTransform.
describeErrors(cls)
Inherited from GlueTransform
describeErrors.
describe(cls)
Inherited from GlueTransform
describe.