mrendi29 opened a new issue, #5721:
URL: https://github.com/apache/iceberg/issues/5721

   ### Query engine
   
   Apache Spark (PySpark)
   
   ### Question
   
   On 
https://iceberg.apache.org/docs/latest/spark-writes/#writing-to-partitioned-tables
 if you need to register the bucket UDF you can do so by:
   
   ```
   import org.apache.iceberg.spark.IcebergSpark
   import org.apache.spark.sql.types.DataTypes
   
   IcebergSpark.registerBucketUDF(spark, "iceberg_bucket16", 
DataTypes.LongType, 16)
   ```
   How would we do this in PySpark? Does the method below work or is there 
another suggested method? 
   
   ```
   from pyspark.sql.types import  LongType
   from pyspark.sql import functions as F
   
   spark.udf.register("iceberg_bucket16", F.bucket(16), LongType())
   ```


-- 
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