@@ -260,6 +260,14 @@ void JsonArrayInfo::mapColumns(const RowGroup& projRG)
260
260
261
261
(*k)->fRowGroup = RowGroup (oids.size (), pos, oids, keys, types, csNums, scale, precision,
262
262
projRG.getStringTableThreshold (), false );
263
+
264
+ // MCOL-5491/MCOL-5429 Use stringstore if the datatype of the
265
+ // json_arrayagg/group_concat field is a long string.
266
+ if ((*k)->fRowGroup .hasLongString ())
267
+ {
268
+ (*k)->fRowGroup .setUseStringTable (true );
269
+ }
270
+
263
271
(*k)->fMapping = makeMapping (projRG, (*k)->fRowGroup );
264
272
}
265
273
}
@@ -311,9 +319,24 @@ void JsonArrayAggregatAgUM::initialize()
311
319
312
320
fConcator ->initialize (fGroupConcat );
313
321
314
- fGroupConcat ->fRowGroup .initRow (&fRow , true );
315
- fData .reset (new uint8_t [fRow .getSize ()]);
316
- fRow .setData (rowgroup::Row::Pointer (fData .get ()));
322
+ // MCOL-5491/MCOL-5429 Use stringstore if the datatype of the
323
+ // json_arrayagg/group_concat field is a long string.
324
+ if (fGroupConcat ->fRowGroup .hasLongString ())
325
+ {
326
+ fRowGroup = fGroupConcat ->fRowGroup ;
327
+ fRowGroup .setUseStringTable (true );
328
+ fRowRGData .reinit (fRowGroup , 1 );
329
+ fRowGroup .setData (&fRowRGData );
330
+ fRowGroup .resetRowGroup (0 );
331
+ fRowGroup .initRow (&fRow );
332
+ fRowGroup .getRow (0 , &fRow );
333
+ }
334
+ else
335
+ {
336
+ fGroupConcat ->fRowGroup .initRow (&fRow , true );
337
+ fData .reset (new uint8_t [fRow .getSize ()]);
338
+ fRow .setData (rowgroup::Row::Pointer (fData .get ()));
339
+ }
317
340
}
318
341
319
342
void JsonArrayAggregatAgUM::processRow (const rowgroup::Row& inRow)
0 commit comments