zhengruifeng opened a new pull request, #48223:
URL: https://github.com/apache/spark/pull/48223

   ### What changes were proposed in this pull request?
   Make function `count_min_sketch` accept long seed
   
   
   ### Why are the changes needed?
   existing implementation only accepts int seed, which is inconsistent with 
other `ExpressionWithRandomSeed`:
   
   ```py
   In [3]:     >>> from pyspark.sql import functions as sf
      ...:     >>> spark.range(100).select(
      ...:     ...     sf.hex(sf.count_min_sketch("id", sf.lit(1.5), 0.6, 
1111111111111111111))
      ...:     ... ).show(truncate=False)
   
   ...
   AnalysisException: [DATATYPE_MISMATCH.UNEXPECTED_INPUT_TYPE] Cannot resolve 
"count_min_sketch(id, 1.5, 0.6, 1111111111111111111)" due to data type 
mismatch: The 4th parameter requires the "INT" type, however 
"1111111111111111111" has the type "BIGINT". SQLSTATE: 42K09;
   'Aggregate [unresolvedalias('hex(count_min_sketch(id#64L, 1.5, 0.6, 
1111111111111111111, 0, 0)))]
   +- Range (0, 100, step=1, splits=Some(12))
   ...
   
   
   ```
   
   
   ### Does this PR introduce _any_ user-facing change?
   no
   
   
   ### How was this patch tested?
   added doctest
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   no


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to