-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor: Replace boost regex with re2 #15134
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
Changes from all commits
93059f8
0c12b21
9b02c42
7c817eb
f89ebdf
83d16c4
bfe34a6
736cf47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,10 +88,7 @@ struct GetJsonObjectFunction { | |
| private: | ||
| FOLLY_ALWAYS_INLINE bool checkJsonPath(StringView jsonPath) { | ||
| // Spark requires the first char in jsonPath is '$'. | ||
| if (jsonPath.empty() || jsonPath.data()[0] != '$') { | ||
| return false; | ||
| } | ||
| return true; | ||
| return std::string_view{jsonPath}.starts_with('$'); | ||
| } | ||
|
|
||
| // Spark's json path requires field name surrounded by single quotes if it is | ||
|
|
@@ -106,7 +103,7 @@ struct GetJsonObjectFunction { | |
| if (pairBegin == std::string::npos) { | ||
| break; | ||
| } | ||
| pairEnd = result.find("]", pairBegin); | ||
| pairEnd = result.find(']', pairBegin); | ||
| // If expected pattern, like ['a'], is not found. | ||
| if (pairEnd == std::string::npos || result[pairEnd - 1] != '\'') { | ||
| return "-1"; | ||
|
|
@@ -249,13 +246,9 @@ struct GetJsonObjectFunction { | |
| } | ||
| return false; | ||
| } | ||
| case simdjson::ondemand::json_type::object: { | ||
| // For nested case, e.g., for "{"my": {"hello": 10}}", "$.my" will | ||
| // return an object type. | ||
| ss << rawResult; | ||
| result.append(ss.str()); | ||
| return true; | ||
| } | ||
| // For nested case, e.g., for "{"my": {"hello": 10}}", | ||
| // "$.my" will return an object type. | ||
| case simdjson::ondemand::json_type::object: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc: @philo-he Would you like to take a look at the change to get_json_object? Thanks.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just in case, change here, it was same code in two cases
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The changes make sense. Thanks. |
||
| case simdjson::ondemand::json_type::array: { | ||
| ss << rawResult; | ||
| result.append(ss.str()); | ||
|
|
||
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.
Do you need to use velox_include_directories to include the fast-float header? If the environment does not have fast-float, the velox build will fail, I'm not sure why Velox does not build it from source. @MBkkt CC @czentgr
https://github.com/IBM/velox/actions/runs/18915929559/job/53999183287
Uh oh!
There was an error while loading. Please reload this page.
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.
No I shouldn't, because library target already linked in cmake
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.
Maybe you need to call https://github.com/facebookincubator/velox/pull/12735/files#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aR411 as this PR
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.
I think you build folly in some specific way, because fast_float link provided from Folly::folly now I think.
Lets do this explicit
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.
@jinchengchenghh #15322 does it help?
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.
IBM installs the folly by vcpkg, so the environment already has folly, but vcpkg does not support install fast-float version 8.0.2 apache/gluten#10977, so fast-float does not exist in the environment. It does not call setup-script.sh
Uh oh!
There was an error while loading. Please reload this page.
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.
So you don't have fast_float in vcpkg folly or how it works?
Hmm, strange, on their site they're claim support 8.0.2

Maybe I'm missing something because I'm not working with C++ package managers and system libraries.
As an alternative solution we probably can update fast_float version? I don't think it's bad, but it's also affects folly
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.
Maybe because Gluten uses an old vcpkg version? I'm not sure for that.
But I think current #15322 can help, so we don't need to update fast_float version and care about Gluten vcpkg fast-float version.
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.
Ok, lets try current approach, if it doesn't help, please ping me. And we will try something else
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.
Thanks for your in time fix!