Fix NPE when server returns null resultLinks for small CloudFetch results#1466
Open
gopalldb wants to merge 1 commit into
Open
Fix NPE when server returns null resultLinks for small CloudFetch results#1466gopalldb wants to merge 1 commit into
gopalldb wants to merge 1 commit into
Conversation
…ults When canDownloadResult=true, the server may return URL_BASED_SET format but inline the actual data for small results, leaving resultLinks=null and putting data in arrowBatches instead. Two-layer fix: 1. ExecutionResultFactory: when URL_BASED_SET has no resultLinks but has inline arrowBatches, fall back to inline arrow path instead of creating RemoteChunkProvider. 2. AbstractRemoteChunkProvider: null guard on getResultLinks() as defense-in-depth for subsequent fetch responses. Reported by Fivetran partner via support ticket (driver 3.3.1). Co-authored-by: Isaac Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
d20db37 to
290e366
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
NullPointerExceptioninAbstractRemoteChunkProvider.populateChunkIndexMap()when the server returnsresultLinks=nullfor small inline results delivered via CloudFetch format (URL_BASED_SET).Root cause: When
canDownloadResult=true, the server may returnURL_BASED_SETformat but inline the actual data for small results, leavingresultLinks=null. The driver creates aRemoteChunkProviderwhich callsresultData.getResultLinks().iterator()without a null check — NPE.Stack trace (reported by Fivetran via support):
Fix: Add null guard before iterating
resultLinks.Workaround: Set
EnableQueryResultDownload=0to disable CloudFetch.Test plan
DatabricksThriftServiceClientat line 367 already has the same null guard pattern (resultLinks == null || resultLinks.isEmpty())This pull request was AI-assisted by Isaac.