https://docs.aws.amazon.com/ja_jp/glue/latest/dg/aws-glue-api-crawler-pyspark-extensions-dynamic-frame.html#aws-glue-api-crawler-pyspark-extensions-dynamic-frame-select_fields
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
import datetime
import pprint
glueContext = GlueContext(sc)
dynamicframe = glueContext.create_dynamic_frame.from_options(
connection_type='mysql',
connection_options={
'url': database_url,
'user': user_name,
'password': password,
'dbtable': table_name
})
dynamicframe.select_fields(['hoge', 'foo']).show()
dynamicframe.show()
dynamicframe.count()
hoge = dynamicframe.toDF()
hoge = hoge.withColumn('hoge_id', lit(999))
dynamicframe = dynamicframe.fromDF(hoge,glueContext ,dynamicframe)