You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "manuzhang (via GitHub)" <gi...@apache.org> on 2025/11/04 14:09:58 UTC

[PR] feat: Support variadic function in CometFuzz [datafusion-comet]

manuzhang opened a new pull request, #2682:
URL: https://github.com/apache/datafusion-comet/pull/2682

   ## Which issue does this PR close?
   
   Closes #2617.
   
   ## Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   ## What changes are included in this PR?
   
   1. Support variadic function with same input type in CometFuzz
   2. Generate `concat` with variadic function signature
   
   ## How are these changes tested?
   
   Integration tests. 
   


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] feat: Support variadic function in CometFuzz [datafusion-comet]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #2682:
URL: https://github.com/apache/datafusion-comet/pull/2682#discussion_r2492160958


##########
fuzz-testing/src/main/scala/org/apache/comet/fuzz/Meta.scala:
##########
@@ -65,8 +65,12 @@ object Meta {
     (DataTypes.StringType, 0.2),
     (DataTypes.BinaryType, 0.1))
 
-  private def createFunctionWithInputTypes(name: String, inputs: Seq[SparkType]): Function = {
-    Function(name, Seq(FunctionSignature(inputs)))
+  private def createFunctionWithInputTypes(
+      name: String,
+      inputs: Seq[SparkType],
+      varArgs: Boolean = false): Function = {
+    Function(name, Seq(FunctionSignature(inputs, varArgs)))

Review Comment:
   Should there be a check here to ensure that the `inputs` array has a single element if `varArgs == true`?  See my other comment which is related to this.



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] feat: Support variadic function in CometFuzz [datafusion-comet]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove merged PR #2682:
URL: https://github.com/apache/datafusion-comet/pull/2682


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] feat: Support variadic function in CometFuzz [datafusion-comet]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #2682:
URL: https://github.com/apache/datafusion-comet/pull/2682#discussion_r2492157698


##########
fuzz-testing/src/main/scala/org/apache/comet/fuzz/QueryGen.scala:
##########
@@ -103,7 +104,12 @@ object QueryGen {
     val func = Utils.randomChoice(Meta.scalarFunc, r)
     try {
       val signature = Utils.randomChoice(func.signatures, r)
-      val args = signature.inputTypes.map(x => pickRandomColumn(r, table, x))
+      val args =
+        if (signature.varArgs) {
+          pickRandomColumns(r, table, signature.inputTypes.head)

Review Comment:
   This assumes that that the function signature has a single argument type declared?



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] feat: Support variadic function in CometFuzz [datafusion-comet]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #2682:
URL: https://github.com/apache/datafusion-comet/pull/2682#issuecomment-3486299697

   ## [Codecov](https://app.codecov.io/gh/apache/datafusion-comet/pull/2682?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 10.84%. Comparing base ([`f09f8af`](https://app.codecov.io/gh/apache/datafusion-comet/commit/f09f8af64c6599255e116a376f4f008f2fd63b43?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`aefd7b1`](https://app.codecov.io/gh/apache/datafusion-comet/commit/aefd7b10cf92fbde849b3df14509c4b20662a0f0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 658 commits behind head on main.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               main    #2682       +/-   ##
   =============================================
   - Coverage     56.12%   10.84%   -45.29%     
   + Complexity      976      232      -744     
   =============================================
     Files           119      147       +28     
     Lines         11743    13783     +2040     
     Branches       2251     2350       +99     
   =============================================
   - Hits           6591     1495     -5096     
   - Misses         4012    12113     +8101     
   + Partials       1140      175      -965     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/datafusion-comet/pull/2682?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] feat: Support variadic function in CometFuzz [datafusion-comet]

Posted by "manuzhang (via GitHub)" <gi...@apache.org>.
manuzhang commented on code in PR #2682:
URL: https://github.com/apache/datafusion-comet/pull/2682#discussion_r2492494260


##########
fuzz-testing/src/main/scala/org/apache/comet/fuzz/QueryGen.scala:
##########
@@ -103,7 +104,12 @@ object QueryGen {
     val func = Utils.randomChoice(Meta.scalarFunc, r)
     try {
       val signature = Utils.randomChoice(func.signatures, r)
-      val args = signature.inputTypes.map(x => pickRandomColumn(r, table, x))
+      val args =
+        if (signature.varArgs) {
+          pickRandomColumns(r, table, signature.inputTypes.head)

Review Comment:
   Yes, it's easier to implement and avoid refactoring `pickRandomColumn` and other methods.



##########
fuzz-testing/src/main/scala/org/apache/comet/fuzz/QueryGen.scala:
##########
@@ -103,7 +104,12 @@ object QueryGen {
     val func = Utils.randomChoice(Meta.scalarFunc, r)
     try {
       val signature = Utils.randomChoice(func.signatures, r)
-      val args = signature.inputTypes.map(x => pickRandomColumn(r, table, x))
+      val args =
+        if (signature.varArgs) {
+          pickRandomColumns(r, table, signature.inputTypes.head)

Review Comment:
   Yes, it's easier to implement, and avoid refactoring `pickRandomColumn` and other methods.



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org