@@ -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++) {
@@ -370,8 +370,12 @@ class TJsonParser::TImpl {
370
370
}
371
371
372
372
~TImpl () {
373
- Alloc.Acquire ();
374
- ClearColumns (0 );
373
+ with_lock (Alloc) {
374
+ ClearColumns (0 );
375
+ ParsedValues.clear ();
376
+ Columns.clear ();
377
+ TypeEnv.reset ();
378
+ }
375
379
}
376
380
377
381
private:
@@ -392,7 +396,7 @@ class TJsonParser::TImpl {
392
396
393
397
private:
394
398
NKikimr::NMiniKQL::TScopedAlloc Alloc;
395
- NKikimr::NMiniKQL::TTypeEnvironment TypeEnv;
399
+ std::unique_ptr< NKikimr::NMiniKQL::TTypeEnvironment> TypeEnv;
396
400
397
401
const ui64 BatchSize;
398
402
const TDuration BatchCreationTimeout;
@@ -402,7 +406,7 @@ class TJsonParser::TImpl {
402
406
TJsonParserBuffer Buffer;
403
407
simdjson::ondemand::parser Parser;
404
408
405
- TVector<std::vector<NYql::NUdf::TUnboxedValue, NKikimr::NMiniKQL::TMKQLAllocator<NYql::NUdf::TUnboxedValue>> > ParsedValues;
409
+ TVector<NKikimr::NMiniKQL::TUnboxedValueVector > ParsedValues;
406
410
};
407
411
408
412
TJsonParser::TJsonParser (const TVector<TString>& columns, const TVector<TString>& types, ui64 batchSize, TDuration batchCreationTimeout)
0 commit comments