-
-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-schema on INSERT: incorrect JSON response for big IDs #2269
Comments
The implementation of the core library for handling We should proceed to update the auto schema plugin in Buddy using this library. I believe @Nick-S-2018 has more context and can assist with the upgrade. The // Create a Struct from JSON
$struct = Struct::fromJson(...);
// Access data as an array (BigInts will be strings)
$struct->toArray();
// or
$struct['key'];
// Convert back to JSON while preserving BigInts
$struct->toJson();
// Replace a BigInt value
$struct['id'] = '...';
// Create a new field and set its type to BigInt
$struct['nested']['new_field'] = '1111';
$struct->addBigIntField('nested.new_field'); This implementation allows for easy handling of BigInt values, ensuring they're properly encoded in JSON output and accessible as strings when needed. 😊 |
As discussed with@donhardman, it's turned out that the proposed implementation will require changes in buddy-core too, so we need to decide on the most efficient way to do that first. |
@Nick-S-2018 pls let @donhardman what's required from him within this issue. |
Probably, we need to decode input and encode output not in the plugins, as we tried before, but by using some core's Request/Response methods for that purpose. |
@Nick-S-2018 please review the pull request in core: manticoresoftware/buddy-core#75 I have also added modifications to the main pull request. We should make sure that everything works fine with the new core. Also, please do some tests to ensure inserts work as expected. |
Now Buddy passes tests and handles bigints correctly. However, after Buddy response is passed back to daemon, they're still got converted to incorrect values. E.g.:
The example can be reproduced with:
|
I fixed the issue at daemon f01a478 by switching JSON parser from BJson to CJson at buddy communication. Now parsing of the buddy replies work the same way as parser of the HTTP JSON requests. That fixes the issue at daemon with large integer. However buddy main branch and buddy-core branch should be merged. |
It looks that response format from daemon to Buddy is changed to JSON string now which leads to Buddy tests failures. E.g:
|
I checked reply from the daemon to buddy for buddy request
but see no difference here is a dump of the request prior to fix
here is a dump of the request at the master version with the fix
after the header body separator Unclear what is the issue. |
I was wrong with my initial assumption. It has to do with response format from daemon to the client, not from daemon to Buddy. E.g., the latest version produces:
The previous version:
Request and response from Buddy to daemon stay the same in both cases:
|
fixed wrong escaping of the /cli endpoint at edcdd5e |
Added necessary updates to Buddy in manticoresoftware/manticoresearch-buddy#335 |
* fixed buddy reply routing at daemon for /cli endpoint; fixed #2269
* fixed buddy reply routing at daemon for /cli endpoint; fixed #2269
* Bump buddy version to: 3.0.1 24111207 5d89277 * Bump buddy version to: 3.0.1 24111217 6707485 * Bump buddy version to: 3.0.1 24111305 f599a87 * Bump buddy version to: 3.0.1 24111407 3861c6b * fixed buddy reply routing at daemon for /cli endpoint (#2734) * fixed buddy reply routing at daemon for /cli endpoint; fixed #2269 * implemented jieba_user_dict_path (#2735) implemented jieba_user_dict_path * added log of the SphinxQL query that successfully processed by buddy into the query log; fixed #2235 * manual: Update Adding_documents_to_a_real-time_table.md * fixed query wrong length at error report at the query log; fixed new lines at the query log for error report and buddy report; fixed #2235 * Update regex for the new version of fluentbit (#2738) Co-authored-by: Pavel_Shilin <[email protected]> * manual: Update Query_logging.md Added that queries processed through Buddy are not logged in plain mode. * manual: minor changes * fix crash when add 1-st stored column That is very edge case when you alter a table adding stored column when there were no stored columns before. Test provided. That is related to #2708 * fixed JSON SI-related filter transforms vs small index * added collation support to Expr_JsonFieldIn_c * added log of the HTTP request that successfully processed with buddy into the query log; fixed #2235 * manual: WSL installation * fixed multiple stopwords from the lemmatize_xxx_all tokenizers increase hitpos of the following tokens; fixed #2704; added case to test 219 * fixed nsis builder script to use the same MANTICORE_DATE as zip package has * Test/drop sharded table (#2651) * Creating files for the test * Update test-drop-sharding-table.rec * Moved test-drop-sharding-table * Deleted buddy_path = manticore-executor /workdir/src/main.php * Added new sharded tables * Added new outputs * Fixed test-drop-sharding-table.rec * Added new cases for table deletion --------- Co-authored-by: Pavel_Shilin <[email protected]> * fixed mysql dll for indexer * set session meta for the buddy replies; fixed #2235 * added uuid_short select list expression function; fixed #2752; added cases to test 125 * manual: uuid_short() * Test/create table with data if not exists (#2760) * Update test-create-table-like-existing-table-with-data.rec * Added cases with different syntax of IF NOT EXISTS support --------- Co-authored-by: Pavel_Shilin <[email protected]> * New fuzzy search and autocomplete cases have been added --------- Co-authored-by: githubmanticore <[email protected]> Co-authored-by: Stas <[email protected]> Co-authored-by: Ilya Kuznetsov <[email protected]> Co-authored-by: Sergey Nikolaev <[email protected]> Co-authored-by: Pavel_Shilin <[email protected]> Co-authored-by: Aleksey N. Vinogradov <[email protected]>
* Bump buddy version to: 3.0.1 24111207 5d89277 * Bump buddy version to: 3.0.1 24111217 6707485 * Bump buddy version to: 3.0.1 24111305 f599a87 * Bump buddy version to: 3.0.1 24111407 3861c6b * Bump executor version to: 1.1.21 24111510 8254967 * Bump executor version to: 1.1.23 24111613 dbade9d * Bump buddy version to: 3.0.1 24111904 1fdeec2 * Bump mcl version to: 2.3.1 24112219 edadc69 * Bump executor version to: 1.2.1 24112407 aedd870 * 🆕 Update buddy version (fix/fuzzy-no-match) (#2756) * Bump buddy version to: 3.0.1 24111207 5d89277 * Bump buddy version to: 3.0.1 24111217 6707485 * Bump buddy version to: 3.0.1 24111305 f599a87 * Bump buddy version to: 3.0.1 24111407 3861c6b * fixed buddy reply routing at daemon for /cli endpoint (#2734) * fixed buddy reply routing at daemon for /cli endpoint; fixed #2269 * implemented jieba_user_dict_path (#2735) implemented jieba_user_dict_path * added log of the SphinxQL query that successfully processed by buddy into the query log; fixed #2235 * manual: Update Adding_documents_to_a_real-time_table.md * fixed query wrong length at error report at the query log; fixed new lines at the query log for error report and buddy report; fixed #2235 * Update regex for the new version of fluentbit (#2738) Co-authored-by: Pavel_Shilin <[email protected]> * manual: Update Query_logging.md Added that queries processed through Buddy are not logged in plain mode. * manual: minor changes * fix crash when add 1-st stored column That is very edge case when you alter a table adding stored column when there were no stored columns before. Test provided. That is related to #2708 * fixed JSON SI-related filter transforms vs small index * added collation support to Expr_JsonFieldIn_c * added log of the HTTP request that successfully processed with buddy into the query log; fixed #2235 * manual: WSL installation * fixed multiple stopwords from the lemmatize_xxx_all tokenizers increase hitpos of the following tokens; fixed #2704; added case to test 219 * fixed nsis builder script to use the same MANTICORE_DATE as zip package has * Test/drop sharded table (#2651) * Creating files for the test * Update test-drop-sharding-table.rec * Moved test-drop-sharding-table * Deleted buddy_path = manticore-executor /workdir/src/main.php * Added new sharded tables * Added new outputs * Fixed test-drop-sharding-table.rec * Added new cases for table deletion --------- Co-authored-by: Pavel_Shilin <[email protected]> * fixed mysql dll for indexer * set session meta for the buddy replies; fixed #2235 * added uuid_short select list expression function; fixed #2752; added cases to test 125 * manual: uuid_short() * Test/create table with data if not exists (#2760) * Update test-create-table-like-existing-table-with-data.rec * Added cases with different syntax of IF NOT EXISTS support --------- Co-authored-by: Pavel_Shilin <[email protected]> * New fuzzy search and autocomplete cases have been added --------- Co-authored-by: githubmanticore <[email protected]> Co-authored-by: Stas <[email protected]> Co-authored-by: Ilya Kuznetsov <[email protected]> Co-authored-by: Sergey Nikolaev <[email protected]> Co-authored-by: Pavel_Shilin <[email protected]> Co-authored-by: Aleksey N. Vinogradov <[email protected]> * Bump buddy version to: 3.0.1 24112509 84d7b85 * 🆕 Update buddy version (fix/kafka-view-creation) (#2780) * 🆕 Update mcl version (#2769) * Bump buddy version to: 3.0.1 24111207 5d89277 * Bump buddy version to: 3.0.1 24111217 6707485 * Bump buddy version to: 3.0.1 24111305 f599a87 * Bump buddy version to: 3.0.1 24111407 3861c6b * Bump executor version to: 1.1.21 24111510 8254967 * Bump executor version to: 1.1.23 24111613 dbade9d * Bump buddy version to: 3.0.1 24111904 1fdeec2 * Bump mcl version to: 2.3.1 24112219 edadc69 --------- Co-authored-by: githubmanticore <[email protected]> Co-authored-by: Ilya Kuznetsov <[email protected]> * Bump buddy version to: 3.0.1 24112312 dec35d2 --------- Co-authored-by: githubmanticore <[email protected]> Co-authored-by: Ilya Kuznetsov <[email protected]> Co-authored-by: Klim Todrik <[email protected]> --------- Co-authored-by: githubmanticore <[email protected]> Co-authored-by: Ilya Kuznetsov <[email protected]> Co-authored-by: Stas <[email protected]> Co-authored-by: Sergey Nikolaev <[email protected]> Co-authored-by: Pavel_Shilin <[email protected]> Co-authored-by: Aleksey N. Vinogradov <[email protected]> Co-authored-by: Klim Todrik <[email protected]>
Bug Description:
Reproduction:
_id
becomes float for some reason.It happens only if the target index doesn't exist and if
id
is big enough.Manticore Search Version:
6.3.0
Operating System Version:
Docker
Have you tried the latest development version?
None
Internal Checklist:
To be completed by the assignee. Check off tasks that have been completed or are not applicable.
The text was updated successfully, but these errors were encountered: