You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.IllegalArgumentException: Cannot append java.time.LocalDateTime to DateTimeColumn at tech.tablesaw.api.InstantColumn.appendObj(InstantColumn.java:276) at tech.tablesaw.api.InstantColumn.appendObj(InstantColumn.java:60)
I study the code, it seems that InstantColumn not support LocalDateTime type
@Override public InstantColumn appendObj(Object obj) { if (obj == null) { return appendMissing(); } if (obj instanceof Instant) { return append((Instant) obj); } if (obj instanceof Timestamp) { Timestamp timestamp = (Timestamp) obj; return append(timestamp.toInstant()); } throw new IllegalArgumentException( "Cannot append " + obj.getClass().getName() + " to DateTimeColumn"); }
The text was updated successfully, but these errors were encountered:
Hi @Robert-Qiu. It seems the jdbc driver reports the ColumnType as TIMESTAMP and returns a LocalDateTime object (instead of a java.sql.Timestamp) for DATETIME columns.
This is currently not supported, but you should be able to force the column type by calling this before reading from the db:
the exception is
java.lang.IllegalArgumentException: Cannot append java.time.LocalDateTime to DateTimeColumn at tech.tablesaw.api.InstantColumn.appendObj(InstantColumn.java:276) at tech.tablesaw.api.InstantColumn.appendObj(InstantColumn.java:60)
I study the code, it seems that InstantColumn not support LocalDateTime type
@Override public InstantColumn appendObj(Object obj) { if (obj == null) { return appendMissing(); } if (obj instanceof Instant) { return append((Instant) obj); } if (obj instanceof Timestamp) { Timestamp timestamp = (Timestamp) obj; return append(timestamp.toInstant()); } throw new IllegalArgumentException( "Cannot append " + obj.getClass().getName() + " to DateTimeColumn"); }
The text was updated successfully, but these errors were encountered: