/AWS1/CL_KNY=>DISCOVERINPUTSCHEMA()
¶
About DiscoverInputSchema¶
This documentation is for version 1 of the Amazon Kinesis Data Analytics API, which only supports SQL applications. Version 2 of the API supports SQL and Java applications. For more information about version 2, see Amazon Kinesis Data Analytics API V2 Documentation.
Infers a schema by evaluating sample records on the specified streaming source (Amazon Kinesis stream or Amazon Kinesis Firehose delivery stream) or S3 object. In the response, the operation returns the inferred schema and also the sample records that the operation used to infer the schema.
You can use the inferred schema when configuring a streaming source for your application. For conceptual information, see Configuring Application Input. Note that when you create an application using the Amazon Kinesis Analytics console, the console uses this operation to infer a schema and show it in the console user interface.
This operation requires permissions to perform the
kinesisanalytics:DiscoverInputSchema
action.
Method Signature¶
IMPORTING¶
Optional arguments:¶
iv_resourcearn
TYPE /AWS1/KNYRESOURCEARN
/AWS1/KNYRESOURCEARN
¶
Amazon Resource Name (ARN) of the streaming source.
iv_rolearn
TYPE /AWS1/KNYROLEARN
/AWS1/KNYROLEARN
¶
ARN of the IAM role that Amazon Kinesis Analytics can assume to access the stream on your behalf.
io_inputstartingpositionconf
TYPE REF TO /AWS1/CL_KNYINPSTRTINGPOSITI00
/AWS1/CL_KNYINPSTRTINGPOSITI00
¶
Point at which you want Amazon Kinesis Analytics to start reading records from the specified streaming source discovery purposes.
io_s3configuration
TYPE REF TO /AWS1/CL_KNYS3CONFIGURATION
/AWS1/CL_KNYS3CONFIGURATION
¶
Specify this parameter to discover a schema from data in an Amazon S3 object.
io_inputprocessingconf
TYPE REF TO /AWS1/CL_KNYINPUTPROCINGCONF
/AWS1/CL_KNYINPUTPROCINGCONF
¶
The InputProcessingConfiguration to use to preprocess the records before discovering the schema of the records.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_knydiscoverinpschrsp
/AWS1/CL_KNYDISCOVERINPSCHRSP
¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->/aws1/if_kny~discoverinputschema(
io_inputprocessingconf = new /aws1/cl_knyinputprocingconf(
io_inputlambdaprocessor = new /aws1/cl_knyinputlambdaprocor(
iv_resourcearn = |string|
iv_rolearn = |string|
)
)
io_inputstartingpositionconf = new /aws1/cl_knyinpstrtingpositi00( |string| )
io_s3configuration = new /aws1/cl_knys3configuration(
iv_bucketarn = |string|
iv_filekey = |string|
iv_rolearn = |string|
)
iv_resourcearn = |string|
iv_rolearn = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_sourceschema = lo_result->get_inputschema( ).
IF lo_sourceschema IS NOT INITIAL.
lo_recordformat = lo_sourceschema->get_recordformat( ).
IF lo_recordformat IS NOT INITIAL.
lv_recordformattype = lo_recordformat->get_recordformattype( ).
lo_mappingparameters = lo_recordformat->get_mappingparameters( ).
IF lo_mappingparameters IS NOT INITIAL.
lo_jsonmappingparameters = lo_mappingparameters->get_jsonmappingparameters( ).
IF lo_jsonmappingparameters IS NOT INITIAL.
lv_recordrowpath = lo_jsonmappingparameters->get_recordrowpath( ).
ENDIF.
lo_csvmappingparameters = lo_mappingparameters->get_csvmappingparameters( ).
IF lo_csvmappingparameters IS NOT INITIAL.
lv_recordrowdelimiter = lo_csvmappingparameters->get_recordrowdelimiter( ).
lv_recordcolumndelimiter = lo_csvmappingparameters->get_recordcolumndelimiter( ).
ENDIF.
ENDIF.
ENDIF.
lv_recordencoding = lo_sourceschema->get_recordencoding( ).
LOOP AT lo_sourceschema->get_recordcolumns( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_recordcolumnname = lo_row_1->get_name( ).
lv_recordcolumnmapping = lo_row_1->get_mapping( ).
lv_recordcolumnsqltype = lo_row_1->get_sqltype( ).
ENDIF.
ENDLOOP.
ENDIF.
LOOP AT lo_result->get_parsedinputrecords( ) into lt_row_2.
LOOP AT lt_row_2 into lo_row_3.
lo_row_4 = lo_row_3.
IF lo_row_4 IS NOT INITIAL.
lv_parsedinputrecordfield = lo_row_4->get_value( ).
ENDIF.
ENDLOOP.
ENDLOOP.
LOOP AT lo_result->get_processedinputrecords( ) into lo_row_5.
lo_row_6 = lo_row_5.
IF lo_row_6 IS NOT INITIAL.
lv_processedinputrecord = lo_row_6->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_result->get_rawinputrecords( ) into lo_row_7.
lo_row_8 = lo_row_7.
IF lo_row_8 IS NOT INITIAL.
lv_rawinputrecord = lo_row_8->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.