Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NulledExceptions/26147bf12855e5a7de86dd081d2cad06 to your computer and use it in GitHub Desktop.
Save NulledExceptions/26147bf12855e5a7de86dd081d2cad06 to your computer and use it in GitHub Desktop.

Revisions

  1. @ejlp12 ejlp12 revised this gist Nov 15, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion aws_glue_boto3_example.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ response = client.create_crawler(
    Targets={
    'S3Targets': [
    {
    'Path': 's3://eryan-etl-demo-bucket/data/csv',
    'Path': 's3://ejlp12-etl-demo-bucket/data/csv',
    'Exclusions': [
    ]
    },
  2. @ejlp12 ejlp12 revised this gist Nov 15, 2018. No changes.
  3. @ejlp12 ejlp12 created this gist Nov 15, 2018.
    47 changes: 47 additions & 0 deletions aws_glue_boto3_example.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    ```
    import boto3
    client = boto3.client('glue')
    response = client.create_crawler(
    Name='SalesCSVCrawler',
    Role='AWSGlueServiceRoleDefault',
    DatabaseName='sales-cvs',
    Description='Crawler for generated Sales schema',
    Targets={
    'S3Targets': [
    {
    'Path': 's3://eryan-etl-demo-bucket/data/csv',
    'Exclusions': [
    ]
    },
    ]
    },
    SchemaChangePolicy={
    'UpdateBehavior': 'UPDATE_IN_DATABASE',
    'DeleteBehavior': 'DELETE_FROM_DATABASE'
    }
    #,Configuration='{ "Version": 1.0, "CrawlerOutput": { "Partitions": { "AddOrUpdateBehavior": "InheritFromTable" } } }'
    )
    response = client.start_crawler(
    Name='SalesCSVCrawler'
    )
    response = client.update_table(
    DatabaseName='sales-cvs',
    TableInput={
    'Name': 'csv',
    'Description': 'Table Sales',
    'StorageDescriptor': {
    'SerdeInfo': {
    'Name': 'OpenCSVSerde',
    'SerializationLibrary': 'org.apache.hadoop.hive.serde2.OpenCSVSerde',
    'Parameters': {
    'separatorChar': ','
    }
    }
    }
    }
    )
    ```