Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColumnStatistics on Previewed Column May throw IllegalArgumentException #4825

Closed
nbauernfeind opened this issue Nov 14, 2023 · 1 comment · Fixed by #4828
Closed

ColumnStatistics on Previewed Column May throw IllegalArgumentException #4825

nbauernfeind opened this issue Nov 14, 2023 · 1 comment · Fixed by #4828
Assignees
Labels
bug Something isn't working core Core development tasks
Milestone

Comments

@nbauernfeind
Copy link
Member

Simply groovy:

dh_table = emptyTable(10000).update(
    "someDateColumn = i % 10 == 0 ? null : java.time.LocalDate.ofEpochDay(i)",
    "nullDateColumn = (java.time.LocalDate)null",
    "someTimeColumn = i % 10 == 0 ? null : java.time.LocalTime.of(i%24, i%60, (i+10)%60)",
    "nullTimeColumn = (java.time.LocalTime)null"
)

(P.S. yes, I stole this from Jianfeng's writeup of #4823)

Then, however over any of the four columns to get this wicked IllegalArgumentException:

Internal Error '5bca3466-9f64-48f5-923e-a30189d8a57d' java.lang.IllegalArgumentException: Equal objects must have equal hashcodes. During rehashing, Trove discovered that the following two objects claim to be equal (as in java.lang.Object.equals()) but their hashCodes (or those calculated by your TObjectHashingStrategy) are not equal.This violates the general contract of java.lang.Object.hashCode().  See bullet point two in that method's documentation. object #1 =class io.deephaven.engine.table.impl.preview.DisplayWrapper id= 1391026345 hashCode= 1391026345 toString= 00:24:34; object #2 =class io.deephaven.engine.table.impl.preview.DisplayWrapper id= 1968006525 hashCode= 1968006525 toString= 00:24:34

	at gnu.trove.impl.hash.TObjectHash.buildObjectContractViolation(TObjectHash.java:464)
	at gnu.trove.impl.hash.TObjectHash.throwObjectContractViolation(TObjectHash.java:426)
	at gnu.trove.map.hash.TObjectLongHashMap.rehash(TObjectLongHashMap.java:191)
	at gnu.trove.impl.hash.THash.postInsertHook(THash.java:388)
	at gnu.trove.map.hash.TObjectLongHashMap.adjustOrPutValue(TObjectLongHashMap.java:456)
	at io.deephaven.server.table.stats.ObjectChunkedStats.processChunks(ObjectChunkedStats.java:55)
	at io.deephaven.server.table.ops.ColumnStatisticsGrpcImpl.lambda$create$0(ColumnStatisticsGrpcImpl.java:106)
	at io.deephaven.engine.table.impl.remote.ConstructSnapshot.callDataSnapshotFunction(ConstructSnapshot.java:1193)
	at io.deephaven.engine.table.impl.remote.ConstructSnapshot.callDataSnapshotFunction(ConstructSnapshot.java:1169)
	at io.deephaven.server.table.ops.ColumnStatisticsGrpcImpl.create(ColumnStatisticsGrpcImpl.java:102)
	at io.deephaven.server.table.ops.ColumnStatisticsGrpcImpl.create(ColumnStatisticsGrpcImpl.java:32)
	at io.deephaven.server.table.ops.TableServiceGrpcImpl.lambda$oneShotOperationWrapper$9(TableServiceGrpcImpl.java:629)
	at io.deephaven.server.session.SessionState$ExportObject.doExport(SessionState.java:974)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at io.deephaven.server.runner.scheduler.SchedulerModule$ThreadFactory.lambda$newThread$0(SchedulerModule.java:78)
	at java.base/java.lang.Thread.run(Thread.java:832)

I suspect we shouldn't generate stats for a previewed column - or if we do, do it on the original column (but probably not do it at all?).

@nbauernfeind nbauernfeind added bug Something isn't working core Core development tasks labels Nov 14, 2023
@nbauernfeind nbauernfeind added this to the November 2023 milestone Nov 14, 2023
@niloc132
Copy link
Member

Alternatively, the various PreviewType impls could delegate their hashcode/equals impls to the underlying object. Fixing #188 and its related subscription/preview cleanup will also resolve this.

niloc132 added a commit to niloc132/deephaven-core that referenced this issue Nov 14, 2023
niloc132 added a commit that referenced this issue Nov 14, 2023
stanbrub pushed a commit that referenced this issue Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Core development tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants