SelectObjectContent

SelectObjectContent #

Overview #

This operation filters the contents of an Amazon S3 object based on a simple structured query language (SQL) statement. In the request, along with the SQL expression, you must also specify a data serialization format (JSON, CSV, or Apache Parquet) of the object.

AWS API Reference: https://docs.aws.amazon.com/es_es/AmazonS3/latest/API/API_SelectObjectContent.html

Method #

SELECTOBJECTCONTENT

Import Parameters #

The request uses the following import parameters.

  • i_bucket_name (bucket in AWS) (Required)

    Name of the bucket.

  • i_region (Required)

    AWS Region of the Amazon S3 Bucket.

  • i_key (Key) (Required)

    The object key.

  • i_x_amz_expected_b_owner (x-amz-expected-bucket-owner in AWS)

    The account id of the expected bucket owner.

  • i_x_amz_server_custom_algorit (x-amz-server-side-encryption-customer-algorithm in AWS)

    The SSE Algorithm used to encrypt the object.

  • i_x_amz_server_custom_key (x-amz-server-side-encryption-customer-key in AWS)

    The SSE Customer Key.

  • i_x_amz_server_custom_key_md5 (x-amz-server-side-encryption-customer-key-MD5 in AWS)

    The SSE Customer Key MD5.

  • i_select_object_contentrequest (SelectObjectContentRequest in AWS) (Required)

    Root level tag for the SelectObjectContentRequest parameters.

  • i_expression (Expression in AWS) (Required)

    The expression that is used to query the object.

  • i_expression_type (ExpressionType in AWS) (Required)

    The type of the provided expression (for example, SQL).

  • i_input_serialization (InputSerialization in AWS) (Required)

    Describes the format of the data in the object that is being queried.

  • i_output_serialization (OutputSerialization in AWS) (Required)

    Describes the format of the data that you want Amazon S3 to return in response.

  • i_request_progress (RequestProgress in AWS)

    Specifies if periodic request progress information should be enabled.

  • i_scan_range (ScanRange in AWS)

    Specifies the byte range of the object to get the records from.

  • i_no_convert_xcontent

    Specifies if the xcontent return result have to be converted in string or not.


Export Parameters #

This method use the following export parameters:

  • e_http_status

    HTTP Status code.

  • e_response_headers

    Returns information about the request in format Name/Value pair values.

  • e_response_content

    Response content in string format.


Example #

DATA: lo_s3               TYPE REF TO /lnkc/cl_sdk_aws_s3,
      lv_http_status      TYPE i,
      lt_response_headers TYPE tihttpnvp,
      lv_response_content TYPE string,
      lv_response_xcontent TYPE xstring.     

  TRY.
      CREATE OBJECT lo_s3
        EXPORTING
          i_user_name         = 'user_awsconnector'
          i_access_key        = 'acces_key_value'
          i_secret_access_key = 'secret_acceskey_value'.
  ENDTRY.


  TRY.
      CALL METHOD lo_s3->selectobjectcontent
        EXPORTING
          i_key                          = 'i_key'
*         i_x_amz_server_custom_algorit  =
*         i_x_amz_server_custom_key      =
*         i_x_amz_server_custom_key_md5  =
          i_select_object_contentrequest = 'i_select_object_contentrequest'
          i_expression                   = 'i_expression'
          i_expression_type              = 'i_expression_type'
          i_input_serialization          = 'i_input_serialization'
          i_output_serialization         = 'i_output_serilization'
          i_no_convert_xcontent          = 'X'
*         i_request_progress             =
          i_scan_range                   = 'i_scan_range'
          i_bucket_name                  = 'i_bucket_name'
          i_region                       = 'i_region'
        IMPORTING
          e_http_status                  = lv_http_status
          e_response_headers             = lt_response_headers
          e_response_content             = lv_response_content
          e_response_xcontent            = lv_response_xcontent.
    CATCH /lnkc/cx_sdk_aws .
        " Error Message
  ENDTRY.