HUE-1933 [impala] Export query result

Review Request #4135 — Created Feb. 12, 2014 and submitted

abec
old-hue-rw
HUE-1933
hue
enricoberti, romain
commit 048a6c63e0106cae323b73bc870b1e7ae037fabe
Author: Abraham Elmahrek <abraham@elmahrek.com>
Date:   Wed Feb 12 12:31:06 2014 -0800

    HUE-1933 [impala] Export query result
    
    Remove empty directories to export to.
    Allow creating and choosing a directory to export to.
    Impersonation issue fixed by adding "server_name" to design initialization.
    use setInterval to force browser redirection.

:100644 100644 80568c0... 77891e9... M  apps/beeswax/src/beeswax/api.py
:100644 100644 09ce359... f38ee50... M  apps/beeswax/src/beeswax/data_export.py
:100644 100644 8f9a924... 7839cbb... M  apps/beeswax/src/beeswax/forms.py
:100644 100644 5e1ceab... b8854f8... M  apps/beeswax/src/beeswax/server/dbms.py
:100644 100644 48ca5c5... 5038729... M  apps/beeswax/src/beeswax/templates/execute.mako
:100644 100644 b53bfc6... 167c52b... M  apps/beeswax/static/js/beeswax.vm.js

commit a112f5db5104e4c44b484e44a24a5d885c8b6189
Author: Romain Rigaux <romain@cloudera.com>
Date:   Mon Feb 10 18:38:41 2014 -0800

    HUE-1933 [impala] Fixing the SQL and hiding mapreduce button

:100644 100644 a48eea8... 5e1ceab... M  apps/beeswax/src/beeswax/server/dbms.py
:100644 100644 8b32bc6... 48ca5c5... M  apps/beeswax/src/beeswax/templates/execute.mako
:100644 100644 316c391... b53bfc6... M  apps/beeswax/static/js/beeswax.vm.js
Tested impersonation problem and path chooser issue.
Can now create results in an existing directory... throws an exception if the file already exists though.
Ran beeswax tests.
Loading file attachments...

  • 3
  • 0
  • 6
  • 0
  • 9
Description From Last Updated
I am wondering: is there way to pick the name of the file and overwrite it? Generally people export a ... romain romain
Cf. below, maybe cleaner to contain all the vars here: 'query_type': IMPALA 'query_type': HQL (IMPALA... from models.py) romain romain
This is ugly, is they a problem with the async call? romain romain
abec
romain
  1. This is cool!
    
    Two main comments:
    - maybe refactor a bit to consolidate the API (which is already complicated)
    - UX of the export (could be done in another jira): it is probably better to accept a filename, create a new directory from the filechooser, , test if both export methods still work and the UX is easy
    1. Let's do UX in another jira. I can add an overwrite checkbox, use a filename instead, etc.
      
      The API seems a bit hard to consolidate... maybe we can split it up?
    2. Also, how about we split up "save to dir" to "save to directory" and "save to file". With save to file, we can add a help icon describing that we don't rerun queries, where as with save to dir we would rerun the query.
  2. apps/beeswax/src/beeswax/api.py (Diff revision 2)
     
     
    PopupException?
    1. It doesn't really matter here, but sure.
  3. apps/beeswax/src/beeswax/data_export.py (Diff revision 2)
     
     
     
     
     
    I am wondering: is there way to pick the name of the file and overwrite it?
    
    Generally people export a doc as a file, like saving a picture to hue.png.
    1. Maybe give people the option of overwriting the file instead.
  4. apps/beeswax/src/beeswax/server/dbms.py (Diff revision 2)
     
     
    probably revert cf. above/below
  5. apps/beeswax/src/beeswax/server/dbms.py (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
    Cf. below, maybe cleaner to contain all the vars here:
    
    'query_type': IMPALA
    
    'query_type': HQL
    
    (IMPALA... from models.py)
    1. Nah, that doesn't make sense. Query type is local to the kind of query you're running, not just what server you're running against.
  6. apps/beeswax/src/beeswax/server/dbms.py (Diff revision 2)
     
     
     
    We should replace it by?
    
    self.query_server = self.client.query_server['server_name']
  7. apps/beeswax/src/beeswax/server/dbms.py (Diff revision 2)
     
     
     
     
    query = hql_query(hql, query_type=self.query_server['query_type'])
    
    and add a line in design.py
    
    data_dict['query']['type'] = query_type
    
  8. apps/beeswax/static/js/beeswax.vm.js (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
    This is ugly, is they a problem with the async call?
    1. I can change the assign calls to window.location.href = "" calls. The setInterval is to force the redirect. Changing the page location is an asynchronous call unfortunately.
  9. 
      
abec
abec
romain
  1. This is really good and indeed better to split like that, it will be easier to improve in the future export wizard!
  2. apps/beeswax/src/beeswax/server/dbms.py (Diff revision 4)
     
     
     
     
    use the new hql_query(hql, query_type)?
    
    The query type is dependent on the servername, (impala will receive impala queries, hs2 hql) so we could even add the query_type directly to the query server dictionary.
  3. apps/beeswax/src/beeswax/tests.py (Diff revision 4)
     
     
    do we test with overwrite=false?
  4. 
      
abec
abec
Review request changed

Status: Closed (submitted)

Loading...