title: Adding timestamp column in AWS Glue Job
body: <p>I'm still pretty new to this. I am trying to add a new column for a timestamp in AWS Glue. I'm getting an error that "timestamped4" is not defined but isn't it defined when I use DynamicFrame.fromDF? Any help would be greatly appreciated. Thank you in advance.</p>
  
  <pre><code>import sys
  from awsglue.transforms import *
  from awsglue.utils import getResolvedOptions
  from pyspark.context import SparkContext
  from awsglue.context import GlueContext, DynamicFrame
  from awsglue.job import Job
  from pyspark.sql.functions import current_timestamp
  
  
  ## @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 = "unimintest", table_name = "adsdsilo_xml", transformation_ctx = "datasource0")
  applymapping1 = ApplyMapping.apply(frame = datasource0, mappings = [("capacity", "int", "capacity", "int"), ("product", "string", "product", "string"), ("quantity", "int", "quantity", "int"), ("uom", "string", "uom", "string"), ("_id", "string", "_id", "string")], transformation_ctx = "applymapping1")
  resolvechoice2 = ResolveChoice.apply(frame = applymapping1, choice = "make_cols", transformation_ctx = "resolvechoice2")
  dropnullfields3 = DropNullFields.apply(frame = resolvechoice2, transformation_ctx = "dropnullfields3")
  
  timestampedDf = dropnullfields3.toDF().withColumn("TimeStamp", current_timestamp())
  timestamped4 = DynamicFrame.fromDF(timestampedDf, glueContext, timestamped4)
  
  datasink4 = glueContext.write_dynamic_frame.from_jdbc_conf(frame = timestamped4, catalog_connection = "con1", connection_options = {"dbtable": "silo_xml", "database": "MyRDS"}, transformation_ctx = "datasink4")
  job.commit()
  </code></pre>