Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reading SparseVectors and Vectors #425

Open
abditag2 opened this issue Sep 5, 2019 · 3 comments
Open

Support reading SparseVectors and Vectors #425

abditag2 opened this issue Sep 5, 2019 · 3 comments

Comments

@abditag2
Copy link
Contributor

abditag2 commented Sep 5, 2019

Would be very useful if petastorm can read these two data types from HDFS.

@selitvin
Copy link
Collaborator

Agreed. We can try and add. Not sure about the time-frame for this though.

@mengxr
Copy link
Collaborator

mengxr commented Dec 6, 2019

Efficient conversion requires Scala UDFs. Maybe we should add utility methods to Spark so in petastorm we can do the following:

from pyspark.ml.functions import vector_to_dense_array
df.select(vector_to_dense_array(col("features")).alias("features"))

This approach doesn't require Scala code in petastorm. Created a Spark JIRA: https://issues.apache.org/jira/browse/SPARK-30154.

cc: @WeichenXu123

@mengxr
Copy link
Collaborator

mengxr commented Jan 7, 2020

FYI. The UDF was merged into Spark master: apache/spark#26910

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants