Fix for SystemTables in allowSplittingReadIntoMultipleSubQueries#23529
Fix for SystemTables in allowSplittingReadIntoMultipleSubQueries#23529raunaqmorarka merged 1 commit intotrinodb:masterfrom
Conversation
lukasz-stec
left a comment
There was a problem hiding this comment.
Please add tests for this case.
Why do we get SystemTableHandle in this case and not all others where the table handle is cast directly to HiveTableHandle?
There was a problem hiding this comment.
I would check for the SystemTableHandle in the io.trino.metadata.MetadataManager#allowSplittingReadIntoMultipleSubQueries. This avoids copying this check to multiple places.
There was a problem hiding this comment.
Filtering for SystemTableHandle in MetadataManager would indeed work for this specific case, but it's not clear to me that we won't encounter any more cases where tableHandle is different from HiveTableHandle.
It seems safer to just specifically test for connector specific table handle, even if there is code repetition.
There was a problem hiding this comment.
You can't pass any table handle to any connector. Every connector expects only its own TableHandle class. The casts like that are all over the HiveMetadata. The CatalogHandle actually has io.trino.spi.connector.CatalogHandle#type that in this case is set to io.trino.spi.connector.CatalogHandle.CatalogHandleType#SYSTEM.
Maybe there are cast issues which we are not aware of. Added test which without this fix fails. |
Description
Fix for cannot cast
SystemTableHandletoConnectorTableHandlein allowSplittingReadIntoMultipleSubQueries.Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: