forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for $internal$_json_string_to_array/map/cast (facebookinc…
…ubator#12159) Summary: We add support for $internal$_json_string_to_array/map/cast functions. These are used by the presto co-ordinator when we have expressions of the form cast( json as array()/map()/row()) . Consider for example cast(json_parse(x) as array(varchar)) ; Currently we will have to parse the json represented by x twice, once in json_parse and a second time in the cast . We currently spend significant CPU canonicalizing these jsons, and this is wasted if we end up casting the result. The presto plan actually tries to invoke $internal$_json_string_to_array/map/cast which is converted to a cast currently in prestissimo (https://github.com/prestodb/presto/blob/master/presto-native-execution/presto_cpp/main/types/PrestoToVeloxExpr.cpp#L233) . Once this is merged , I will submit a PR to prestissimo to fix this in Presto. Note: At the moment these functions do not behave correctly if the type casted to has a JSON , as that still should be canonicalized. I will be changing PrestoToVeloxExpr.cpp to ensure its only called for non json types. Reviewed By: Yuhta Differential Revision: D68582388
- Loading branch information
1 parent
5f8e7f1
commit c484b83
Showing
5 changed files
with
246 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters