diff --git a/backend/src/main/java/com/bakdata/conquery/sql/execution/DefaultResultSetProcessor.java b/backend/src/main/java/com/bakdata/conquery/sql/execution/DefaultResultSetProcessor.java index f14fc852b9..b17d3db261 100644 --- a/backend/src/main/java/com/bakdata/conquery/sql/execution/DefaultResultSetProcessor.java +++ b/backend/src/main/java/com/bakdata/conquery/sql/execution/DefaultResultSetProcessor.java @@ -49,13 +49,13 @@ public Boolean getBoolean(ResultSet resultSet, int columnIndex) throws SQLExcept } @Override - public Number getDate(ResultSet resultSet, int columnIndex) throws SQLException { + public Integer getDate(ResultSet resultSet, int columnIndex) throws SQLException { String dateString = resultSet.getString(columnIndex); if (dateString == null) { return null; } DateReader dateReader = config.getLocale().getDateReader(); - return dateReader.parseToLocalDate(dateString).toEpochDay(); + return (int) dateReader.parseToLocalDate(dateString).toEpochDay(); } @Override @@ -129,6 +129,7 @@ private interface Getter { * For example, calling a primitives' ResultSet getter like getDouble, getInt etc. straightaway will never return null. */ private static T checkForNullElseGet(ResultSet resultSet, int columnIndex, Getter getter, Class resultType) throws SQLException { + if (resultSet.getObject(columnIndex) == null) { return null; } diff --git a/backend/src/main/java/com/bakdata/conquery/sql/execution/ResultSetProcessor.java b/backend/src/main/java/com/bakdata/conquery/sql/execution/ResultSetProcessor.java index 6581ec8b21..074716073d 100644 --- a/backend/src/main/java/com/bakdata/conquery/sql/execution/ResultSetProcessor.java +++ b/backend/src/main/java/com/bakdata/conquery/sql/execution/ResultSetProcessor.java @@ -19,7 +19,7 @@ public interface ResultSetProcessor { Boolean getBoolean(ResultSet resultSet, int columnIndex) throws SQLException; - Number getDate(ResultSet resultSet, int columnIndex) throws SQLException; + Integer getDate(ResultSet resultSet, int columnIndex) throws SQLException; List getDateRange(ResultSet resultSet, int columnIndex) throws SQLException;