trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.19k stars 2.94k forks source link

Flaky TestDeltaLakeDeleteCompatibility.testDeletionVectors #23229

Open ebyhr opened 2 weeks ago

ebyhr commented 2 weeks ago

https://github.com/trinodb/trino/actions/runs/10654242163/job/29530504757

tests               | 2024-09-01 19:52:55 WARNING: not retrying; stacktrace does not match pattern '\Q[Databricks][\E(DatabricksJDBCDriver|JDBCDriver)\Q](500593) Communication link failure. Failed to connect to server. Reason: \E((HTTP retry after response received with no Retry-After header, error: HTTP Response code: 503|HTTP Response code: 504), Error message: Unknown.|java.net.SocketTimeoutException: Read timed out.)': [java.lang.AssertionError: Expected row count to be <2>, but was <3>; rows=[[1, 11], [30, -1], [2, -1]]
tests               |   at io.trino.tests.product.deltalake.TestDeltaLakeDeleteCompatibility.testDeletionVectors(TestDeltaLakeDeleteCompatibility.java:265)
tests               |   at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
tests               |   at java.base/java.lang.reflect.Method.invoke(Method.java:580)
tests               |   at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
tests               |   at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
tests               |   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
tests               |   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
tests               |   at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
tests               |   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
tests               |   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
tests               |   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
tests               |   at java.base/java.lang.Thread.run(Thread.java:1570)
tests               | ]
tests               | 2024-09-01 19:52:55 INFO: Test io.trino.tests.product.deltalake.TestDeltaLakeDeleteCompatibility.testDeletionVectors [none] took 49.84s
tests               | 2024-09-01 19:52:55 INFO: FAILURE     /    io.trino.tests.product.deltalake.TestDeltaLakeDeleteCompatibility.testDeletionVectors [none] (Groups: profile_specific_tests, delta-lake-exclude-91, delta-lake-databricks, delta-lake-oss) took 49.9 seconds
tests               | 2024-09-01 19:52:55 SEVERE: Failure cause:
tests               | java.lang.AssertionError: Expected row count to be <2>, but was <3>; rows=[[1, 11], [30, -1], [2, -1]]
tests               |   at io.trino.tests.product.deltalake.TestDeltaLakeDeleteCompatibility.testDeletionVectors(TestDeltaLakeDeleteCompatibility.java:265)
tests               |   at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
tests               |   at java.base/java.lang.reflect.Method.invoke(Method.java:580)
tests               |   at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
tests               |   at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
tests               |   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
tests               |   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
tests               |   at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
tests               |   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
tests               |   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
tests               |   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
tests               |   at java.base/java.lang.Thread.run(Thread.java:1570)
ebyhr commented 2 weeks ago

delta_dv_incorrect_result.zip returns the different results between Trino and Spark. Spark returns incorrect results while Trino returns correct results since transaction version 6.

Spark writes only commitInfo and remove entries if we redo the same DELETE FROM table WHERE a = 2 at version 6.

{"commitInfo":{"timestamp":1725257090082,"operation":"DELETE","operationParameters":{"predicate":"[\"(a#4634 = 1)\"]"},"readVersion":5,"isolationLevel":"Serializable","isBlindAppend":false,"operationMetrics":{"numRemovedFiles":"1","numRemovedBytes":"0","numCopiedRows":"0","numDeletionVectorsAdded":"0","numDeletionVectorsRemoved":"1","numAddedChangeFiles":"0","executionTimeMs":"829","numDeletionVectorsUpdated":"0","numDeletedRows":"1","scanTimeMs":"0","numAddedFiles":"0","numAddedBytes":"0","rewriteTimeMs":"0"},"engineInfo":"Apache-Spark/3.5.0 Delta-Lake/3.2.0","txnId":"99f9db95-be29-46af-9c52-8589e736336c"}}
{"remove":{"path":"Me/part-00000-ef631572-1456-4aea-b6dd-5a810330a4ed-c000.snappy.parquet","deletionTimestamp":1725257090052,"dataChange":true,"extendedFileMetadata":true,"partitionValues":{},"size":1284,"tags":{"INSERTION_TIME":"1725256234000000","MIN_INSERTION_TIME":"1725256234000000","MAX_INSERTION_TIME":"1725256234000000","OPTIMIZE_TARGET_SIZE":"268435456"},"deletionVector":{"storageType":"u","pathOrInlineDv":"gP!4Wwd7*eKUO5n%6{)^","offset":1,"sizeInBytes":34,"cardinality":1},"stats":"{\"numRecords\":2}"}}

Strangely, the pathOrInlineDv is equivalent to the value in version 2.