Issue with extracting specific value from a column using regex in AWS Glue Visual editor

0

Enter image description here Hello AWS Community,

I'm encountering an issue while attempting to extract a specific value from a column in AWS Glue using regex extractor transform. Here's the scenario: I have a column named "ratings" in my dataset, which contains values in the format: {"double":7.8, "int":null}. My goal is to extract only the numeric value, in this case, 7.8, from each entry in the "ratings" column.

I've tried using the following regex pattern in my AWS Glue job: {"double":(\d+.\d+),.*} in script its written as :

# Script generated for node Regex Extractor
RegexExtractor_node1714964254635 = ChangeSchema_node1714963947870.gs_regex_extract(colName="rating.average", regex="{"double":(\d+\.\d+),.*}", newCols="ratings")

However, I'm consistently encountering a syntax error with this pattern.

Could you please assist me in correcting the regex pattern or suggest an alternative approach to achieve this extraction within an AWS Glue Visual or Script?

Thank you in advance for your help!

asked 25 days ago35 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions