awslabs / aws-glue-libs

AWS Glue Libraries are additions and enhancements to Spark for ETL operations.
Other
635 stars 300 forks source link

create_dynamic_frame_from_options encoding #105

Closed jhonnattan123 closed 2 years ago

jhonnattan123 commented 2 years ago

¿is it possible to include the encodig in the method create_dynamic_frame_from_options?

sourceDyf = glueContext.create_dynamic_frame_from_options(
    connection_type="s3",
    format="csv",
    connection_options={
        "paths": ["s3://bucket/folder"]
    },
    format_options={
        "withHeader": True,
        "separator": ","
    }
)
mcrysler commented 2 years ago

I, too, would like to be able to do this! Is there a way to include the encoding type when creating a dynamic frame?

moomindani commented 2 years ago

We apologize for delay.

Currently we only support UTF-8 for create_dynamic_frame.from_options method with some exception. Instead, you can use Spark DataFrame on Glue Spark job. Here's the sample script: https://github.com/aws-samples/aws-glue-samples/blob/master/examples/converting_char_encoding.md