Hive Table on ORC file created thru Spark program



I am receiving a csv file which I am dumping it in ORC format after my transformations are done. Spark program creates a ORC file not a hive table as we want to keep out programming logic decoupled of any other tools/technologies.

However, at the same time I want that if required I can create an hive external table to read data from this location where my ORC files are created from Spark program. I am unable to create such a table successfully. Is there a way this can be achieved?