title: Adding timestamp column in importing data in redshift using AWS Glue Job
body: <p>I would like to know if it is possible to add a timestamp column in a table when it is loaded by an AWS Glue Job.</p>
  
  <p>First Scenario:</p>
  
  <blockquote>
    <p>Column A | Column B| TimeStamp </p>
    
    <p>A|2|2018-06-03 23:59:00.0</p>
  </blockquote>
  
  <p>When a Crawler updates the table in the data catalog and run the job again, the table will add the new data in the table with a new time stamp..</p>
  
  <blockquote>
    <p>Column A | Column B| TimeStamp </p>
    
    <p>A|4|2018-06-04 05:01:31.0</p>
    
    <p>B|8|2018-06-04 06:02:31.0</p>
  </blockquote>
  
  <pre><code>import sys
  from awsglue.transforms import *
  from awsglue.utils import getResolvedOptions
  from pyspark.context import SparkContext
  from awsglue.context import GlueContext
  from awsglue.job import Job
  
  ## @params: [TempDir, JOB_NAME]
  args = getResolvedOptions(sys.argv, ['TempDir','JOB_NAME'])
  
  sc = SparkContext()
  glueContext = GlueContext(sc)
  spark = glueContext.spark_session
  job = Job(glueContext)
  job.init(args['JOB_NAME'], args)
  
  datasource0 = glueContext.create_dynamic_frame.from_catalog(database = "sampledb", table_name = "abs", transformation_ctx = "datasource0")
  applymapping1 = ApplyMapping.apply(frame = datasource0, mappings = [("ColumnA", "char", "ColumnA", "char"), ("ColumnB", "char", "ColumnB", "char")], transformation_ctx = "applymapping1")
  resolvechoice2 = ResolveChoice.apply(frame = applymapping1, choice = "make_cols", transformation_ctx = "resolvechoice2")
  dropnullfields3 = DropNullFields.apply(frame = resolvechoice2, transformation_ctx = "dropnullfields3")
  datasink4 = glueContext.write_dynamic_frame.from_jdbc_conf(frame = dropnullfields3, catalog_connection = "TESTDB", connection_options = {"dbtable": "TABLEA", "database": "anasightprd01"}, redshift_tmp_dir = args["TempDir"], transformation_ctx = "datasink4")
  </code></pre>