Class: AWSCDK::Glue::CfnCrawler::SchemaChangePolicyProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
glue/cfn_crawler.rb

Overview

The policy that specifies update and delete behaviors for the crawler.

The policy tells the crawler what to do in the event that it detects a change in a table that already exists in the customer's database at the time of the crawl. The SchemaChangePolicy does not affect whether or how new tables and partitions are added. New tables and partitions are always created regardless of the SchemaChangePolicy on a crawler.

The SchemaChangePolicy consists of two components, UpdateBehavior and DeleteBehavior .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delete_behavior: nil, update_behavior: nil) ⇒ SchemaChangePolicyProperty

Returns a new instance of SchemaChangePolicyProperty.

Parameters:

  • delete_behavior (String, nil) (defaults to: nil)

    The deletion behavior when the crawler finds a deleted object.

  • update_behavior (String, nil) (defaults to: nil)

    The update behavior when the crawler finds a changed schema.



1365
1366
1367
1368
1369
1370
# File 'glue/cfn_crawler.rb', line 1365

def initialize(delete_behavior: nil, update_behavior: nil)
  @delete_behavior = delete_behavior
  Jsii::Type.check_type(@delete_behavior, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "deleteBehavior") unless @delete_behavior.nil?
  @update_behavior = update_behavior
  Jsii::Type.check_type(@update_behavior, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "updateBehavior") unless @update_behavior.nil?
end

Instance Attribute Details

#delete_behaviorString? (readonly)

The deletion behavior when the crawler finds a deleted object.

A value of LOG specifies that if a table or partition is found to no longer exist, do not delete it, only log that it was found to no longer exist.

A value of DELETE_FROM_DATABASE specifies that if a table or partition is found to have been removed, delete it from the database.

A value of DEPRECATE_IN_DATABASE specifies that if a table has been found to no longer exist, to add a property to the table that says "DEPRECATED" and includes a timestamp with the time of deprecation.



1382
1383
1384
# File 'glue/cfn_crawler.rb', line 1382

def delete_behavior
  @delete_behavior
end

#update_behaviorString? (readonly)

The update behavior when the crawler finds a changed schema.

A value of LOG specifies that if a table or a partition already exists, and a change is detected, do not update it, only log that a change was detected. Add new tables and new partitions (including on existing tables).

A value of UPDATE_IN_DATABASE specifies that if a table or partition already exists, and a change is detected, update it. Add new tables and partitions.



1391
1392
1393
# File 'glue/cfn_crawler.rb', line 1391

def update_behavior
  @update_behavior
end

Class Method Details

.jsii_propertiesObject



1393
1394
1395
1396
1397
1398
# File 'glue/cfn_crawler.rb', line 1393

def self.jsii_properties
  {
    :delete_behavior => "deleteBehavior",
    :update_behavior => "updateBehavior",
  }
end

Instance Method Details

#to_jsiiObject



1400
1401
1402
1403
1404
1405
1406
1407
# File 'glue/cfn_crawler.rb', line 1400

def to_jsii
  result = {}
  result.merge!({
    "deleteBehavior" => @delete_behavior,
    "updateBehavior" => @update_behavior,
  })
  result.compact
end