morningman commented on code in PR #70830:
URL: https://github.com/apache/doris/pull/70830#discussion_r4664128478
##########
fe/fe-connector/fe-connector-lance/src/main/java/org/apache/doris/connector/lance/LanceScanPlanProvider.java:
##########
@@ -99,10 +101,34 @@ final class LanceScanPlanProvider implements
ConnectorScanPlanProvider {
this.backendStorageProperties = backendStorageProperties;
}
+ /**
Review Comment:
Not changing this. A null session never reaches `planScan`: its only engine
caller, `PluginDrivenScanNode.getSplits`, dereferences the session in its first
statement (`registerQueryFinishCleanup(connectorSession)` reads
`getQueryId()`), the session comes from
`PluginDrivenExternalCatalog.buildConnectorSession()`, which always builds one,
and the SPI documents the parameter as "the current session". Paimon's and
Iceberg's null guards say the same ("production planScan always carries one"),
and no Lance test calls `planScan` with a null session. Nor was Lance's
`planScan` null-safe before this PR: only the COUNT branch without a filter
left the session alone, and every other request dereferenced it in
`fragmentsPerSplit` (`LanceScanPlanProvider.java:205` at 3b476bd0d0e). The
offline case the metrics are built for is a session without a live statement
(`ConnectorStatementScope.NONE`), where `publishScan` and `collectScanProfiles`
publish nothing; `LanceMetadataMetricsTest.readsOutsid
eAStatementRunAndReportNothing` covers it. A null check here would guard an
input nothing produces, which the repository's AGENTS.md rules out.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]