@@ -264,7 +264,7 @@ class TJsonParser::TImpl {
264
264
public:
265
265
TImpl (const TVector<TString>& columns, const TVector<TString>& types, ui64 batchSize, TDuration batchCreationTimeout)
266
266
: Alloc(__LOCATION__, NKikimr::TAlignedPagePoolCounters(), true , false )
267
- , TypeEnv(Alloc)
267
+ , TypeEnv(std::make_unique<NKikimr::NMiniKQL::TTypeEnvironment>( Alloc) )
268
268
, BatchSize(batchSize)
269
269
, BatchCreationTimeout(batchCreationTimeout)
270
270
, ParsedValues(columns.size())
@@ -273,7 +273,7 @@ class TJsonParser::TImpl {
273
273
274
274
with_lock (Alloc) {
275
275
auto functonRegistry = NKikimr::NMiniKQL::CreateFunctionRegistry (&PrintBackTrace, NKikimr::NMiniKQL::CreateBuiltinRegistry (), false , {});
276
- NKikimr::NMiniKQL::TProgramBuilder programBuilder (TypeEnv, *functonRegistry);
276
+ NKikimr::NMiniKQL::TProgramBuilder programBuilder (* TypeEnv, *functonRegistry);
277
277
278
278
Columns.reserve (columns.size ());
279
279
for (size_t i = 0 ; i < columns.size (); i++) {
@@ -373,8 +373,12 @@ class TJsonParser::TImpl {
373
373
}
374
374
375
375
~TImpl () {
376
- Alloc.Acquire ();
377
- ClearColumns (0 );
376
+ with_lock (Alloc) {
377
+ ClearColumns (0 );
378
+ ParsedValues.clear ();
379
+ Columns.clear ();
380
+ TypeEnv.reset ();
381
+ }
378
382
}
379
383
380
384
private:
@@ -395,7 +399,7 @@ class TJsonParser::TImpl {
395
399
396
400
private:
397
401
NKikimr::NMiniKQL::TScopedAlloc Alloc;
398
- NKikimr::NMiniKQL::TTypeEnvironment TypeEnv;
402
+ std::unique_ptr< NKikimr::NMiniKQL::TTypeEnvironment> TypeEnv;
399
403
400
404
const ui64 BatchSize;
401
405
const TDuration BatchCreationTimeout;
@@ -405,7 +409,7 @@ class TJsonParser::TImpl {
405
409
TJsonParserBuffer Buffer;
406
410
simdjson::ondemand::parser Parser;
407
411
408
- TVector<std::vector<NYql::NUdf::TUnboxedValue, NKikimr::NMiniKQL::TMKQLAllocator<NYql::NUdf::TUnboxedValue>> > ParsedValues;
412
+ TVector<NKikimr::NMiniKQL::TUnboxedValueVector > ParsedValues;
409
413
};
410
414
411
415
TJsonParser::TJsonParser (const TVector<TString>& columns, const TVector<TString>& types, ui64 batchSize, TDuration batchCreationTimeout)
0 commit comments