I am trying to upload a file to my Teiid REST service which is backed by a virtual procedure. I have defined the input type as blob. Inside the procedure i am trying to make a call to another UDF which takes this blob input and reads the stream. Does Teiid supports a Blob type input in REST service? Does it handle automatic type conversion if i am writing the file to the OutputStream of the HttpUrlConnection object like below?

It does support POST and there is no restriction of the type to use. However it does not handle automatic type conversion, try writing a Blob object to output stream. I have to say I have not tested that scenario. Also not certain for the multi-part stuff will work with Resteasy framework.

Then i tried using SerialBlob but that also resulted in the same error as "java.io.NotSerializableException" . This does work in JDBC but not sure how to make it work with Teiid REST service. Do you have any suggestions? multipart stuff is working with the normal jboss resteasy framework.

Hi Ramesh, I tried using the byte array as suggested. Now the serialization error is gone but my UDF is still getting null input for Blob object. There were no exceptions reported in the jboss/eclipse consoles. Attached the Client and VDB/UDF files i am using.

From what I can see the code is not setup to handle binary inputs in any direct fashion. If you are handling large blobs then we'll have to look at enhancing the code.

Otherwise if your content is not too large you can set the content as a string - for example using BASE64 or HEX encoding, then use the teiid function to_bytes(string_val, 'BASE64') to convert back to bytes when you want to pass the value to your upload function.