exasol / athena-virtual-schema

Virtual Schema for connecting Athena as a data source to Exasol
MIT License
0 stars 1 forks source link

Describe a way to speciify String data type length #4

Closed AnastasiiaSergienko closed 3 years ago

AnastasiiaSergienko commented 3 years ago

Problem

The users have problems because of the default length of the String data type reported by the JDBC driver (255).

Solution to describe

We map the columns according to the information we get from the JDBC driver. So in the case of Athena String data type, the driver reports the length 255 by default:

https://www.simba.com/products/Athena/doc/JDBC_InstallGuide/content/jdbc/ath/options/stringcolumnlength.htm

The driver also provides a way to change this value. You need to specify the argument in the connection string. For example, I want to set my String column's length to 1000. This is my connection:

CREATE OR REPLACE CONNECTION ATHENA_CONNECTION TO 'jdbc:awsathena://AwsRegion=eu-west-1;S3OutputLocation=s3://virtual-schemas-test-bucket-2/test/sampledb;StringColumnLength=1000' USER 'user' IDENTIFIED BY 'pass';

When I use this connection, all String columns in Virtual Schema have size 1000 instead of the default 255.