From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Kirill Shcherbatov Subject: [PATCH v6 0/4] box: JSON tree class Date: Thu, 6 Dec 2018 11:42:27 +0300 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: tarantool-patches@freelists.org, vdavydov.dev@gmail.com Cc: kostja@tarantool.org, Kirill Shcherbatov List-ID: http://github.com/tarantool/tarantool/tree/kshch/gh-1012-json-tree https://github.com/tarantool/tarantool/issues/1012 Preparatory patch set for JSON indexes story. Implemented JSON tree class is used for organizing JSON tokens produced by a lexer in a tree-like structure reflecting a JSON document structure. Refactored json_lexer class to use index_base to emmit tokens being ready to insert in JSON tree. Refactored tuple_format to use the tree JSON class for working with first-level fields to works with all fields in unified way. Introduced help routines json_path_validate and json_path_cmp. The third path "box: manage format fields with JSON tree class" triggers a bug #3772 that is already on review kshch/gh-3772-dirty-memory-access. Source branch has cherry-picked fix. General information of difference from previous version of patch-set: - new patch "make index_base support for json_lexer" allows to do not carry for LUA index base during token insertion - significantly improved comments, many minor refactoring - new consistency assertions, e.g. that no fields attached during token detach. - reworked iterators - _slowpath version for json_tree_lookup to improve performance for numerical levels - new tests - reworked json_path_cmp, introduced json_path_validate - rebased on up-to-date 2.1 and cherry-picked #3772 fix Kirill Shcherbatov (4): lib: make index_base support for json_lexer lib: implement JSON tree class for json library box: manage format fields with JSON tree class lib: introduce json_path_cmp, json_path_validate src/box/sql.c | 18 +- src/box/sql/build.c | 5 +- src/box/tuple.c | 10 +- src/box/tuple_format.c | 138 +++++++++------ src/box/tuple_format.h | 49 +++++- src/box/vy_stmt.c | 4 +- src/lib/json/CMakeLists.txt | 1 + src/lib/json/json.c | 290 +++++++++++++++++++++++++++++++- src/lib/json/json.h | 326 +++++++++++++++++++++++++++++++++++- test/engine/tuple.result | 4 +- test/unit/json_path.c | 302 +++++++++++++++++++++++++++++++-- test/unit/json_path.result | 92 ++++++++-- 12 files changed, 1141 insertions(+), 98 deletions(-) -- 2.19.2