Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Cc: vdavydov.dev@gmail.com, Serge Petrenko <sergepetrenko@tarantool.org>
Subject: Re: [tarantool-patches] [PATCH 2/5] decimal: allow to encode/decode decimals as MsgPack
Date: Thu, 25 Jul 2019 02:08:03 +0300	[thread overview]
Message-ID: <20190724230803.GB15185@atlas> (raw)
In-Reply-To: <5f07a0f042b2b6c2d7afc2e595ecd56996afb48a.1563376957.git.sergepetrenko@tarantool.org>

* Serge Petrenko <sergepetrenko@tarantool.org> [19/07/17 18:34]:
> This patch adds the methods necessary to encode and decode decimals to
> MsgPack. MsgPack EXT type (MP_EXT) together with a new extension type
> MP_DECIMAL is used as a record header.
> 
> The decimal MsgPack representation looks like this:
> +--------+-------------------+------------+===============+
> | MP_EXT | length (optional) | MP_DECIMAL | PackedDecimal |
> +--------+-------------------+------------+===============+
> The whole record may be encoded and decoded with
> mp_encode_decimal() and mp_decode_decimal(). This is equivalent to
> performing mp_encode_extl()/mp_decode_extl() on the first 3 fields and
> decimal_pack/unpack() on the PackedDecimal field.

Please extend tarantool/msgpuck with libdecimal-agnostic data type
(e.g. struct mp_decimal { char data[] };, and encoders/decoders
from this struct.

Then use libdecimal api to fill this struct and pass to libmsgpuck
for encoding.

I think this patch is not worth having on its own, the next
logical step after patching msgpack is make sure net.box can
marshal decimals, and then - tarantool-python driver can read
them, then update test-run with the new python driver, then add a
new protocol test.


-- 
Konstantin Osipov, Moscow, Russia

  parent reply	other threads:[~2019-07-24 23:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 15:33 [PATCH 0/5] Decimal indices Serge Petrenko
2019-07-17 15:33 ` [PATCH 1/5] decimal: fix decimal.round() when scale == 0 Serge Petrenko
2019-07-24 12:10   ` Vladimir Davydov
2019-07-24 23:02   ` [tarantool-patches] " Konstantin Osipov
2019-07-17 15:33 ` [PATCH 2/5] decimal: allow to encode/decode decimals as MsgPack Serge Petrenko
2019-07-24 16:19   ` Vladimir Davydov
2019-07-24 23:08   ` Konstantin Osipov [this message]
2019-07-17 15:33 ` [PATCH 3/5] lua: allow to encode and decode decimals as msgpack Serge Petrenko
2019-07-24 14:11   ` Vladimir Davydov
2019-07-24 23:10   ` [tarantool-patches] " Konstantin Osipov
2019-07-17 15:33 ` [PATCH 4/5] decimal: add conversions to (u)int64_t Serge Petrenko
2019-07-24 16:17   ` Vladimir Davydov
2019-07-17 15:33 ` [PATCH 5/5] decimal: allow to index decimals Serge Petrenko
2019-07-24 16:56   ` Vladimir Davydov
2019-07-24 23:13   ` [tarantool-patches] " Konstantin Osipov
2019-07-24 23:17   ` Konstantin Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190724230803.GB15185@atlas \
    --to=kostja@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] [PATCH 2/5] decimal: allow to encode/decode decimals as MsgPack' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox