JingsongLi opened a new pull request #10756: [FLINK-15465][FLINK-11964][table-runtime-blink] Fix hash table bugs URL: https://github.com/apache/flink/pull/10756 ## What is the purpose of the change & Brief change log - In BinaryHashBucketArea.insertToBucket. When BinaryHashTable.buildTableFromSpilledPartition."Build in memory hash table", it requires memory can put all records, if not, will fail. Because the linked hash conflict solution, the required memory calculation are not accurate, in this case, we should apply for insufficient memory from heap. And must be careful, the steal memory should not return to table. - In HybridHashTable, first select the corresponding partition according to hashCode, and then select the bucket in the partition according to hashCode, using the same hashCode can easily cause hash collision. Consider doing some mix to hashCode when choosing bucket. Like JDK HashMap, we can just XOR some shifted bits in the cheapest possible way to reduce systematic lossage, as well as to incorporate impact of the highest bits that would otherwise never be used in index calculations because of table bounds. (bucket use power-of-two masking). Just like: (hash ^ (hash >>> 16)) In some cases, if a lot of conflicts occurred, this will lead to job hang, because hash join will degenerate to nested loop join. ## Verifying this change `BinaryHashTableTest` ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: no - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? no
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services