在从csv转换为镶木地板时,使用csv中映射的字段后的AWS粘合ETL作业读取为日期和时间类型的字符串。 这是实际的csv文件
while converting from csv to parquet, using AWS glue ETL job following mapped fields in csv read as string to date and time type. this is the actual csv file
在映射和转换后,提交的日期为空,时间与今天的日期连接在一起
after mapping and converting, date filed is empty and time is concatenated with today's date
如何使用正确的日期和时间格式进行转换?
How to convert with proper date and time format?
推荐答案它使用presto数据类型,因此数据应采用正确的格式
It uses presto datatypes so data should be in correct format
DATE日历日期(年,月,日)。
DATE Calendar date (year, month, day).
示例:日期'2001-08-22'
Example: DATE '2001-08-22'
时间一天中的时间(小时,分钟,秒,英里一秒钟)没有时间区域。这种类型的值在会话时间区域中解析和呈现。
TIME Time of day (hour, minute, second, millisecond) without a time zone. Values of this type are parsed and rendered in the session time zone.
示例:TIME '01:02:03.456'
Example: TIME '01:02:03.456'
TIMESTAMP即时时间,其中包括的日期和时间,没有时区。此类值会在会话时区中解析并呈现。
TIMESTAMP Instant in time that includes the date and time of day without a time zone. Values of this type are parsed and rendered in the session time zone.
示例:TIMESTAMP'2001-08-22 03:04:05.321'
Example: TIMESTAMP '2001-08-22 03:04:05.321'
您可以使用
df = df.withColumn(col, to_timestamp(col, 'dd-MM-yyyy HH:mm')) df = df.withColumn(col, to_date(col, 'dd-MM-yyyy')) df = df.withColumn(col, date_format(col, 'HH:mm:ss'))更多推荐
AWS胶粘作业将字符串映射为日期和时间格式,同时从CSV转换为拼花
发布评论