Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.27.0
Description
Every DBMS imposes different limitation on supported data types and so does Redshift.
The Redshift documentation outlines various limitations around DECIMAL, CHAR, and VARCHAR types.
In some cases the JDBC adapter may generate type casts exceeding the bounds and leading to runtime errors.
Below some sample queries (executed directly on Redshift) and the respective error.
select cast (col1 as varchar(65536)) from test;
Error: [Amazon](500310) Invalid operation: length for type varchar cannot exceed 65535; (state=22023,code=500310)
select cast (col1 as char(65536)) from test;
Error: [Amazon](500310) Invalid operation: length for type bpchar cannot exceed 4096; (state=22023,code=500310)
select cast (col2 as decimal(39)) from test;
Error: [Amazon](500310) Invalid operation: DECIMAL precision 39 must be between 1 and 38; (state=22023,code=500310)
select cast (col2 as decimal(38,39)) from test;
Error: [Amazon](500310) Invalid operation: DECIMAL scale 39 must be between 0 and 37; (state=22023,code=500310)
Attachments
Issue Links
- relates to
-
CALCITE-5650 Obtain typesystem from dialect in RelToSqlConverterTest
- Closed
- links to