fix(ingest): redshift - mapping for spectrum external array types (#3890)

This commit is contained in:
Tamas Nemeth 2022-01-14 21:23:57 +01:00 committed by GitHub
parent e95446be1c
commit 2daa06a58f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -273,6 +273,7 @@ def _get_schema_column_info(self, connection, schema=None, **kw):
CASE
WHEN external_type = 'int' THEN 'integer'
ELSE
regexp_replace(
replace(
replace(
replace(
@ -283,7 +284,8 @@ def _get_schema_column_info(self, connection, schema=None, **kw):
'string', 'character varying'),
'char(', 'character('),
'float', 'real'),
'double', 'float')
'double', 'float'),
'^array<(.*)>$', '$1[]', 1, 'p')
END AS "type",
null as "distkey",
0 as "sortkey",
@ -294,6 +296,7 @@ def _get_schema_column_info(self, connection, schema=None, **kw):
CASE
WHEN external_type = 'int' THEN 'integer'
ELSE
regexp_replace(
replace(
replace(
replace(
@ -304,7 +307,8 @@ def _get_schema_column_info(self, connection, schema=None, **kw):
'string', 'character varying'),
'char(', 'character('),
'float', 'real'),
'double', 'float')
'double', 'float'),
'^array<(.*)>$', '$1[]', 1, 'p')
END AS "format_type",
null as "default",
null as "schema_oid",