You can translate the question and the replies:

REST data source returning only text/plain

I am using Denodo 6. I am faced with a REST data source that actually returns text/plain only - application/json or application/xml is not offered. Probably the easiest approach is to create a Delimited File data source with a very uncommon delimiter, something like "---------------------------------------- DUMMY DELIM ----------------------------------------". Alternatively, I could write a custom Java-based data source that reads out the returned text string. Is there something better I can do?
user
05-04-2018 08:28:46 -0400

2 Answers

Hi, If the REST response is truly unstructured text, then the Delimited Data Source is probably your best bet. Keep in mind that you can use [regular expressions](https://community.denodo.com/docs/html/browse/6.0/vdp/administration/creating_views/importing_data_sources_and_creating_base_views/delimited_file_sources#examples-of-how-to-define-a-tuple-pattern) to define your tuple instead of a potentially unreliable delimiter, should that fit your data format better. I would be wary of the custom Java data source as you might be adding unnecessary parsing time to your solution which may turn in to a bottleneck depending on the volume involved. One other option you could consider is to create your base view as a single text value and parse it using native Denodo [Text Processing Functions](https://community.denodo.com/docs/html/browse/6.0/vdp/vql/appendix/syntax_of_condition_functions/text_processing_functions) in the Derived Views you build on top of it. This might yield better visibility in to your data structures. I'd look specifically at [SPLIT](https://community.denodo.com/docs/html/browse/6.0/vdp/vql/appendix/syntax_of_condition_functions/text_processing_functions#split) to break a string in to an array (which you could then [FLATTEN](https://community.denodo.com/docs/html/browse/6.0/vdp/administration/creating_views/creating_derived_views/creating_flatten_views)), [REGEXP](https://community.denodo.com/docs/html/browse/6.0/vdp/vql/appendix/syntax_of_condition_functions/text_processing_functions#regexp) to parse the "uncommon delimiters" and replace them with something easier to consume, and the classic [SUBSTR](https://community.denodo.com/docs/html/browse/6.0/vdp/vql/appendix/syntax_of_condition_functions/text_processing_functions#substring-substr) and [INSTR](https://community.denodo.com/docs/html/browse/6.0/vdp/vql/appendix/syntax_of_condition_functions/text_processing_functions#instr) combo for when reliable patterns just can't be made. Hope this helps!
Denodo Team
06-04-2018 12:22:18 -0400
Ok, thanks for answering, this is helpful.
user
09-04-2018 02:42:01 -0400
You must sign in to add an answer. If you do not have an account, you can register here