Skip to content
Advertisement

Return a table location (path) using SQL query (from Python code)

I am trying to return a table location (path) using a SQL query (in my Python code). Is it possible?

I’m using Hive and the data is stored in hdfs.

I found this snippet of code elsewhere:

But unfortunately I don’t understand it, so I don’t even know how to customise it to my problem.

I want to use this query in my unit tests in the following helper function:

Could anyone shed some light on this problem?

Advertisement

Answer

The answer lied in understanding that finding a table location is database appliance-specific.

For Hive the answer is:

The topic can be closed, thanks for leading me to the correct solution.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement