SOLVED

Can you turn off querying hive in Excel Power Query anytime you make a change?

%3CLINGO-SUB%20id%3D%22lingo-sub-2214803%22%20slang%3D%22en-US%22%3ECan%20you%20turn%20off%20querying%20hive%20in%20Excel%20Power%20Query%20anytime%20you%20make%20a%20change%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2214803%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20a%20hive%20schema%20set%20up%20with%20a%20number%20of%20tables%2C%20some%20of%20which%20have%20over%20a%20million%20records.%20We%20are%20trying%20to%20access%20the%20tables%20within%20Excel%20and%20are%20using%20the%20Presto%20Driver%20by%20going%20to%20Get%20Data%20-%26gt%3B%20Other%20Sources%20-%26gt%3B%20ODBC%20-%26gt%3B%20Presto%20(which%20we%20installed%20and%20configured).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20we%20found%20was%20when%20we%20connect%20and%20choose%20the%20table%20and%20select%20transform%20a%20query%20is%20made%20to%20the%20cluster%20if%20there%20isn't%20a%20preview.%20Then%20each%20time%20a%20change%20is%20made%20like%20moving%20a%20column%20or%20deselecting%20a%20column%2C%20etc.%20a%20query%20is%20made%20back%20to%20hive.%20If%20we%20are%20working%20with%20a%20larger%20table%20then%20this%20causes%20performance%20problems.%20Why%20does%20it%20do%20this%20and%20how%20can%20we%20turn%20this%20off%3F%20I%20thought%20the%20preview%20brought%20in%20a%20subset%20of%20data%20and%20only%20pressing%20refresh%20or%20close%20and%20load%20would%20a%20query%20be%20submitted%20back%20to%20hive.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20looked%20in%20the%20Power%20Query%20Options%20and%20Fast%20Load%20is%20NOT%20selected.%20I%20also%20saw%20an%20article%20that%20said%20to%20choose%20Specify%20custom%20default%20load%20settings%20and%20to%20uncheck%20boxes%20which%20I%20did.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20any%20help%20on%20this!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2214803%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

We have a hive schema set up with a number of tables, some of which have over a million records. We are trying to access the tables within Excel and are using the Presto Driver by going to Get Data -> Other Sources -> ODBC -> Presto (which we installed and configured). 

 

What we found was when we connect and choose the table and select transform a query is made to the cluster if there isn't a preview. Then each time a change is made like moving a column or deselecting a column, etc. a query is made back to hive. If we are working with a larger table then this causes performance problems. Why does it do this and how can we turn this off? I thought the preview brought in a subset of data and only pressing refresh or close and load would a query be submitted back to hive.

 

I looked in the Power Query Options and Fast Load is NOT selected. I also saw an article that said to choose Specify custom default load settings and to uncheck boxes which I did. 

 

Thank you for any help on this!

6 Replies
Would it not be wise to setup a query on the database side that limits the amount of data first, rather than pulling in all 1E6 records? I know PQ does something they call query folding (which should limit the amount of network traffic when the query is running), but I don't know if your ODBC driver allows that to happen efficiently.

Hi - @Jan Karel Pieterse in our case we are also using the data in Tableau and will not be able to limit the number of records in the database. I am actually very surprised that the application would send requests to the database for any movement like moving a column to another location.

best response confirmed by awatelet (New Contributor)
Solution

@awatelet 

If you query the server for few millions of records and on next step filtered them down to few hundreds, Power Query in background combine these steps and returns from the server only few hundreds. That's query folding. If it doesn't work or if you break it with another step, filtering will be done on the client site and that could take years to perform.

As far as I know PowerQuery only does that during development of the query, I *think* it is trying to optimize the query along the way. But I'm no PQ expert by any means
Thank you for your response above and will consider filtering first moving forward.
Thank you for taking time to respond and confirming what Sergei posted as well above!