forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 1
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 lambda functions to ExpressionFuzzer (facebookincubat…
…or#7834) Summary: The tricky part of supporting lambda functions is finding a way to generate lambdas given both input types and the result type, i.e. generate LambdaTypedExpr to match given FunctionType. This implementation is very basic. It looks for a matching function signature or signature template and if none found uses a lambda expression that returns constant value. For example, lambda for filter(array, function(T) -> boolean) can be x -> is_null(x) or x -> cast(x as boolean) or x -> true. This very simple implementation is quite effective. It helped discover a number of bugs: facebookincubator#7821 facebookincubator#7824 facebookincubator#7828 facebookincubator#7829 facebookincubator#7831 facebookincubator#7851 facebookincubator#7861 This new logic cannot generate valid lambda for 'comparator' argument of array_sort. Hence, added support for skipping individual function signatures and used it to exclude this particular signature for array_sort. Ran the Fuzzer multiple times for 10 minutes each and collected custom stats on the lambda functions tested and lambda expressions generated. 20 functions were tested using 154 different lambda expressions. More details in https://gist.github.com/mbasmanova/1530e3cdfe2f6f4fef35a03f07ee4a39 ``` velox_expression_fuzzer_test --logtostderr --velox_fuzzer_enable_complex_types --enable_variadic_signatures --lazy_vector_generation_ratio 0.2 --velox_fuzzer_enable_column_reuse --velox_fuzzer_enable_expression_reuse --max_expression_trees_per_step 2 --retry_with_try --enable_dereference --duration_sec 1200 ``` Pull Request resolved: facebookincubator#7834 Test Plan: Imported from GitHub, without a `Test Plan:` line. ``` $ buck2 run stylus/xstream/query/functions/test:fuzzer_test $ buck2 run stylus/xstream/query/functions/test:f3_fuzzer_test ``` Reviewed By: xiaoxmeng Differential Revision: D51756700 Pulled By: mbasmanova fbshipit-source-id: 4a60fd29e1e670f905e3dc8b5a2180e4440796e2
- Loading branch information
1 parent
156abe3
commit 975ca3a
Showing
7 changed files
with
252 additions
and
13 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
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