Profile MySQL Date Columns using DataBrew programmatically

0

Hi,

I'm trying to programmatically kick off a DataBrew profile job using AWS SDK from my java application. I need to profile MySQL database tables. While I'm able to do that from my application, I see that date columns aren't getting profiled. I couldn't find a way to cast a date column as String when creating the dataset or in the profile configuration. Is there a way I can do this?

Thanks, Meena

Meena
已提問 6 個月前檢視次數 193 次
2 個答案
0

Dear Customer,

From your case correspondence, I understand you're attempting to launch a databrew profile job programmatically from a Java application using the AWS SDK. So you need to profile your SQL database tables, and you mentioned that while you can do so from your application, the date columns aren't getting profiled, so you couldn't find a way to cast a date column as a String when creating the dataset or in the profile configuration, so you were wondering if there was a way.

With regards to your question:

I was able to search internal and I was able to see that There is currently no way to cast a date column as a string when creating a dataset or in the profile configuration in DataBrew.

One workaround is to use a SQL query to cast the date column as a string before creating the dataset. For example, if you are using the AWS JDBC driver to connect to your MySQL database, you could use the following SQL query:

============ SELECT CAST(date_column AS VARCHAR(255)) AS string_date_column FROM table_name;

I hope the above answers your question. Please let me know if you have any other questions regarding this case, I will be happy to help you.

已回答 6 個月前
profile picture
專家
已審閱 1 個月前
0

Thank you for the response. I have tried that already. Currently SQL query option is available only for Amazon RedShift and Snowflake datasources.

Meena
已回答 6 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南