Error when create view using odbc Flight

Hello, after migrate to 24.2.6-202311250456170399-68acbe47 we have this error when try create a view using


Note, that this only occur when using odbc flight, we make some debug of dremio and detect that in
com.dremio.exec.util.QueryVersionUtils in the method checkForUnspecifiedVersionsAndReturnRelNode inside queryContextForVersionValidation
the line code

 private static UserSession userSessionForVersionValidation(SabotContext sabotContext, List<String> pathContext, Map<String, VersionContext> sourceVersionMapping, Optional<UserSession> userSession) {
        return userSession.isPresent() ? Builder.newBuilderWithCopy((UserSession)userSession.get()).withDefaultSchema(pathContext).withSourceVersionMapping(sourceVersionMapping).withErrorOnUnspecifiedVersion(true).build() : Builder.newBuilder().withSessionOptionManager(new SessionOptionManagerImpl(sabotContext.getOptionValidatorListing()), sabotContext.getOptionManager()).withDefaultSchema(pathContext).withSourceVersionMapping(sourceVersionMapping).withUserProperties(UserProperties.getDefaultInstance()).withCredentials(UserCredentials.newBuilder().setUserName("$dremio$").build()).withCheckMetadataValidity(false).withNeverPromote(false).withErrorOnUnspecifiedVersion(true).build();

is wrong because when Builder.newBuilderWithCopy method calls this.userSession = new UserSession(session) but this in UserSession use this.credentials = userSession.credentials
but when use fligth userSession is an instance of ChangeTrackingUserSession which extends of extends UserSession and has credentials in null because all info of this class is in UserSession delegate

so when create ContextInformationImpl this line (40) this.queryUser = userCredentials.getUserName() throws NullPointerException

I think this is a critical error because we cannot run DDL operations using odbc, please @dch or @balaji.ramaswamy your help

log in dremio log file:

com.dremio.common.exceptions.UserException: Validation of view sql failed. null 
	at com.dremio.common.exceptions.UserException$
	at com.dremio.common.exceptions.UserException$Builder.buildSilently(
	at com.dremio.exec.planner.sql.handlers.commands.DirectCommand.plan(
	at com.dremio.service.commandpool.ReleasableBoundCommandPool.lambda$getWrappedCommand$3(
	at com.dremio.common.concurrent.ContextMigratingExecutorService.lambda$decorate$4(
	at com.dremio.common.concurrent.ContextMigratingExecutorService$
	at java.util.concurrent.Executors$
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$

Hello friends, @dch or @balaji.ramaswamy can you check this error please?

Hi @dacopan I will work with the right team but will get to this next week, Thanks, Bali

1 Like

The issue I encountered is indeed identical to the error code mentioned in your post. I encountered the problem while using the DremioFlightEndpoint interface. Thank you for bringing this to my attention. Could you please clarify if there are any limitations regarding JDBC or ODBC interfaces, such as any restrictions on creating views when using DremioFlightEndpoint?"

and the same error in adbc like this : Encounter pyarrow Invalid Parameter Error When Creating View Using Dremio Flight Endpoint - Dremio University - Dremio

This is the ADBC interface I created based on the documentation I referred to. : arrow-flight-client-examples/python at main · dremio-hub/arrow-flight-client-examples (

@Han-lai we not received a responde about this error, but my solution was donwngrade to a past version, that not have this issue

Thank you for your response, I would like to ask, which version of Dremio are you using to create views with the ADBC Flight?

In 24.1.0 is the last version that I tested creating views, more recent versions of it not work