@@ -263,7 +263,8 @@ class TTopicSession : public TActorBootstrapped<TTopicSession> {
263263 const NYql::IPqGateway::TPtr PqGateway;
264264 const std::shared_ptr<NYdb::ICredentialsProviderFactory> CredentialsProviderFactory;
265265 const NConfig::TRowDispatcherConfig Config;
266- const TFormatHandlerConfig FormatHandlerConfig;
266+ const TActorId CompileServiceActorId;
267+ const NKikimr::NMiniKQL::IFunctionRegistry* FunctionRegistry;
267268 const i64 BufferSize;
268269 TString LogPrefix;
269270
@@ -281,6 +282,7 @@ class TTopicSession : public TActorBootstrapped<TTopicSession> {
281282 ui64 QueuedBytes = 0 ;
282283 TMaybe<TString> ConsumerName;
283284 TInstant StartingMessageTimestamp;
285+ TMaybe<bool > SkipJsonErrors;
284286
285287 // Metrics
286288 TInstant WaitEventStartedAt;
@@ -401,7 +403,8 @@ TTopicSession::TTopicSession(
401403 , PqGateway(pqGateway)
402404 , CredentialsProviderFactory(credentialsProviderFactory)
403405 , Config(config)
404- , FormatHandlerConfig(CreateFormatHandlerConfig(config, functionRegistry, compileServiceActorId))
406+ , CompileServiceActorId(compileServiceActorId)
407+ , FunctionRegistry(functionRegistry)
405408 , BufferSize(maxBufferSize)
406409 , LogPrefix(" TopicSession" )
407410 , Counters(counters)
@@ -767,9 +770,10 @@ void TTopicSession::Handle(NFq::TEvRowDispatcher::TEvStartSession::TPtr& ev) {
767770 auto clientInfo = Clients.insert ({ev->Sender , MakeIntrusive<TClientsInfo>(*this , LogPrefix, handlerSettings, ev, Counters, ReadGroup, offset)}).first ->second ;
768771 auto formatIt = FormatHandlers.find (handlerSettings);
769772 if (formatIt == FormatHandlers.end ()) {
773+ auto config = CreateFormatHandlerConfig (Config, FunctionRegistry, CompileServiceActorId, source.GetSkipJsonErrors ());
770774 formatIt = FormatHandlers.emplace (handlerSettings, CreateTopicFormatHandler (
771775 ActorContext (),
772- FormatHandlerConfig ,
776+ config ,
773777 handlerSettings,
774778 {.CountersRoot = CountersRoot, .CountersSubgroup = Metrics.PartitionGroup }
775779 )).first ;
@@ -781,6 +785,7 @@ void TTopicSession::Handle(NFq::TEvRowDispatcher::TEvStartSession::TPtr& ev) {
781785 }
782786
783787 ConsumerName = source.GetConsumerName ();
788+ SkipJsonErrors = source.GetSkipJsonErrors ();
784789 SendStatistics ();
785790}
786791
@@ -965,6 +970,11 @@ bool TTopicSession::CheckNewClient(NFq::TEvRowDispatcher::TEvStartSession::TPtr&
965970 return false ;
966971 }
967972
973+ if (SkipJsonErrors && SkipJsonErrors != source.GetSkipJsonErrors ()) {
974+ LOG_ROW_DISPATCHER_INFO (" Different skip json errors mode, expected " << SkipJsonErrors << " , actual " << source.GetSkipJsonErrors () << " , send error" );
975+ SendSessionError (ev->Sender , TStatus::Fail (EStatusId::PRECONDITION_FAILED, TStringBuilder () << " Use the same skip json errors settings in all queries via RD (current mode " << SkipJsonErrors << " )" ), false );
976+ return false ;
977+ }
968978 return true ;
969979}
970980
0 commit comments