Discover this year's submissions to the Dataiku Frontrunner Awards and give kudos to your favorite use cases and success stories!READ MORE

Use ImpalaExecutor in Python Public API

Solved!
tomas
Neuron
Neuron
Use ImpalaExecutor in Python Public API

Hi,

 we are using ImpalaExecutor object from dataiku.core.sql to show a table definition. Code like this runs nicely and runs in MUS environment under the user running the python recipe:




from dataiku.core.sql import ImpalaExecutor
imp=ImpalaExecutor(database="work")
df=imp.query_to_df("show create table....")


The question is if it is possible to run this from other DSS or from an API node, using the public API, connection to the DSS instance.



So for example:




url = client.get_variables().get('prod_dss_url')
api_key = client.get_variables().get('prod_dss_api_key')
remote_client = dataikuapi.DSSClient(url, api_key)
? imp = create ImpalaExecutor using the remote_client ?
df=imp.query_to_df("show create table....")


Which would return the DDL from the remote DSS.





Thanks for the help/hint



T



 

0 Kudos
1 Solution
tomas
Neuron
Neuron
Author

I was blind. The solution:




remote_client.sql_query(query="show create table ..... " + hive_table , database=mydb, type = "impala")


 

View solution in original post

0 Kudos
1 Reply
tomas
Neuron
Neuron
Author

I was blind. The solution:




remote_client.sql_query(query="show create table ..... " + hive_table , database=mydb, type = "impala")


 

0 Kudos

Labels

?
Labels (3)
A banner prompting to get Dataiku