Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

update typeAliases #8

Merged
merged 1 commit into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions pgjdbc/src/main/java/io/materialize/jdbc/TypeInfoCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,28 @@ public class TypeInfoCache implements TypeInfo {

static {
typeAliases = new HashMap<String, String>();
typeAliases.put("boolean", "bool");

typeAliases.put("smallint", "int2");

typeAliases.put("i32", "int4");
typeAliases.put("integer", "int4");
typeAliases.put("int", "int4");
typeAliases.put("bigint", "int8");
typeAliases.put("float", "float8");
typeAliases.put("boolean", "bool");
typeAliases.put("decimal", "numeric");

typeAliases.put("i32", "int4");
typeAliases.put("i64", "int8");
typeAliases.put("bigint", "int8");

typeAliases.put("f32", "float4");
typeAliases.put("real", "float4");

typeAliases.put("f64", "float8");
typeAliases.put("double precision", "float8");
typeAliases.put("double", "float8");
typeAliases.put("float", "float8");

typeAliases.put("decimal", "numeric");

typeAliases.put("text", "varchar");
typeAliases.put("string", "varchar");
}

Expand Down
6 changes: 5 additions & 1 deletion pgjdbc/src/main/java/io/materialize/util/StreamWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ protected void finalize() throws IOException {
// forcibly close it because super.finalize() may keep the FD open, which may prevent
// file deletion
close();
super.finalize();
try {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to make this change to build the jar locally!

super.finalize();
} catch (Throwable t) {
throw new IOException(t);
}
}
};
} else {
Expand Down