boluor opened a new pull request, #3749:
URL: https://github.com/apache/doris-website/pull/3749

   ## Summary
   
   Fixes #3318. A user upgrading from Doris 2.0.2 to 2.1.11 reported that the 
same SQL changed result:
   
   \`\`\`sql
   SELECT json_extract(product_specific, '\$.categoryId')
   FROM ods_product_goods_full;
   
   -- product_specific is varchar holding e.g. 
[{\"categoryId\":1000},{\"categoryId\":1003},...]
   -- 2.0.2 returned [1000,1003,1006,1012,2,1015]
   -- 2.1.11 returns NULL
   \`\`\`
   
   The 2.1+ behavior is intentional and engine-correct: \`\$.k\` traverses only 
object members and does not auto-broadcast over array elements (aligning with 
MySQL's \`JSON_EXTRACT\` semantics). Verified in 
[\`be/src/util/jsonb_document.h::findValue\`](https://github.com/apache/doris/blob/branch-2.1/be/src/util/jsonb_document.h)
 on \`branch-2.1\`, \`branch-3.0\`, \`branch-3.1\`, \`branch-4.0\`, 
\`branch-4.1\`: the \`MEMBER_CODE\` case returns \`nullptr\` when \`pval\` is 
not a \`T_Object\`.
   
   The doc previously did not call this out. This PR adds a single line to the 
path-syntax section on each of the 8 maintained version pages 
(current/2.1/3.x/4.x EN+zh):
   
   - \`\$.k\` on an array returns NULL — no auto-broadcast
   - Use \`\$[i].k\` for index access
   - Array-wildcard broadcasting via \`\$[*].k\` was introduced in Doris 4.0 
(the wildcard \`continue\` on 2.1/3.x does not actually iterate elements — also 
verified in branch source)
   - On 2.1 and 3.x, recommend \`LATERAL VIEW EXPLODE\` patterns for 
per-element extraction
   
   ## Scope
   
   8 files, +12 lines:
   - \`docs/.../json-extract.md\`
   - \`versioned_docs/version-{2.1,3.x,4.x}/.../json-extract.md\`
   - 
\`i18n/zh-CN/.../{current,version-2.1,version-3.x,version-4.x}/.../json-extract.md\`
   
   No existing examples changed; no behavior change in the engine.
   
   ## Test plan
   
   - [x] Each of the 8 pages contains the new \"no auto-broadcast\" sentence
   - [x] Dead-link check passes
   - [x] Version-specific advice matches \`findValue\` source per branch
   
   Closes #3318


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to