jiaqizho commented on code in PR #1364: URL: https://github.com/apache/cloudberry/pull/1364#discussion_r2384454545
########## contrib/pax_storage/src/cpp/comm/cbdb_wrappers.h: ########## @@ -164,6 +162,10 @@ static inline float8 DatumToFloat8(Datum d) noexcept { return DatumGetFloat8(d); } +static pg_attribute_always_inline Oid RelationGetRelationId(Relation rel) noexcept { Review Comment: how about change some of functions in `cbdb_wrappers.h` to inline? ########## contrib/pax_storage/src/cpp/storage/vec/pax_porc_adpater.cc: ########## @@ -240,11 +240,15 @@ static void CopyDecimalBuffer(PaxColumn *column, column->GetBuffer(data_index_begin + non_null_offset); auto vl = (struct varlena *)DatumGetPointer(buffer); - Assert(!(VARATT_IS_EXTERNAL(vl) || VARATT_IS_COMPRESSED(vl) || - VARATT_IS_SHORT(vl))); + Assert(!(VARATT_IS_EXTERNAL(vl) || VARATT_IS_COMPRESSED(vl))); num_len = VARSIZE_ANY_EXHDR(vl); - // direct cast - numeric = (Numeric)(buffer); + // it has been detoasted in OrcWriter::PrepareWriteTuple, except numeric + // type with short header should be detoasted to 4B header + if (unlikely(VARATT_IS_SHORT(vl))) { + numeric = cbdb::VarlenaShortTo4B(vl); Review Comment: when we free the memory which alloced in `VarlenaShortTo4B`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org For additional commands, e-mail: commits-h...@cloudberry.apache.org