Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Handled default numeric of postgres (precision 0, scale 0)
  • Loading branch information
fpompermaier committed Apr 30, 2020
commit a9bfe785bfe71ef25457c83c0ef9b790a3a564d0
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void testPrimitiveTypes() throws Exception {
List<Row> results = TableUtils.collectToList(
tEnv.sqlQuery(String.format("select * from %s", TABLE_PRIMITIVE_TYPE)));

assertEquals("[1,[50],3,4,5.5,6.6,7.70000,true,a,b,c ,d,2016-06-22T19:10:25,2015-01-01,00:51:03]", results.toString());
assertEquals("[1,[50],3,4,5.5,6.6,7.70000,true,a,b,c ,d,2016-06-22T19:10:25,2015-01-01,00:51:03,500.000000000000000000]", results.toString());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.flink.table.api.DataTypes;
import org.apache.flink.table.api.TableSchema;
import org.apache.flink.table.types.logical.DecimalType;

import com.opentable.db.postgres.junit.EmbeddedPostgresRules;
import com.opentable.db.postgres.junit.SingleInstancePostgresRule;
Expand Down Expand Up @@ -174,6 +175,7 @@ public static TestTable getPrimitiveTable() {
// .field("timestamptz", DataTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE(4))
.field("date", DataTypes.DATE())
.field("time", DataTypes.TIME(0))
.field("default_numeric", DataTypes.DECIMAL(DecimalType.MAX_PRECISION, 18))
.build(),
"int integer, " +
"bytea bytea, " +
Expand All @@ -190,7 +192,8 @@ public static TestTable getPrimitiveTable() {
"timestamp timestamp(5), " +
// "timestamptz timestamptz(4), " +
"date date," +
"time time(0)",
"time time(0), " +
"default_numeric numeric ",
"1," +
"'2'," +
"3," +
Expand All @@ -206,7 +209,8 @@ public static TestTable getPrimitiveTable() {
"'2016-06-22 19:10:25'," +
// "'2006-06-22 19:10:25'," +
"'2015-01-01'," +
"'00:51:02.746572'"
"'00:51:02.746572', " +
"500"
);
}

Expand Down