简体   繁体   English

redshift 外部表中的时间数据类型是什么?

[英]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.

相关问题 Redshift 显示外部表的 0 行,但在 Athena 中可以查看数据 - Redshift showing 0 rows for external table, though data is viewable in Athena Firebase 分析数据到 Redshift - BigQuery RECORD 数据类型到 Redshift - Firebase Analytics data to Redshift - BigQuery RECORD data type to Redshift 如何更改 Redshift 中的列数据类型? - How do I change column data type in Redshift? 在 Redshift 上更新表的正确语法是什么? (代码示例) - What is the right syntax for updating table on Redshift? (code example) 在 Amazon Redshift 中使用实体化视图比使用基表有什么优势? - What is the advantage of using a Materialized View over a base table in Amazon Redshift? 如何取消透视大型 AWS Redshift 表 - how to unpivot large AWS Redshift table 使用 Redshift 读取没有清单文件的增量表 - Reading a Delta Table with no Manifest File using Redshift Firebase Firestore“参考”数据类型有什么用? - What is Firebase Firestore 'Reference' data type good for? 以特定分区格式将数据卸载到 redshift - Unload data into redshift in a specific partition format Pandas 时间戳列列读取红移时出现问题 - Pandas time stamp column column having issues reading to redshift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM