-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[feature](json)support explode_json_object func #36887
[feature](json)support explode_json_object func #36887
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
StringRef text = _json_object_column->get_data_at(row_idx); | ||
if (text.data != nullptr) { | ||
JsonbDocument* doc = JsonbDocument::createDocument(text.data, text.size); | ||
if (UNLIKELY(!doc || !doc->getValue())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
if (UNLIKELY(!doc || !doc->getValue())) {
^
Additional context
be/src/common/compiler_util.h:35: expanded from macro 'UNLIKELY'
#define UNLIKELY(expr) __builtin_expect(!!(expr), 0)
^
auto writer = std::make_unique<JsonbWriter>(); | ||
if (value->isObject()) { | ||
_cur_size = value->length(); | ||
ObjectVal* obj = (ObjectVal*)value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
ObjectVal* obj = (ObjectVal*)value; | |
auto* obj = (ObjectVal*)value; |
|
||
#pragma once | ||
|
||
#include <stddef.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: inclusion of deprecated C++ header 'stddef.h'; consider using 'cstddef' instead [modernize-deprecated-headers]
#include <stddef.h> | |
#include <cstddef> |
run buildall |
TPC-H: Total hot run time: 40081 ms
|
TPC-DS: Total hot run time: 175070 ms
|
ClickBench: Total hot run time: 30.89 s
|
...n/java/org/apache/doris/nereids/trees/expressions/functions/generator/ExplodeJsonObject.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/doris/nereids/trees/expressions/functions/generator/ExplodeJsonObject.java
Outdated
Show resolved
Hide resolved
...a/org/apache/doris/nereids/trees/expressions/functions/generator/ExplodeJsonObjectOuter.java
Show resolved
Hide resolved
run buildall |
...a/org/apache/doris/nereids/trees/expressions/functions/generator/ExplodeJsonObjectOuter.java
Outdated
Show resolved
Hide resolved
TPC-H: Total hot run time: 39946 ms
|
run buildall |
TPC-H: Total hot run time: 40324 ms
|
TPC-DS: Total hot run time: 169919 ms
|
ClickBench: Total hot run time: 30.24 s
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
TPC-H: Total hot run time: 40614 ms
|
TPC-DS: Total hot run time: 174471 ms
|
ClickBench: Total hot run time: 30.76 s
|
run buildall |
TPC-H: Total hot run time: 40066 ms
|
TPC-DS: Total hot run time: 173411 ms
|
ClickBench: Total hot run time: 30.4 s
|
PR approved by at least one committer and no changes requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
after this pr we support expand json object into two column with key column (string) ,and value column(json value)
Proposed changes
after this pr we support
expand json object into two column with key column (string) ,and value column(json value)
Issue Number: close #xxx