Skip to content

Commit

Permalink
Merge pull request #62 from exasol/postgres_serial
Browse files Browse the repository at this point in the history
Support for Postgresql serial types (#61)
  • Loading branch information
snehlsen authored Jan 16, 2019
2 parents 8fcb163 + 96d2737 commit 736d370
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jdbc-adapter/doc/sql_dialects/impala.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Impala dialect is similar to the Hive dialect in most aspects. For this reas

You have to specify the following settings when adding the JDBC driver via EXAOperation:

* Name: `Hive`
* Name: `Impala`
* Main: `com.cloudera.impala.jdbc41.Driver`
* Prefix: `jdbc:impala:`

Expand Down
2 changes: 1 addition & 1 deletion jdbc-adapter/doc/sql_dialects/oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@ CREATE VIRTUAL SCHEMA virt_import_oracle USING adapter.jdbc_oracle WITH
CONNECTION_NAME = 'JDBC_ORACLE'
SCHEMA_NAME = '<schema>'
IMPORT_FROM_ORA = 'true'
EXA_CONNECTION_NAME = 'CONN_ORACLE';
ORA_CONNECTION_NAME = 'CONN_ORACLE';
```
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ private String getColumnProjectionStringNoCheckImpl(String typeName, SqlColumn c
projString = "CAST(" + projString + " as VARCHAR )";

}
else if (typeName.startsWith("smallserial")) {
projString = "CAST(" + projString + " as SMALLINT )";
}
else if (typeName.startsWith("serial")) {
projString = "CAST(" + projString + " as INTEGER )";
}
else if (typeName.startsWith("bigserial")) {
projString = "CAST(" + projString + " as BIGINT )";
}
else if (TYPE_NAME_NOT_SUPPORTED.contains(typeName)){

projString = "cast('"+typeName+" NOT SUPPORTED' as varchar) as not_supported"; //returning a string constant for unsupported data types
Expand Down Expand Up @@ -284,7 +293,7 @@ private boolean selectListRequiresCasts(SqlSelectList selectList) throws Adapter
return requiresCasts;
}

private static final List<String> TYPE_NAMES_REQUIRING_CAST = ImmutableList.of("varbit","point","line","lseg","box","path","polygon","circle","cidr","citext","inet","macaddr","interval","json","jsonb","uuid","tsquery", "tsvector","xml");
private static final List<String> TYPE_NAMES_REQUIRING_CAST = ImmutableList.of("varbit","point","line","lseg","box","path","polygon","circle","cidr","citext","inet","macaddr","interval","json","jsonb","uuid","tsquery", "tsvector","xml","smallserial","serial","bigserial");

private static final List<String> TYPE_NAME_NOT_SUPPORTED = ImmutableList.of("bytea");

Expand Down

0 comments on commit 736d370

Please sign in to comment.