cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
cancel
Showing results for 
Search instead for 
Did you mean: 

Error with calling a machine learning serving endpoint

notsure
New Contributor

Hi!

I have registered a spark model and generated a serving endpoint based on that.

I am calling the endpoint with the relevant dataframe, somehow I got below errors. Could anyone show me how to tackle it, please?🙏

"Exception: Request failed with status 400, {"error_code": "BAD_REQUEST", "message": "Encountered an unexpected error while evaluating the model. Verify that the serialized input Dataframe is compatible with the model for inference. Error 'requirement failed: Column features must be of type class org.apache.spark.ml.linalg.VectorUDT:struct<type:tinyint,size:int,indices:array<int>,values:array<double>> but was actually class org.apache.spark.sql.types.StringType$:string.'"}

"

3 REPLIES 3

jose_gonzalez
Moderator
Moderator

Hi,

Can you share the request you are sending/using? please provide a screenshot and more details, so we will be able to provide a solution.

Kaniz
Community Manager
Community Manager

Hi @mavis chen​, The error message suggests that the input DataFrame you are passing to the serving endpoint is incompatible with the inference model.

Specifically, it appears that the "features" column in your input DataFrame is StringType, while the model expects it to be VectorUDT.

It would be best to convert the "features" column in your input DataFrame to the correct type.

Anonymous
Not applicable

Hi @mavis chen​ 

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.