CleanRoomsService / Client / create_intermediate_table

create_intermediate_table

CleanRoomsService.Client.create_intermediate_table(**kwargs)

Creates an intermediate table in a membership. An intermediate table stores a query definition that you can execute later using PopulateIntermediateTable to materialize cached results. The intermediate table is owned by the member with the CAN_QUERY ability. This operation does not execute the stored query.

See also: AWS API Documentation

Request Syntax

response = client.create_intermediate_table(
    membershipIdentifier='string',
    name='string',
    description='string',
    populationAnalysisConfiguration={
        'sqlParameters': {
            'queryString': 'string',
            'analysisTemplateArn': 'string'
        }
    },
    kmsKeyArn='string',
    retentionInDays=123,
    tags={
        'string': 'string'
    }
)
Parameters:
  • membershipIdentifier (string) –

    [REQUIRED]

    The unique identifier of the membership where the intermediate table is created.

  • name (string) –

    [REQUIRED]

    The display name for the intermediate table.

  • description (string) – A description of the intermediate table.

  • populationAnalysisConfiguration (dict) –

    [REQUIRED]

    The configuration that defines the analysis used to populate the intermediate table. This configuration contains the SQL query or analysis template reference.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: sqlParameters.

    • sqlParameters (dict) –

      The SQL parameters for the population analysis, including the query string or analysis template ARN.

      • queryString (string) –

        The SQL query string used to populate the intermediate table. Maximum length of 500,000 characters.

      • analysisTemplateArn (string) –

        The Amazon Resource Name (ARN) of the analysis template to use for populating the intermediate table.

  • kmsKeyArn (string) – The Amazon Resource Name (ARN) of the customer-managed KMS key used to encrypt the intermediate table data.

  • retentionInDays (integer) – The number of days to retain populated data versions. Minimum value of 1, maximum value of 365.

  • tags (dict) –

    An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'intermediateTable': {
        'id': 'string',
        'arn': 'string',
        'name': 'string',
        'description': 'string',
        'membershipArn': 'string',
        'membershipId': 'string',
        'collaborationArn': 'string',
        'collaborationId': 'string',
        'childResources': [
            {
                'resourceId': 'string',
                'resourceType': 'INTERMEDIATE_TABLE',
                'resourceName': 'string',
                'ownerAccountId': 'string',
                'resourceStatus': 'CREATED'|'POPULATE_STARTED'|'POPULATE_SUCCESS'|'POPULATE_FAILED'|'DISALLOWED_BY_DATA_PROVIDER'|'BASE_TABLE_REMOVED'|'RETENTION_PERIOD_EXPIRED'
            },
        ],
        'createTime': datetime(2015, 1, 1),
        'updateTime': datetime(2015, 1, 1),
        'status': 'CREATED'|'POPULATE_STARTED'|'POPULATE_SUCCESS'|'POPULATE_FAILED'|'DISALLOWED_BY_DATA_PROVIDER'|'BASE_TABLE_REMOVED'|'RETENTION_PERIOD_EXPIRED',
        'statusReason': 'string',
        'kmsKeyArn': 'string',
        'populationAnalysisConfiguration': {
            'sqlParameters': {
                'queryString': 'string',
                'analysisTemplateArn': 'string'
            }
        },
        'retentionInDays': 123,
        'tableDependencies': [
            {
                'id': 'string',
                'name': 'string',
                'type': 'TABLE'|'INTERMEDIATE_TABLE'|'ID_MAPPING_TABLE',
                'parentType': 'DIRECT'|'INDIRECT',
                'creatorAccountId': 'string'
            },
        ],
        'intermediateTableVersion': {
            'versionId': 'string',
            'analysisId': 'string',
            'analysisType': 'QUERY',
            'kmsKeyArn': 'string',
            'parameters': {
                'string': 'string'
            },
            'inheritedConstraints': {
                'additionalAnalyses': {
                    'value': 'ALLOWED'|'REQUIRED'|'NOT_ALLOWED',
                    'sources': [
                        {
                            'name': 'string',
                            'id': 'string',
                            'type': 'TABLE'|'INTERMEDIATE_TABLE'|'ID_MAPPING_TABLE',
                            'value': 'ALLOWED'|'REQUIRED'|'NOT_ALLOWED',
                            'sourceAccountId': 'string'
                        },
                    ]
                },
                'allowedAdditionalAnalyses': {
                    'value': [
                        'string',
                    ],
                    'sources': [
                        {
                            'name': 'string',
                            'id': 'string',
                            'type': 'TABLE'|'INTERMEDIATE_TABLE'|'ID_MAPPING_TABLE',
                            'value': [
                                'string',
                            ],
                            'sourceAccountId': 'string'
                        },
                    ]
                },
                'allowedResultReceivers': {
                    'value': [
                        'string',
                    ],
                    'sources': [
                        {
                            'name': 'string',
                            'id': 'string',
                            'type': 'TABLE'|'INTERMEDIATE_TABLE'|'ID_MAPPING_TABLE',
                            'value': [
                                'string',
                            ],
                            'sourceAccountId': 'string'
                        },
                    ]
                },
                'disallowedOutputColumns': {
                    'value': [
                        'string',
                    ],
                    'columnLineage': [
                        {
                            'column': 'string',
                            'sourceColumn': 'string',
                            'sourceName': 'string',
                            'sourceId': 'string',
                            'sourceType': 'TABLE'|'INTERMEDIATE_TABLE'|'ID_MAPPING_TABLE',
                            'sourceAccountId': 'string'
                        },
                    ]
                }
            },
            'expirationTime': datetime(2015, 1, 1)
        },
        'analysisRuleTypes': [
            'CUSTOM',
        ],
        'schema': {
            'columns': [
                {
                    'name': 'string',
                    'type': 'string'
                },
            ]
        }
    }
}

Response Structure

  • (dict) –

    • intermediateTable (dict) –

      The intermediate table that was created.

      • id (string) –

        The unique identifier of the intermediate table.

      • arn (string) –

        The Amazon Resource Name (ARN) of the intermediate table.

      • name (string) –

        The name of the intermediate table.

      • description (string) –

        The description of the intermediate table.

      • membershipArn (string) –

        The Amazon Resource Name (ARN) of the membership that contains the intermediate table.

      • membershipId (string) –

        The unique identifier of the membership that contains the intermediate table.

      • collaborationArn (string) –

        The Amazon Resource Name (ARN) of the collaboration that contains the intermediate table.

      • collaborationId (string) –

        The unique identifier of the collaboration that contains the intermediate table.

      • childResources (list) –

        The child resources that depend on this intermediate table.

        • (dict) –

          Contains information about a child resource of a given resource in a collaboration.

          • resourceId (string) –

            The unique identifier of the child resource.

          • resourceType (string) –

            The type of the child resource.

          • resourceName (string) –

            The name of the child resource.

          • ownerAccountId (string) –

            The Amazon Web Services account ID of the member who owns the child resource.

          • resourceStatus (string) –

            The current status of the child resource.

      • createTime (datetime) –

        The time the intermediate table was created.

      • updateTime (datetime) –

        The time the intermediate table was last updated.

      • status (string) –

        The current status of the intermediate table.

      • statusReason (string) –

        The reason for the current status of the intermediate table.

      • kmsKeyArn (string) –

        The Amazon Resource Name (ARN) of the KMS key used to encrypt the intermediate table data.

      • populationAnalysisConfiguration (dict) –

        The analysis configuration that defines the query used to populate the intermediate table.

        Note

        This is a Tagged Union structure. Only one of the following top level keys will be set: sqlParameters. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
        
        • sqlParameters (dict) –

          The SQL parameters for the population analysis, including the query string or analysis template ARN.

          • queryString (string) –

            The SQL query string used to populate the intermediate table. Maximum length of 500,000 characters.

          • analysisTemplateArn (string) –

            The Amazon Resource Name (ARN) of the analysis template to use for populating the intermediate table.

      • retentionInDays (integer) –

        The number of days that populated data is retained before expiring.

      • tableDependencies (list) –

        The list of base tables that this intermediate table depends on.

        • (dict) –

          Contains information about a base table that an intermediate table depends on.

          • id (string) –

            The unique identifier of the dependency table.

          • name (string) –

            The name of the dependency table.

          • type (string) –

            The type of the dependency table.

          • parentType (string) –

            Whether the dependency is direct or indirect. A direct dependency is a table explicitly referenced in the stored query, while an indirect dependency is referenced through another intermediate table.

          • creatorAccountId (string) –

            The Amazon Web Services account ID of the member who owns the dependency table.

      • intermediateTableVersion (dict) –

        The details of the currently active version of the intermediate table.

        • versionId (string) –

          The unique identifier of the active version.

        • analysisId (string) –

          The identifier of the protected query that created this version.

        • analysisType (string) –

          The type of analysis that created this version.

        • kmsKeyArn (string) –

          The Amazon Resource Name (ARN) of the KMS key used to encrypt this version’s data.

        • parameters (dict) –

          The runtime parameters that were used when populating this version.

          • (string) –

            • (string) –

        • inheritedConstraints (dict) –

          The privacy constraints inherited from parent tables at the time this version was populated.

          • additionalAnalyses (dict) –

            The inherited additional analyses constraint.

            • value (string) –

              The effective additional analyses setting inherited from parent tables.

            • sources (list) –

              The list of parent tables that contribute to this inherited constraint.

              • (dict) –

                Contains information about a parent table that contributes an additional analyses constraint.

                • name (string) –

                  The name of the parent table.

                • id (string) –

                  The unique identifier of the parent table.

                • type (string) –

                  The type of the parent table.

                • value (string) –

                  The additional analyses setting defined on the parent table.

                • sourceAccountId (string) –

                  The Amazon Web Services account ID of the member who owns the parent table.

          • allowedAdditionalAnalyses (dict) –

            The inherited allowed additional analyses constraint.

            • value (list) –

              The effective list of allowed additional analyses inherited from parent tables.

              • (string) –

            • sources (list) –

              The list of parent tables that contribute to this inherited constraint.

              • (dict) –

                Contains information about a parent table that contributes an allowed additional analyses constraint.

                • name (string) –

                  The name of the parent table.

                • id (string) –

                  The unique identifier of the parent table.

                • type (string) –

                  The type of the parent table.

                • value (list) –

                  The allowed additional analyses defined on the parent table.

                  • (string) –

                • sourceAccountId (string) –

                  The Amazon Web Services account ID of the member who owns the parent table.

          • allowedResultReceivers (dict) –

            The inherited allowed result receivers constraint.

            • value (list) –

              The effective list of Amazon Web Services account IDs allowed to receive results, inherited from parent tables.

              • (string) –

            • sources (list) –

              The list of parent tables that contribute to this inherited constraint.

              • (dict) –

                Contains information about a parent table that contributes an allowed result receivers constraint.

                • name (string) –

                  The name of the parent table.

                • id (string) –

                  The unique identifier of the parent table.

                • type (string) –

                  The type of the parent table.

                • value (list) –

                  The allowed result receiver account IDs defined on the parent table.

                  • (string) –

                • sourceAccountId (string) –

                  The Amazon Web Services account ID of the member who owns the parent table.

          • disallowedOutputColumns (dict) –

            The inherited disallowed output columns constraint.

            • value (list) –

              The list of column names that are disallowed from appearing in query output, inherited from parent tables.

              • (string) –

            • columnLineage (list) –

              The lineage information that traces each disallowed output column back to its source in a parent table.

              • (dict) –

                Contains column lineage information that traces a disallowed output column back to its source in a base table.

                • column (string) –

                  The name of the column in the intermediate table.

                • sourceColumn (string) –

                  The name of the column in the source table.

                • sourceName (string) –

                  The name of the source table.

                • sourceId (string) –

                  The unique identifier of the source table.

                • sourceType (string) –

                  The type of the source table.

                • sourceAccountId (string) –

                  The Amazon Web Services account ID of the owner of the source table.

        • expirationTime (datetime) –

          The time when this version expires based on the retention period.

      • analysisRuleTypes (list) –

        The types of analysis rules associated with the intermediate table.

        • (string) –

      • schema (dict) –

        The schema of the intermediate table, containing column definitions. Available after the table has been successfully populated.

        • columns (list) –

          The list of columns in the intermediate table schema.

          • (dict) –

            A column within a schema relation, derived from the underlying table.

            • name (string) –

              The name of the column.

            • type (string) –

              The type of the column.

Exceptions