[英]What is time data type in redshift external table?
the create statement:创建语句:
CREATE EXTERNAL TABLE gastronomy_labor_model.brand_fixed_hours_settings (
id int,
something_time time,
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS
INPUTFORMAT 'org.apache.hudi.hadoop.HoodieParquetInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION .......;
results this error:结果这个错误:
SQL Error [42804]: ERROR: Unsupported data type "pg_catalog.time" for external table creation
SQL 错误 [42804]:错误:外部表创建不支持数据类型“pg_catalog.time”
what can I use in Redshift as data type to store time format 03:13:00我可以在 Redshift 中使用什么作为数据类型来存储时间格式03:13:00
Valid data types in Redshift are: Redshift 中的有效数据类型是:
SMALLINT (INT2)
INTEGER (INT, INT4)
BIGINT (INT8)
DECIMAL (NUMERIC)
REAL (FLOAT4)
DOUBLE PRECISION (FLOAT8)
BOOLEAN (BOOL)
CHAR (CHARACTER)
VARCHAR (CHARACTER VARYING)
VARBYTE (CHARACTER VARYING) – can be used with Parquet and ORC data files, and only with non-partition columns.
DATE – can be used only with text, Parquet, or ORC data files, or as a partition column.
TIMESTAMP
For DATE, you can use the formats as described following.对于 DATE,您可以使用如下所述的格式。 For month values represented using digits, the following formats are supported:
对于使用数字表示的月份值,支持以下格式:
mm-dd-yyyy For example, 05-01-2017. mm-dd-yyyy 例如,05-01-2017。 This is the default.
这是默认设置。
yyyy-mm-dd, where the year is represented by more than 2 digits. yyyy-mm-dd,其中年份由 2 位以上的数字表示。 For example, 2017-05-01.
例如,2017-05-01。
For month values represented using the three letter abbreviation, the following formats are supported:对于使用三个字母缩写表示的月份值,支持以下格式:
mmm-dd-yyyy For example, may-01-2017. mmm-dd-yyyy 例如,may-01-2017。 This is the default.
这是默认设置。
dd-mmm-yyyy, where the year is represented by more than 2 digits. dd-mmm-yyyy,其中年份由 2 位以上的数字表示。 For example, 01-may-2017.
例如,2017 年 5 月 1 日。
yyyy-mmm-dd, where the year is represented by more than 2 digits. yyyy-mmm-dd,其中年份由 2 位以上的数字表示。 For example, 2017-may-01.
例如,2017 年 5 月 1 日。
More info here:更多信息在这里:
https://docs.aws.amazon.com/redshift/latest/dg/r_DATEFORMAT_and_TIMEFORMAT_strings.html https://docs.aws.amazon.com/redshift/latest/dg/r_DATEFORMAT_and_TIMEFORMAT_strings.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.